Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state of the plug issue #134

Open
ohad-e opened this issue Sep 18, 2024 · 26 comments
Open

state of the plug issue #134

ohad-e opened this issue Sep 18, 2024 · 26 comments

Comments

@ohad-e
Copy link

ohad-e commented Sep 18, 2024

From time to time, the state of the physical switch doesn't update in the HOME app, so. For example, the lamp is on, but the state of the switch in the HOME app is off, and then I can't control the state from the HOME app (the button in the app not responding). To solve this, I have two options:

  1. to turn off, for example, the physical switch, and then I can control it again from the HOME app
  2. restart the bridge, and then the state of the devices will be updated again.

It happens a lot... Does this happen to other people?
Many thanks

@apartmedia
Copy link

What exact type of Shelly are you talking about? Is authentication or password restricted login activated on the affected Shelly device?

@ohad-e
Copy link
Author

ohad-e commented Sep 18, 2024 via email

@apartmedia
Copy link

If you need password protection activated you might need to switch to another plugin.
Their is a technical communication issue with Shelly NG devices and this repo if authentication is activated. You can read about it in the issues.
As @alexryd seems to be AFK and there is a long time no maintenance on this repo you should probably switch to another plugin or fork.
As far as I can tell homebridge-shelly-ds9 from cubi1337 is the most active one. That fork supports more NextGen Shelly’s and has also a fix for password protected devices already implemented.
If you would like to stay at the current plugin and repo you can disable password protection on the supported Shelly NG devices and they should work as expected.

@ohad-e
Copy link
Author

ohad-e commented Sep 18, 2024 via email

@apartmedia
Copy link

Hm, that’s strange. I‘m using a Shelly Plus 1 with password protection with the ds9 plugin without any issues.
What happens if you deactivate authentication? Does that change anything or resolve the issue?
Version 1.1.2 should have fixed this re-auth issue related to password protected devices.

@ohad-e
Copy link
Author

ohad-e commented Sep 18, 2024 via email

@apartmedia
Copy link

apartmedia commented Sep 18, 2024

Yes, I have password protection enabled and controlling the device is working flawless.
But honestly I haven‘t connected a physical switch, so you are right and it might be a complete different issue. Most of the time I‘m controlling the device only via home app not a physical switch. Are you using a regular flip switch or momentary button? Is the Shelly configured correctly for your type of physical switch?
The state should be communicated in the same way as the control commands (using web sockets).
Can you open the web gui of the Shelly and see if the physical switch state is displayed there correctly?

@ohad-e
Copy link
Author

ohad-e commented Sep 18, 2024 via email

@apartmedia
Copy link

What displays the Shelly web gui? Does it respond to the physical switch change (when the home app doesn‘t)?
It‘s important that the Shelly’s software switch type is configured accordingly with the real used physical switch type.
Is the latest Shelly firmware installed on the device? Which version? It could also be a firmware issue especially it the web gui of the device has the same problem. There should be no need for an additional update service as this is already part of the web socket communication. There must be some other issue (firmware, network, configuration, software, installation, plugin).

@ohad-e
Copy link
Author

ohad-e commented Sep 19, 2024

The shelly GUI presents the correct state of the lamp (on when on or off when off).
Here is a print screen of the shelly settings:
image
When the app doesn't work, I can control the shelly from the GUI. If it doesn't work from the HOME app, when I change the state through the GUI, I can control the shelly again from the HOME app.
all the devices updated to the last version (automatic update)
shelly plus 2pm: 20240819-074337/1.4.2-gc2639da
plugin: 1.5.2

I will try to diagnose Shelly's log to understand how the command got in the device. I will update you later.

thanks!

@ohad-e
Copy link
Author

ohad-e commented Sep 19, 2024

