OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

Feature Request: Publish state when homeassistant/status = online

Open maxihatop opened this issue 4 months ago • 4 comments

Problem: After Home Assistant restarts, the state of OpenBK devices is often shown as unknown, and device diagnostics are unavailable. Currently, the only ways to restore state are:

enable periodic status broadcast (adds MQTT traffic and unnecessary flash wear) [Flag 2 ON],

manually reboot the OpenBK device,

toggle the device so it publishes something.

All three options are inconvenient.

Proposed Solution: When the device receives the standard HA message

homeassistant/status online

it should immediately publish its full state (the same data normally published on broadcast interval).

Benefits:

Ensures HA quickly restores correct device state after restart.

Eliminates the need for periodic broadcasts (or allows them to be set to a much longer interval, e.g. 10 minutes).

Reduces MQTT traffic and flash wear.

Improves user experience: no manual toggling or rebooting required.

Summary: → Problem: after HA restart, OpenBK devices appear as unknown until they publish again. → Solution: publish full state once when HA announces itself online. → Result: correct state recovery, less traffic, more reliability.

maxihatop avatar Sep 01 '25 21:09 maxihatop

Hm ok, can you check if it works ok? https://github.com/openshwprojects/OpenBK7231T_App/pull/1791 PS: where do you get flash wear?

openshwprojects avatar Sep 06 '25 17:09 openshwprojects

merged

openshwprojects avatar Sep 07 '25 08:09 openshwprojects

PS: where do you get flash wear?

Sorry, there was my mistake, related to another possible issue. Irrelevant to this topic.

maxihatop avatar Sep 07 '25 14:09 maxihatop

Ok I think it's safe to assume it's solved?

openshwprojects avatar Sep 15 '25 19:09 openshwprojects