Page 1 of 1
Thermometer sensor with only 1 decimal
Posted: Monday 24 September 2018 22:41
by gmarchionni
Hi all,
i'm having a stupid problem, that i tried to solve reading the forum and i could not.
so, i had for a long time a sensor with humidity and another sensor with temperature coming from a gadgeteer board via web json.
working perfectly and represented as 25.20 C degrees. (the gadgeteer board sends 25.20000000000 similar value.)
lately i'm triying to implement, on the same domoticz a new sensor, but i only get 1 decimal point....how can i change this behaviour?
the problem is not the sensor, because the same gadgeteer board with the same software, on a new IDX sensor, works with only 1 decimal...
Thanks for any help...
Giulio
Re: Thermometer sensor with only 1 decimal
Posted: Saturday 29 September 2018 1:01
by gmarchionni
no one knows what i'm talking about?
Re: Thermometer sensor with only 1 decimal
Posted: Saturday 29 September 2018 1:42
by waaren
gmarchionni wrote: ↑Monday 24 September 2018 22:41
so, i had for a long time a sensor with humidity and another sensor with temperature coming from a gadgeteer board via web json.
working perfectly and represented as 25.20 C degrees. (the gadgeteer board sends 25.20000000000 similar value.)
lately i'm triying to implement, on the same domoticz a new sensor, but i only get 1 decimal point....how can i change this behaviour?
the problem is not the sensor, because the same gadgeteer board with the same software, on a new IDX sensor, works with only 1 decimal...
I am on version 4.10009 and on that version when updating a (virtual) temp-sensor using json the value is chopped to 1 decimal even if the json sends more. The value in the database also has only 1 decimal. Don't know with what version this change was implemented.
If you update the same sensor with dzVents more decimals are accepted and in the database and shown on the GUI.
So if you need the extra decimals you are probably forced to use a workaround(sending the value to a uservariable or dummy custom sensor first and use dzVents (or maybe Lua) to copy that to the temperature sensor.
You might want to raise a feature request on GitHub to make the amount of decimals in temperature sensors a configurable setting.
Re: Thermometer sensor with only 1 decimal
Posted: Saturday 29 September 2018 16:35
by gmarchionni
Thanks....but weird..as i already have a sensor with 2 decimals...
so either it was already with 2 decimals and it has been trimmed to 1 or i don't know.
i'll look into having a variable and update it that way.
thanks
Re: Thermometer sensor with only 1 decimal
Posted: Sunday 28 October 2018 11:06
by svde
waaren wrote: ↑Saturday 29 September 2018 1:42
gmarchionni wrote: ↑Monday 24 September 2018 22:41
so, i had for a long time a sensor with humidity and another sensor with temperature coming from a gadgeteer board via web json.
working perfectly and represented as 25.20 C degrees. (the gadgeteer board sends 25.20000000000 similar value.)
lately i'm triying to implement, on the same domoticz a new sensor, but i only get 1 decimal point....how can i change this behaviour?
the problem is not the sensor, because the same gadgeteer board with the same software, on a new IDX sensor, works with only 1 decimal...
I am on version 4.10009 and on that version when updating a (virtual) temp-sensor using json the value is chopped to 1 decimal even if the json sends more. The value in the database also has only 1 decimal. Don't know with what version this change was implemented.
If you update the same sensor with dzVents more decimals are accepted and in the database and shown on the GUI.
So if you need the extra decimals you are probably forced to use a workaround(sending the value to a uservariable or dummy custom sensor first and use dzVents (or maybe Lua) to copy that to the temperature sensor.
You might want to raise a feature request on GitHub to make the amount of decimals in temperature sensors a configurable setting.
I'm also seeing that when values are updated via dzvents more decimals are possible. When values are updated via JSON they are chopped / rounded off. This is causing unreliable predictions in my thermostat script. I'm just writing this to let you know you're not the only one looking into this...
Submitted an issue on github:
https://github.com/domoticz/domoticz/issues/2811
Re: Thermometer sensor with only 1 decimal
Posted: Sunday 28 October 2018 14:02
by SweetPants
What sensor do you use? Most temp sensors have an accuracy of +/- 0.5 degrees and even more worse at lower temperatures. Needing more then one decimal seems overdone to me
Re: Thermometer sensor with only 1 decimal
Posted: Sunday 28 October 2018 15:56
by svde
OK... interesting to see that the first response is a question about which sensors I use, and the inevitable discussion starts on the accuracy of the sensor, that a human can't even feel the difference (which I agree with), etc.
I can tell you that the sensors in question are wireless sensor tags
https://store.wirelesstag.net/collections/all and I will also be using some DHT22's.
The reason why I have an issue with the fact that something in domoticz changed (+/- 2018.06.07) is that I take the temperature delta between 20 minutes ago and now, multiple that by 6 (20 minutes * 6 = 2 hours) and add that to the current temperature. This gives an indication / prediction what the temperature may be like in 2 hours time (if the trend from the last 20 minutes continues). When that prediction dips under the room setpoint, it's time to turn on the heatpump and open the valves to the underfloor heating.
If the setpoint is 20C, and you the room temperature is just above the setpoint, then only having a 1 decimal resolution as input into the prediction causes the heatpump to turn on when its not necessary. In my usecase the accuracy of the sensors doesn't really matter, as long as it is able to send a few more decimals to domoticz, as long as those decimals are relatively accurate (within the sensor), it'll work for me.
I didn't notice the change in domoticz which was made in the European spring until this weekend, when my heater turned on again for the first time since March.
2 more things to consider:
- updating values with DzVents allows for two decimal temperature values to be put into the system
- the humidity values are registered in the system (even via json) with a lot of decimals. So why is the temperature value chopped, but not the humidity value?
Re: Thermometer sensor with only 1 decimal
Posted: Monday 29 October 2018 9:13
by svde
Fixed in 10122.
Re: Thermometer sensor with only 1 decimal
Posted: Friday 30 November 2018 21:02
by gmarchionni
Thanks.
I cannot understand though, why a thermometer sensor that was added a long time ago, when it used to work with 2 decimals, it's still showing up in 2 decimals on 4.9700.
Is this how it's supposed to work?