I am writing a script to control the Web Power Switch II from Digital Loggers. I have things pretty much the way I want them, but can't figure out one item. I use hs.DeviceButtonAdd to add three new buttons - On, Off, and Cycle.
When you press On, the outlet turns On. When you press Off, the Outlet turns Off. Cycle is supposed ot turn it Off and then On.
The buttons work fine and trigger my script as appropriate. As part of the script, I update the Homeseer Device Status to On or Off based on the button I pressed (I hope to eventually read the status from the device, but for now, it is just based on the button press).
This works, BUT when I press ON to turn the Device ON, the Status field does not update until I refresh the screen. I guess this wouldn't be so terrible, but if I press On and then Off, the status actually shows On since pressing the Off button refreshed the screen. If I manually refresh, then it is correct.
If I look at any of my lighting controls, as soon as I press the On button to turn on a light, the status turns to On as expected without any screen refresh.
So how do I make my custom buttons behave like the built-in On/Off buttons???

Thanks,
Scott
When you press On, the outlet turns On. When you press Off, the Outlet turns Off. Cycle is supposed ot turn it Off and then On.
The buttons work fine and trigger my script as appropriate. As part of the script, I update the Homeseer Device Status to On or Off based on the button I pressed (I hope to eventually read the status from the device, but for now, it is just based on the button press).
This works, BUT when I press ON to turn the Device ON, the Status field does not update until I refresh the screen. I guess this wouldn't be so terrible, but if I press On and then Off, the status actually shows On since pressing the Off button refreshed the screen. If I manually refresh, then it is correct.
If I look at any of my lighting controls, as soon as I press the On button to turn on a light, the status turns to On as expected without any screen refresh.
So how do I make my custom buttons behave like the built-in On/Off buttons???

Thanks,
Scott
Comment