Understanding the "Enable Polling"
Posted: Monday 18 March 2019 11:58
(was: Solving not fysically switching, whilst switching in Domoticz)
Since I moved from a PC with Ubuntu, to a Raspberry Pi, I found a strange issue, which I am trying to solve more sturdily.
I have my shoplights switch off when I am more then 500 meters from the shop (and switch on when the door is opened and I am within those 500 meters). However, I found that on multiple occasions the lights were still on. The last time I saw this on my security camera, so I logged in into Domoticz and found that the device (aswell as the virtual switch) were set to "OFF". I turned the device on again and off, which solved the problem. I then changed the DZVents code to 1) Switch off, 2) Switch on after 5 seconds, 3) Switch off again after 10 seconds. For the time being it seemed to have worked (at least I haven't arrived in the shop anymore, seeing the lights being on still), but this is not a proper way to solve the issue, I would think.
I now realised there is a "Enable Polling" checkbox with each device, so I would think that it would be a good idea to switch on that polling. I would guess that if the device is switched off, but at the next poll the device returns that it is actually still on, the device would update the status of the device. A DZVents script could then be triggered upon the device change, and compare the switch status with the status of the virtual device. If they do not match, the virtual status would be implemented to the physical device.
Do you agree to such approach or is there a better solution?
- Raspberry Pi
- Domoticz Beta
- Aeon USB stick gen 5
- CoolCam Power plugs
Since I moved from a PC with Ubuntu, to a Raspberry Pi, I found a strange issue, which I am trying to solve more sturdily.
I have my shoplights switch off when I am more then 500 meters from the shop (and switch on when the door is opened and I am within those 500 meters). However, I found that on multiple occasions the lights were still on. The last time I saw this on my security camera, so I logged in into Domoticz and found that the device (aswell as the virtual switch) were set to "OFF". I turned the device on again and off, which solved the problem. I then changed the DZVents code to 1) Switch off, 2) Switch on after 5 seconds, 3) Switch off again after 10 seconds. For the time being it seemed to have worked (at least I haven't arrived in the shop anymore, seeing the lights being on still), but this is not a proper way to solve the issue, I would think.
I now realised there is a "Enable Polling" checkbox with each device, so I would think that it would be a good idea to switch on that polling. I would guess that if the device is switched off, but at the next poll the device returns that it is actually still on, the device would update the status of the device. A DZVents script could then be triggered upon the device change, and compare the switch status with the status of the virtual device. If they do not match, the virtual status would be implemented to the physical device.
Do you agree to such approach or is there a better solution?
- Raspberry Pi
- Domoticz Beta
- Aeon USB stick gen 5
- CoolCam Power plugs