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.
Humidity hardware sensor update / nvalues must be integers
Moderators: leecollings, remb0
- jvdz
- Posts: 2276
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Humidity hardware sensor update / nvalues must be integers
The best is to go to the JSON domoticz definition where you can find the details required for the specific devices as described in the MQTT wiki page:

so for Humidity: https://www.domoticz.com/wiki/Domoticz_ ... s#HumidityMQTT to Domoticz
The format is mostly compatible as described in the JSON wiki: Domoticz_API/JSON_URL's
... and as you can see: The svalue has a different purpose for the humidity sensor.Humidity
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=HUM&svalue=HUM_STAT
The above sets the parameters for a Humidity device
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
HUM = Humidity: 45%
HUM_STAT = Humidity_status
Humidity_status can be one of:
0=Normal
1=Comfortable
2=Dry
3=Wet

New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest