Closed WRTHacker closed 2 years ago
I'm a little confused, are you saying the switch and occupancy sensor both preserve their state properly, but shortly after restart the switch toggles off? What state were they expected to be when the home bridge powers on? Both on? I don't think I quite understand what's happening here but it sounds like maybe the Home app is the side doing something funky, running an automation that toggles the switch back off?
Ok, I will tra to clarify:
Automation:
Together:
Thank you for the additional clarification! I think I found and fixed the issue. The very first reboot after the update will still have the bug, but if I've fixed it it should work as expected for future reboots. Please give it a try and let me know if the issue persists or if you find any other issues! https://github.com/Jason-Morcos/homebridge-magic-occupancy/releases/tag/3.0.1
Hi Jason-Morcos, seems to work properly now. Many thanks for support and quick fix! Best regards
Config:
{ "name": "WLAN Anwesend Delay", "stayOccupiedDelay": 300, "persistBetweenReboots": true, "startOnReboot": false, "statefulSwitchesNames": "WLAN Anwesend Verzögerung", "createMasterShutoff": false, "_bridge": { "username": "0E:03:25:73:D7:AB", "port": 54137 }, "accessory": "MagicOccupancy" }
After a reboot, the state is correct, but after the delay time I see the following in the logs;
[11/6/2021, 7:13:15 PM] [WLAN UniFi anwesend] 1 monitored device(s) found. Accessory is in mode "any" so triggering occupancy. [11/6/2021, 7:13:17 PM] [WLAN Anwesend Delay] Cancel timer and set occupancy to "NotDetected" [11/6/2021, 7:13:17 PM] [WLAN Anwesend Delay] Delay timer stopped
An automation sets the switch "WLAN Anwesend Delay") to on (it was on due to the persistent) when a device is found in the WiFi "WLAN Unifi anwesend" switch. Whe nthis happpens, the next line shows that the switch "WLAN Anwesend Delay" is set to NotDetected, occupancy is not set, and another outomation triggers.
This should not happen.
Please contact me, if you need more information.