Skip to content

[shelly] Re-arm status updates after WebSocket reconnect - #21393

Merged
lsiepel merged 1 commit into
openhab:mainfrom
markus7017:shelly_fixwsreconnect
Aug 14, 2026
Merged

[shelly] Re-arm status updates after WebSocket reconnect#21393
lsiepel merged 1 commit into
openhab:mainfrom
markus7017:shelly_fixwsreconnect

Conversation

@markus7017

Copy link
Copy Markdown
Contributor

Purpose

Fix a bug where a Gen2+ device stops sending status updates after its WebSocket connection drops and reconnects.

Fix

  • Fix: Gen2+ devices (Plus/Pro series) stopped reporting status updates (power, energy, switch state, etc.) after a network hiccup caused the WebSocket connection to reconnect. Only a binding restart or thing re-init would restore updates. The binding now re-arms the periodic status push and triggers an immediate refresh right after a reconnect, so status updates resume automatically.

An always-on Gen2+ device's periodic NotifyStatus push is only requested
once, during the very first connect. A reconnect gets a new WebSocket
session, so the device silently stops pushing status updates until this
is re-requested.

Signed-off-by: Markus Michels <markus7017@gmail.com>
@markus7017 markus7017 added bug An unexpected problem or unintended behavior of an add-on work in progress A PR that is not yet ready to be merged labels Aug 14, 2026
@markus7017 markus7017 self-assigned this Aug 14, 2026
@markus7017 markus7017 removed the work in progress A PR that is not yet ready to be merged label Aug 14, 2026
@markus7017

Copy link
Copy Markdown
Contributor Author

@lsiepel This is a carve-out of the BLU PR. It fixed @scheuerer re-connect problems with WS90, but in fact this fix is independent form BLU support and should also be back-ported

@markus7017
markus7017 requested a review from lsiepel August 14, 2026 22:08
@lsiepel

lsiepel commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Because the code in main has been under heavy development, chery-picking has become nearly impossible. I can merge this in main, but backporting is risky.

@lsiepel lsiepel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

Edit: verified, cherry-pick is possible, but i cannot asses the impact/side effect of this patch targeting main when applied to 5.2.x

@lsiepel
lsiepel merged commit 24d5290 into openhab:main Aug 14, 2026
4 checks passed
@lsiepel lsiepel added this to the 5.3 milestone Aug 14, 2026
@markus7017
markus7017 deleted the shelly_fixwsreconnect branch August 15, 2026 07:34
@openhab-bot

Copy link
Copy Markdown
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/shelly-binding/56862/5812

cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Aug 16, 2026
An always-on Gen2+ device's periodic NotifyStatus push is only requested
once, during the very first connect. A reconnect gets a new WebSocket
session, so the device silently stops pushing status updates until this
is re-requested.

Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants