nfarina / homebridge-dummy

Dummy switches for Homebridge: https://github.com/nfarina/homebridge
262 stars 82 forks source link

[Bug] Stateful Switch Becomes Stateless Until Homebridge Reboot #44

Closed pickanothername closed 2 years ago

pickanothername commented 2 years ago

Hi! I'm running into a pretty frustrating issue with my timer dummy switch. About every 24 hours or so, it stops behaving as expected. It turns itself on and will not turn off again. Attached is a video of the bug and a screenshot of my configuration. I've tried all different combinations of config settings to no avail. As far as I can tell, this should be working just fine.

It's also worth noting that for some reason this issue has gotten more prevalent in the past week or so- it used to only be a few times a month and now it occurs daily.

https://user-images.githubusercontent.com/1732093/136672753-6e5305f1-d7b1-4997-b621-2503d1720c93.mov

Screenshot at Oct 09 13-11-49
kheewei commented 2 years ago

Hey @JuniorGenius sorry I didn't see your replies in my original issue. In my case I decided to change the approach and then eventually I got the Sensibo. However, based on what I have found on the net previously, I think my issue had something to do with cross pairing the devices (e.g. the Xiaomi remote in Aqara home app, even though it's supposed to be supported), but most likely this has been fixed.

In your case, have you changed any config (which I'm guessing no)? But anyway, I think the way to tackle your problem would be to find out what are the triggers that will turn on this timed dummy switch. Maybe it's the automation that keeps it turned on since it is resettable? I have not created any timed dummy switch before so I'm familiar with the behaviour.

Other than that, I also have some intermittent issue of devices going offline for just a while and then going back online. Some of these are not even HomeBridge, they are HomeKit compatible. IIRC, I have seen some HomeBridge users reporting the same issue on HomeBridge devices. Maybe this would cause your switch not to turn off (like when it's about to, but then the HomeBridge server is down etc.). One of the probable root cause was something related to the network lease / connection stability, but I gave up and just let it be since each time it doesn't persist for very long, and it usually happens at odd hours.

Hope this helps.

pickanothername commented 2 years ago

Hey @JuniorGenius sorry I didn't see your replies in my original issue. In my case I decided to change the approach and then eventually I got the Sensibo. However, based on what I have found on the net previously, I think my issue had something to do with cross pairing the devices (e.g. the Xiaomi remote in Aqara home app, even though it's supposed to be supported), but most likely this has been fixed.

In your case, have you changed any config (which I'm guessing no)? But anyway, I think the way to tackle your problem would be to find out what are the triggers that will turn on this timed dummy switch. Maybe it's the automation that keeps it turned on since it is resettable? I have not created any timed dummy switch before so I'm familiar with the behaviour.

Other than that, I also have some intermittent issue of devices going offline for just a while and then going back online. Some of these are not even HomeBridge, they are HomeKit compatible. IIRC, I have seen some HomeBridge users reporting the same issue on HomeBridge devices. Maybe this would cause your switch not to turn off (like when it's about to, but then the HomeBridge server is down etc.). One of the probable root cause was something related to the network lease / connection stability, but I gave up and just let it be since each time it doesn't persist for very long, and it usually happens at odd hours.

Hope this helps.

Hey @kheewei! Thanks for the info!

Yeah, in my case I don't think it's an automation, since the only automation that controls the virtual switch is a physical (stateless) button that has to be pressed to trigger it. Also, there's definitely no automation that is set to turn on the virtual switch when it turns off, so regardless there's still a strange issue there. I do suspect it's some sort of bug relating to connectivity- perhaps when homebridge disconnects the virtual switch enters this glitched state. I'm not too sure, though. Very strange!

kheewei commented 2 years ago

Hey @JuniorGenius , ok in that case, do you mind sharing what physical switch/remote are you using to trigger the dummy switch and how is it connected to HomeKit (if it's a physical remote button then there should be a hub)? Cause this sounds a little bit like my initial issue, whereby the Xiaomi Remote (added to Aqara Hub, not a Xiaomi Hub) would be sending the single click command to HomeKit like every hour. I also had a similar issue when I cross paired a motion sensor in the same way.

However, this issue is probably not exclusive to when cross pairing device and hub across diff brands. I'm guessing it could happen within the same brand of device / hub. But this is issue has got more to do with how the devices are integrating with HomeKit, not so much on the dummy switch plugin, I believe.

Have you tried any of the following (I know it's annoying, but I don't have much other solution lol):

pickanothername commented 2 years ago

Hey @JuniorGenius , ok in that case, do you mind sharing what physical switch/remote are you using to trigger the dummy switch and how is it connected to HomeKit (if it's a physical remote button then there should be a hub)? Cause this sounds a little bit like my initial issue, whereby the Xiaomi Remote (added to Aqara Hub, not a Xiaomi Hub) would be sending the single click command to HomeKit like every hour. I also had a similar issue when I cross paired a motion sensor in the same way.

However, this issue is probably not exclusive to when cross pairing device and hub across diff brands. I'm guessing it could happen within the same brand of device / hub. But this is issue has got more to do with how the devices are integrating with HomeKit, not so much on the dummy switch plugin, I believe.

Have you tried any of the following (I know it's annoying, but I don't have much other solution lol):

  • Deleting the automation of the button and recreating it.
  • Deleting the button from the hub and re-pair again (and of course set up the automation again).
  • Restart the hub?
  • Last one, which is gonna be a pain unless you have a backup, which is to delete the automation, delete the device from hub, and delete the hub from HomeKit. And start over.

Sure thing! It's a SmartThings button (with legacy set to false as per the linked instructions)

The only reason I'm not entirely convinced it's the button causing it is because the virtual switch automatically turns itself on immediately after being turned off every time. I suppose next time it happens I could disconnect the button from the network and see if the issue persists?

pickanothername commented 2 years ago

Update: I'm confirmed and am certain that this issue is with the plugin and not with an automation or physical button. The only automation I have that controls the virtual switch also flashes my lights, which does not happen.

pickanothername commented 2 years ago

I found the issue. It was a HomeKit automation after all. >_<

In my defense, the automation never controlled the virtual switch, but it was in such a glitched state apparently that I couldn't open it to edit it at all. I suppose when it would run it would just glitch and turn off the virtual switch, instead of doing what it was supposed to do. I suppose really this should be a HomeKit bug report. Thanks for the insight @kheewei- you were right after all!