V_ID/V_SERIAL to send sensors natural/built in ID's to controller.
-
Hi!
For sensors that have natural/built in ID's for example DS1820 temp sensors it would be nice to have an V_ID or V_SERIAL to send to the controller to identify the sensor. This can be done via for example one of the V_VAR* or any other for that matter but an common V_ for sending this kind of information over the air.
/Magnus
-
Hi!
For sensors that have natural/built in ID's for example DS1820 temp sensors it would be nice to have an V_ID or V_SERIAL to send to the controller to identify the sensor. This can be done via for example one of the V_VAR* or any other for that matter but an common V_ for sending this kind of information over the air.
/Magnus
-
Yes, and if you have an controller that can give you the latest value for V_ID it can be used to remember the sensor ID on start up without having it in the EEPROM of the node.
This will be very useful if you have multiple DS1820-sensors on the same bus and one goes bad. If you remove the sensor from the controller a new ID will be assigned next start up.
Pseudo code (yes I know that request does not respond with the data):
listOfSensors = findAllSensors() for(1..MAX_SENSOR_ID as i) { id = gw.request(i,V_ID); if(id in listOfSensors) { sensor[id] = i; gw.present(sensor[id],S_TEMP); } } for(listOfSensors as id) { if(not exist sensor[id]) { sensor[id] = find_free_id(); gw.present(sensor[id],V_TEMP); } } -
Yes, and if you have an controller that can give you the latest value for V_ID it can be used to remember the sensor ID on start up without having it in the EEPROM of the node.
This will be very useful if you have multiple DS1820-sensors on the same bus and one goes bad. If you remove the sensor from the controller a new ID will be assigned next start up.
Pseudo code (yes I know that request does not respond with the data):
listOfSensors = findAllSensors() for(1..MAX_SENSOR_ID as i) { id = gw.request(i,V_ID); if(id in listOfSensors) { sensor[id] = i; gw.present(sensor[id],S_TEMP); } } for(listOfSensors as id) { if(not exist sensor[id]) { sensor[id] = find_free_id(); gw.present(sensor[id],V_TEMP); } } -
I am actually using the DS2401s to generate IDs within my Mysensor network.
I have created two arrays, one with the DS2401 ID, the other with the location (text) of the sensor.
(it should be possible to do this in a single array BTW)In this way I can label my Node with the location name at boot, but more important it labels the children with the location.
(in addition in my Arduino script I am labeling the Arduino hardware platform as part of the node name)Imagine having a list of 15 DHT22's in Domoticz, it is quite challening to find the right DHT22 for a certain location.
(I am using Domoticz)But I acutally should include the Node-ID in my script, in that way I don't need to query it at boot time :)