alexryd / homebridge-shelly-ng

Homebridge plugin for the next generation of Shelly devices
GNU General Public License v3.0
121 stars 44 forks source link

state of the plug issue #134

Open ohad-e opened 1 day ago

ohad-e commented 1 day ago

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 commented 1 day ago

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

ohad-e commented 1 day ago

Yes, They are protected by a password. The types are Shelly plus 1 and Shelly plus 2pm.

On Wed, 18 Sep 2024 at 12:52 apartmedia @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/alexryd/homebridge-shelly-ng/issues/134#issuecomment-2358014548, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLMBUVLW7CNRDX5ZJ52EM2TZXFEONAVCNFSM6AAAAABOM6KRP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJYGAYTINJUHA . You are receiving this because you authored the thread.Message ID: @.***>

apartmedia commented 1 day ago

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 commented 21 hours ago

Thank you!

I am already on this plugin: https://github.com/cubi1337/homebridge-shelly-ds9 The issue that I mentioned is relevant to this plugin.

On Wed, 18 Sep 2024 at 13:54 apart media @.***> wrote:

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 https://github.com/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 https://github.com/cubi1337/homebridge-shelly-ds9 from cubi1337 https://github.com/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.

— Reply to this email directly, view it on GitHub https://github.com/alexryd/homebridge-shelly-ng/issues/134#issuecomment-2358149927, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLMBUVONNHKI5LCF4WDKN5LZXFLVBAVCNFSM6AAAAABOM6KRP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJYGE2DSOJSG4 . You are receiving this because you authored the thread.Message ID: @.***>

apartmedia commented 17 hours ago

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 commented 17 hours ago

I could not control the devices with a password when I installed the original plugin. Now, the problem I mentioned before is with the switch control.

Do you use this device with a password, and does it work well?

On Wed, 18 Sep 2024 at 21:20 apartmedia @.***> wrote:

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 https://github.com/cubi1337/homebridge-shelly-ds9/releases/tag/v1.1.2 should have fixed this re-auth issue related to password protected devices.

— Reply to this email directly, view it on GitHub https://github.com/alexryd/homebridge-shelly-ng/issues/134#issuecomment-2359129526, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLMBUVKRXINCJJ7NNHFBZNLZXG76VAVCNFSM6AAAAABOM6KRP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZGEZDSNJSGY . You are receiving this because you authored the thread.Message ID: @.***>

apartmedia commented 17 hours ago

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 commented 16 hours ago

So, in my case, also, the Shelly devices that control only from the app without a physical switch work perfectly.

The issue is just with the devices, which are sometimes controlled by the physical switch and sometimes from the app.

I tried many things:

  1. Change the switch type in Shelly (all the types and settings).
  2. Static IP
  3. Disable mesh technology.
  4. Disable mdns.
  5. Change the parameters related to the bridge's communication time.

The issue didn't occur all the time. For example, after I restarted the bridge, everything worked fine. It happened after a few hours.

I suggest that someone add a service that updates the state of the physical switch occasionally because, after a restart, all works well!

Many thanks!

On Wed, 18 Sep 2024 at 22:00 apartmedia @.***> wrote:

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 flip switch or momentary button? Is the Shelly configured correctly for you 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?

— Reply to this email directly, view it on GitHub https://github.com/alexryd/homebridge-shelly-ng/issues/134#issuecomment-2359200113, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLMBUVN24FORCCHSSFSIUNTZXHEWPAVCNFSM6AAAAABOM6KRP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZGIYDAMJRGM . You are receiving this because you authored the thread.Message ID: @.***>

apartmedia commented 15 hours ago

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 commented 4 hours ago

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!