metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

Suggestion: When bad/no response received from sensor then plugin should be unavailable #20

Closed peros550 closed 2 years ago

peros550 commented 4 years ago

Sometimes a sensor may not be reachable.

In this case, the plugin tries to get latest temp information from the sensor but it can't.

During this time, in home app the plugin continuously reports the latest value like everything works ok. If the sensor continues to be unavailable, there will be no way for the user to informed of the problem.

I suggest, the way plugin works changes, in a way that if no valid temperature is received for more than i.e. 15mins the plugin goes in "no response" or "unavailable" state in home app.

In this way the user will know s/he needs to do something...

metbosch commented 4 years ago

@peros550 Any suggestion or place to see how to get into this "unavailable" state?

peros550 commented 4 years ago

Hey, I wish I could help more with a good code pattern. All I can do is point to a similar plugin/case.

In the following commit, the developer of Homebridge-Ediplug resolved an issue by which the whole homebridge was stuck when there was no IP connectivity with the actual accessory. In his solution, the accessory now is shown an "no response" in home app. I know "unavailable" state would fit much better, but I don't know how you could do it.

https://github.com/Eisenvater88/homebridge-ediplug/commit/f25f8d56aea583d373e8dbc95beadfc8e5c2ae30

Many thanks for your attention.