bbqkees / ems-esp-domoticz-plugin

Domoticz plugin for the EMS Wi-Fi Gateway with Proddy's EMS-ESP firmware
MIT License
7 stars 8 forks source link

Update device state #9

Closed sq4bja closed 3 years ago

sq4bja commented 4 years ago

Is it possible to change the way devices are updated? Currently, every telegram updates the devices in domoticz. Even if the change of state did not occur. It would be good to verify the current state of the device in Domoticz and apply the update if there is a difference. After this modification, you can create DZVents scripts that will run only after changing the status of the device, not every 10 seconds. It saves a lot of CPU performance and the size of the database of all updated devices. Tom

bbqkees commented 4 years ago

Yes you are right the current plugin bombards Domoticz with status updates. Its still on the todo list.

bbqkees commented 4 years ago

With every new telegram the current values are checked for most devices, however I was comparing them in the wrong way so even when the value was the same it still updates. Its something I'll change in a next update somewhere next month.

bbqkees commented 4 years ago

I'm currently simplifying the plugin and already testing a fix for the updates.

bbqkees commented 4 years ago

Can you try the dev? All devices should only be updated when the value has actually changed.

sq4bja commented 4 years ago

Ok, it works. But i don't know what will happen if the device is not updated for a long time. Will it not appear in red like offline?

bbqkees commented 4 years ago

Yes after a certain amount of time the sensors time out. I'll see if I can add a check to the sensor updates when its after a certain amount of time it will update the sensor even if its still the same value. maybe i can also add a parameter so you can configure the timeout-check yourself.