- Posted on
Sun Apr 16, 2023 2:07 am
-
GlennNZ
offline
-
- Posts: 1574
- Joined: Dec 07, 2014
- Location: Central Coast, Australia
Hi,
I'm back and have gone down a very deep rabbit hole after his - in fact I'm am still in it!
Can see the issue.
Valves are a special test case which need Active to be set, a period of time to pass and InUse then to be set to the same, and then the reverse.
The devices here are On/Off devices and don't follow the same logic.
This is an issue - as there is a race condition with threads/async and timing of one versus another can't be guaranteed. Well particularly the issue is we don’t receive any feedback that the first has been successful, to know when to send the 2nd. Then there is a 2nd issue where deviceUpdate catches the device change and tries again, with these 2 events crashing into each other. This means sometimes updates correctly, sometimes doesn't. Always turns device on correctly though.
Potentially may need separate event handler (but ideally that would be in pyHAP library)
Also seeing some likely unrelated issues, so still at it - although will have a pause and see if solution jumps out
Would suggest meanwhile - delete devices and then re-add them as switches, this more closes follows what they are in Indigo - and will work fine.
Glenn
Last edited by
GlennNZ on Sun Apr 16, 2023 3:05 pm, edited 2 times in total.