简体   繁体   中英

Device principle in IoT Hub

I am using an IoT Hub to send telemetric to an IoT Hub. This is working fine but I am a bit unsure on how to set the deviceid.

Eg the following scenario I have 100 buildings with 1-5 cooling system. There are 8 different types of cooling systems (depend on size of building). Each of the cooling systems has a number of sensors and all of these sensor data are sendt to a computer in the building. This computer is connected to the IoT hub and sends this info to Azure via IoT Hub.

Should the device id be the buildingid or the individual cooling system id? I know that in the device registry I can add properties for a device. So if I create a device for each cooling system I can add Model, BuildingId etc. So in this manner I would know what devices that belong to which building etc.

So I would have to register each cooling system in the building as a device and the computer connected to the IoT hub would need to manage the credentials for each device (cooling system) and send their data using the correct credentials.

Is this correct? If someone could explain this I would appreciate it.

(I'm very rusty...) with mqtt I'd use a topic like "building1/coolingSystem2/sensor3" and shove the sensor readings into the message.

The subscriber can then filter to things like:

  • all sensor info over all buildings
  • just sensor info for building1 etc.

see: http://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices

If you are trying to send Cloud device messages or you say , your devices have subscribed for change update from application, using separate deviceid for each device is reasonable and further as you already said , you can enrich meta data to identify which building or floor it is coming from. So using deviceID for each cooling system would be better for longer run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM