[neohub] Workaround for 'Legacy API Disabled' problem #12906
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
From early 2022 Heatmiser introduced NeoHub firmware that has the ability to enable / disable the NeoHub
portNumber
4242. If this port is disabled the OpenHAB binding cannot connect and the binding will report a "Connection Refused" warning in the log. In prior firmware versions the port was always enabled. But in the new firmware the port is initially enabled on power up but if no communication occurs for 48 hours it is automatically disabled. Alternatively the Heatmiser mobile App has a setting (Settings | System | API Access | Legacy API Enable | On) whereby the port can be permanently enabled.Solution
In this PR when the handler
initialize()
method is called, we try to 'ping' the NeoHub. And if the ping fails with "Connection Refused" it sets the Bridge status as offline / configuration error, with a message to consult the readme, and also writes a warning message in the log to say the same. And a chapter has been added to the readme to explain how to resolve the issue.Signed-off-by: Andrew Fiddian-Green software@whitebear.ch