Page 1 of 1

DS18B20 Slow to update in Domoticz

Posted: Monday 16 November 2020 11:00
by gregoinc
Hello,

I have 2 x DS18B20 temperature sensors directly connected to a RPI. I've checked the sensors are operating correctly at the operating system level by going to /sys/bus/w1/devices/ directory.

In the first sensor directory I did the following...
/sys/bus/w1/devices/28-02131b13f9aa $ cat w1_slave

And in the second sensor the same...
/sys/bus/w1/devices/28-02131b3fdeaa $ cat w1_slave

Both sensors gave accurate readings and the updates were literally instantaneous i.e. when I held each sensor in my hand and did the cat w1_slave.

Meanwhile, back in Domoticz the temperature updates are extraordinarily slow... really noticeably slow.

In the Domoticz log I am seeing...
2020-11-16 20:40:00 22.4
2020-11-16 20:45:00 27.6
2020-11-16 20:50:00 24.3
2020-11-16 20:55:00 23.8

These readings are 5 minutes apart... surely there has to be a way to speed that up? Any help greatly appreciated.

Re: DS18B20 Slow to update in Domoticz

Posted: Monday 16 November 2020 14:20
by kiddigital
What Domoticz hardware devices do you use to read the devices?

Re: DS18B20 Slow to update in Domoticz

Posted: Monday 16 November 2020 14:41
by waaren
gregoinc wrote: Monday 16 November 2020 11:00These readings are 5 minutes apart... surely there has to be a way to speed that up? Any help greatly appreciated.
These log entries you look at are the values stored in the short log table. Domoticz does take the actual values once every 5 minutes and store them in these short log tables. This does not mean that the sensor is not updated more frequently as you can see when you look at the temperature tab.

Re: DS18B20 Slow to update in Domoticz

Posted: Tuesday 17 November 2020 11:36
by gregoinc
Hi waaren,

Thanks for the info. I ended up changing the Sensor Poll Period in the 1 Wire Temp hardware entry, which appears to have increased the frequency of the polling. The polling period was originally set to 300000 milliseconds, and since changing it to 60000 milliseconds the time has dropped from 5 minutes to 60 seconds.

From the log...

2020-11-17 21:38:26.799 (1 Wire Temp) Temp (Outside Temp)
2020-11-17 21:38:56.803 (1 Wire Temp) Temp (Inside Temp)
2020-11-17 21:39:26.806 (1 Wire Temp) Temp (Outside Temp)
2020-11-17 21:39:56.809 (1 Wire Temp) Temp (Inside Temp)

Not sure if that is the best approach?
Screenshot from 2020-11-17 21-21-52.png
Screenshot from 2020-11-17 21-21-52.png (97.42 KiB) Viewed 840 times

Re: DS18B20 Slow to update in Domoticz

Posted: Tuesday 17 November 2020 11:45
by waaren
gregoinc wrote: Tuesday 17 November 2020 11:36 Thanks for the info. I ended up changing the Sensor Poll Period in the 1 Wire Temp hardware entry, which appears to have increased the frequency of the polling. The polling period was originally set to 300000 milliseconds, and since changing it to 60000 milliseconds the time has dropped from 5 minutes to 60 seconds.
The device is likely to be updated more frequently with this setting but the entries in the short log table will still be 5 minutes apart. So it depends what you want to do with the updated temperature. When used for follow up actions (like notifications or scripts) increasing the polling frequency could help but if it is for domoticz (graph) log, it will not make any difference.

Re: DS18B20 Slow to update in Domoticz

Posted: Wednesday 18 November 2020 0:20
by gregoinc
waaren wrote: Tuesday 17 November 2020 11:45 The device is likely to be updated more frequently with this setting but the entries in the short log table will still be 5 minutes apart. So it depends what you want to do with the updated temperature. When used for follow up actions (like notifications or scripts) increasing the polling frequency could help but if it is for domoticz (graph) log, it will not make any difference.
Hi waaren... Thanks for the feedback. Yes, I am more focused on a greater update frequency for scripting, my current environment operates on a 30 second update of temperature. The temperature in the room can change significantly in 5 minutes, which is why I was keen to ensure a more frequent polling into the scripts.