Page 1 of 1

Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 12:04
by Ragdag
I'm writing a plugin that is polling my heat pump every xx seconds, I'm wondering if it is best practice to only send changed values to the devices and exclude the other ones. Or would it be better from a history perspective and graphing to always send the values on each poll?

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 14:33
by psubiaco
You have to update only changed value, if you don't want to fill the device history with a huge quantity of data.

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 19:25
by waltervl
In Domoticz it does not matter how much data you send for normal sensors (Temp, energy etc). These values are stored in the database every 5 minutes. If you send more times the updates will be stored only in memory and avarage will be stored in the database after 5 min.
But updating every x seconds could also trigger scripts or MQTT send actions every x seconds which could give extra load to your system.

For text devices and switches it is better to only send real changes as every update will be logged in the switch log. Switch log will be emptied every x days depending of your housekeeping settings but a lot of updates can create a lot of data.

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 19:31
by Ragdag
waltervl wrote: Friday 07 February 2025 19:25 In Domoticz it does not matter how much data you send for normal sensors (Temp, energy etc). These values are stored in the database every 5 minutes. If you send more times the updates will be stored only in memory and avarage will be stored in the database after 5 min.
But updating every x seconds could also trigger scripts or MQTT send actions every x seconds which could give extra load to your system.

For text devices and switches it is better to only send real changes as every update will be logged in the switch log. Switch log will be emptied every x days depending of your housekeeping settings but a lot of updates can create a lot of data.
Thank you for the detailed answer, so ideally we would only send changed data and send a refresh after 5 minutes for all sensors.

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 19:43
by waltervl
For switches and text devices only update when needed.... Even not refresh every 5 minutes.....

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 19:53
by Ragdag
waltervl wrote: Friday 07 February 2025 19:43 For switches and text devices only update when needed.... Even not refresh every 5 minutes.....
Check, apologies I meant refresh for temperature, and custom sensors that have graph capabilities

Finally, is it possible in Domoticz to set levels in the graph indicating normal operating ranges?
Image

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 21:03
by waltervl
For temperature and custom sensors just use a good polling time and update them.

There is as far as I know no extra level indication.

Re: Best pratice for updating frequency of device values from plugin

Posted: Friday 07 February 2025 21:48
by Ragdag
waltervl wrote: Friday 07 February 2025 21:03 For temperature and custom sensors just use a good polling time and update them.

There is as far as I know no extra level indication.
Thanks for the help and information.