homebridge-shelly-ng icon indicating copy to clipboard operation
homebridge-shelly-ng copied to clipboard

Fixing state update correctly on homebridge

Open BirknerAlex opened this issue 1 year ago • 1 comments

Fixes https://github.com/alexryd/homebridge-shelly-ng/issues/61

BirknerAlex avatar Jan 16 '24 22:01 BirknerAlex

For me, this doesn't change anything apparently. It seems that target_pos is not updated correctly in the shellies-ng Cover component if it is opened/closed using a physical switch. I didn't investigate at all, but this could perhaps be a bug in the Shelly API itself. A quick and dirty fix that worked for me without changing anything in the library was updating the target position to the value of the current position in the currentPosChangeHandler.

MaxiHuHe04 avatar May 30 '24 14:05 MaxiHuHe04

could anyone make this a easy installable package for n00bs like me? :)

MaDDeePee avatar Sep 28 '24 08:09 MaDDeePee

For me, this doesn't change anything apparently. It seems that target_pos is not updated correctly in the shellies-ng Cover component if it is opened/closed using a physical switch. I didn't investigate at all, but this could perhaps be a bug in the Shelly API itself. A quick and dirty fix that worked for me without changing anything in the library was updating the target position to the value of the current position in the currentPosChangeHandler.

@MaxiHuHe04 How did you solve this? With a simple script running on the shelly? could you share it with us, please?

MaDDeePee avatar Sep 29 '24 15:09 MaDDeePee

You can install my fork (https://github.com/MaxiHuHe04/homebridge-shelly-ng) instead of the original package (uninstall that first) by typing in

npm install https://github.com/MaxiHuHe04/homebridge-shelly-ng.git

in the Homebridge console.

MaxiHuHe04 avatar Sep 30 '24 11:09 MaxiHuHe04

@MaxiHuHe04 does your fork support the same amount of devices as that one from cubi1337 homebridge-shelly-ds9? Is it possible for you to create a PR of the relevant code fraction for the other fork and put the effort together?

apartmedia avatar Sep 30 '24 12:09 apartmedia

I would really appreciate if you two could work it out together <3

MaDDeePee avatar Sep 30 '24 12:09 MaDDeePee

@apartmedia no, I just fixed a few issues and added the ability to use Shelly relays as door locks in HomeKit. Do you have this problem on his fork too? Then I will have to see if I can get it to work on top of his changes.

MaxiHuHe04 avatar Sep 30 '24 12:09 MaxiHuHe04

I do not have physical switches connected, so I can‘t test it. But some users report issues with the state getting out of sync. Look at this issue for example #134 There is also a PR (#108) already for several issues (#24, #37, #45, #52, #61) which might or might not be related, but seems to not solving the whole thing. The author of homebridge-shelly-ds9 cubi1337 says he would looking forward for a PR fixing this. See his comment here

apartmedia avatar Sep 30 '24 15:09 apartmedia

Hey @MaxiHuHe04 can you please look at my issue at https://github.com/alexryd/homebridge-shelly-ng/issues/134 ? I detailed the issue with the plugs' states (plus 1 and plus 2), which don't report their state to the HOME app after being controlled from the physical bridge (after several hours).

Thanks!

ohad-e avatar Oct 01 '24 08:10 ohad-e

@ohad-e my PR should fix the problem regarding covers with directional physical switches. But I think you are having a different issue with your devices as there is no separate target value for switches.

MaxiHuHe04 avatar Oct 01 '24 22:10 MaxiHuHe04

DS9 Version 1.5.4... - thx!

cubi1337 avatar Oct 02 '24 06:10 cubi1337

I can confirm that 2pm with 1.5.4 cover status with wallswitches is updating state now correctly (although there is no "closing..." or "opening..." anymore while moving but i dont care about that!)

Thank you very very much for keeping this alive @cubi1337 <3 <3 :)

MaDDeePee avatar Oct 02 '24 16:10 MaDDeePee

np ... but its @MaxiHuHe04 s Fix ;-)

cubi1337 avatar Oct 02 '24 16:10 cubi1337

We don't have any updates on this repo since 2022, should we move on to another fork like BirknerAlex one ?

tigpt avatar Oct 08 '24 20:10 tigpt

either go with DS9-Fork or just install matterbridge (https://github.com/42wim/matterbridge) on your Homebridge-System. Matterbridge can run side by side with homebridge and all shelly are supported flawlessly. This fork is supported by shelly as well. ;) You don't have to run Matter, just matterbridge with that plugin (https://github.com/Luligu/matterbridge-shelly) and it behaves just like Homebridge :)

MaDDeePee avatar Oct 08 '24 20:10 MaDDeePee

After several hours, there is a problem with the state of the covers. This state update issue is relevant for all the devices controlled with a physical switch and HOME app.

ohad-e avatar Oct 09 '24 08:10 ohad-e