Skip to content

fix: resolve version sensor conflict between legacy and JSON-RPC MQTT topics at boot HA#12

Open
PeterLinuxOSS wants to merge 1 commit into
vermut:masterfrom
PeterLinuxOSS:master
Open

fix: resolve version sensor conflict between legacy and JSON-RPC MQTT topics at boot HA#12
PeterLinuxOSS wants to merge 1 commit into
vermut:masterfrom
PeterLinuxOSS:master

Conversation

@PeterLinuxOSS

Copy link
Copy Markdown
Contributor

This PR fixes a race condition in the version sensor at startup.

In some rare cases at boot, the sensor first picks up the old version from the legacy MQTT topic (openmower/version), and a few minutes later — once OpenMower republishes the version on the new topic (openmower/version/json) — it updates to the correct value. This PR resolves that inconsistency by handling both topics deterministically.

Trade-off: This fix effectively disables showing the correct version if you downgrade OpenMower from 1.2.0 back to 1.0.2. I think that's an acceptable cost, since downgrades are rare.

Root cause: The underlying issue is that OpenMower does not clear stale retained messages from MQTT, so the old version topic keeps an outdated retained value. It would be great to fix that on the OpenMower side as well.

Suggestion for OpenMower: Add a schema_version field to the openmower/capabilities topic, incremented whenever the MQTT schema changes. This would let integrations detect schema changes reliably instead of relying on topic-name heuristics.


Note: parts of this fix were generated with the help of Claude AI.

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

Successfully merging this pull request may close these issues.

1 participant