Humidity hardware sensor update / nvalues must be integers
Posted: Wednesday 17 April 2024 18:21
This one is obvious once you bang your head aginst the wall for a while. Just documenting it in the hope it's more easily searchable
I have a sensor I only want the Humidity reading from, its value comes into Domoticz from Node-red, where the input is a plain numeric value that is then JSON wrapped and sent via mqtt to the domoticz/in topic.
The format for the JSON being sent derived from here https://piandmore.wordpress.com/2019/02 ... -domoticz/
Except it didn't work. Data was received as the"Last seen" time updates, just no actual value update. No log errors in a standard log.
If I changed the sensor to a temperature and humidity sensor, and just used a dummy temperature value, that worked, the humidity value was read and reported, along with a useless dummy temperature I don't need, long term reporting concentrates on the temperature, not the Humidity, not what I want. The more learned are probably already nodding their heads at my mistake.
It took a while but I eventually found the reason. The combined sensor receives its values as an svalue, the Humidity only sensor receives the value as an nvalue, which, in my defence I could not find mentioned anywhere, bar a mention in the forum if actually searching for it, must be an integer. My sensor reports to one decimal place so the value was simply ignored, if an integer is sent it works fine. The solution will be to send only the integer as my use is fine for just the integer value.
Definitely one to be aware of.
I have a sensor I only want the Humidity reading from, its value comes into Domoticz from Node-red, where the input is a plain numeric value that is then JSON wrapped and sent via mqtt to the domoticz/in topic.
The format for the JSON being sent derived from here https://piandmore.wordpress.com/2019/02 ... -domoticz/
Except it didn't work. Data was received as the"Last seen" time updates, just no actual value update. No log errors in a standard log.
If I changed the sensor to a temperature and humidity sensor, and just used a dummy temperature value, that worked, the humidity value was read and reported, along with a useless dummy temperature I don't need, long term reporting concentrates on the temperature, not the Humidity, not what I want. The more learned are probably already nodding their heads at my mistake.
It took a while but I eventually found the reason. The combined sensor receives its values as an svalue, the Humidity only sensor receives the value as an nvalue, which, in my defence I could not find mentioned anywhere, bar a mention in the forum if actually searching for it, must be an integer. My sensor reports to one decimal place so the value was simply ignored, if an integer is sent it works fine. The solution will be to send only the integer as my use is fine for just the integer value.
Definitely one to be aware of.