So, it is more interesting:
This is the log file from the shelly:
image

  1. try to control the device from the HOME app - there is no answer from the shelly (I think because the state of the switch isn't correct)
  2. I controlled the switch from Shelly GUI - it works well, and the state changed!
  3. I succeeded in controlling the switch from the HOME app!

So, in my opinion, the problem is with the plugin—it does not update the state of the switch in the app well.

@ohad-e
Copy link
Author

ohad-e commented Sep 22, 2024

@cubi1337, can you take a look, please?

@MaDDeePee
Copy link

+1 need a fix :(

@cubi1337
Copy link

You seem to be the only one with the problem. So it probably depends on your Shelly system landscape.
i log all actions in the Log. Please Check …..

@ohad-e
Copy link
Author

ohad-e commented Sep 29, 2024

@cubi1337, please look @MaDDeePee wrote that this happened to him too.
Is this a result of the authentication?
As you asked, I checked the log, and it looks good! Look the same as control that successes.
Would it be feasible to implement a service that automatically updates the plug's state whenever the user interacts with it, such as when the plugin is launched?
Many thanks!

@MaDDeePee
Copy link

MaDDeePee commented Sep 29, 2024

Well, for me its no issue as long as i don't press physical buttons. Opening with "software" is ok. As soon as i press up or down at the wall status stops working until reboot, its "spinning" at "closing" all the time :(

Edit: No, i don't use Auth connecting to my shells. Tested several stuff (static IP, energy saving mode off...), don't get it working. I need to replace 7 more 2.5 they stop working after 2 years one by one :(

@ohad-e
Copy link
Author

ohad-e commented Sep 29, 2024 via email

@MaDDeePee
Copy link

MaDDeePee commented Sep 29, 2024

after using physical switch % - status doesn't update in home app anymore. Its always "closing...".
Shelly app is working, though.
Within apple home app its just the state that doesnt work, i can still open and close.

Also, i notice A LOT " Device disconnected (code: 1006)" and Reconnected in homekit console of THAT shelly, no idea if its related to this.

@MaDDeePee
Copy link

Ok,

i tried both DS9 and PP fork, same result. Pressing Wallswitch doesn't update cover position and stucks in endless loop "closing" (need to restart Homebridge to make it show up right again). @alexryd @cubi1337 could you look into the code? something is bugged with shelly 2pm cover positioning feedback while triggering physical wallswitches.
Help much appreciated <3

@apartmedia
Copy link

So here are at two totally different devices involved although the title states it‘s all about the plug. @MaDDeePee talks about the Plus 2PM. That could be a bit confusing for others joining this discussion…
Might be a good idea to update the title…

@apartmedia
Copy link

Here is a print screen of the shelly settings: image

What type of physical switch are you using? Is it a flip switch or momentary button?
From what you described so far it looks like you are using a regular flip switch.
Does it change anything updating your Shelly configuration to Toggle instead of Edge?

@ohad-e
Copy link
Author

ohad-e commented Sep 29, 2024

I have the same issue with the cover's position, but it isn't essential because it works from the HOME app even when the position isn't correct.
There is an issue with the callback from the Shelly devices. For some unknown reason, they didn't report the positions of the switches or covers. The solution is maybe to be more active and collect this manually every few minutes (or fix the bug).

@cubi1337
Copy link

The potential code location is not my code.

For me, my plugin is all about keeping the whole thing alive. Alex doesn't seem to be doing anything about this anymore. If anyone provides a fix I will include it.

@MaxiHuHe04
Copy link

Could you check whether there are any "Switch Status(...): on/off" messages in your Homebridge log?

@ohad-e
Copy link
Author

ohad-e commented Oct 9, 2024

yes,
it looks to work correctly. As I mentioned, the plugin sent the command, but nothing happened because the switch's state didn't update.
Is it hard to create a virtual switch that updates the switch states instead of restarting the bridge anytime?

@ohad-e
Copy link
Author

ohad-e commented Oct 21, 2024

Moreover, after 5 days without any activity, none of the plugs worked through the HOME app. Could it be a cash problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants