Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Availability Topic #446

Closed
krkeegan opened this issue Sep 24, 2021 · 2 comments
Closed

Add Availability Topic #446

krkeegan opened this issue Sep 24, 2021 · 2 comments

Comments

@krkeegan
Copy link
Collaborator

Describe the solution you'd like
HomeAssistant MQTT entities have an option to specify an availability_topic which by default expects the payload online or offline. In essence, when this payload is offline the entity will be listed as 'unavailable' in its state and will be greyed out in the front end.

I believe that most integrations use code to:

  1. publish online on connection to the mqtt broker,
  2. publish offline on a clean disconnect from the mqtt broker,
  3. and use a last_will to cause offline to be published if the connection fails.

This seems like a mildly useful feature. InsteonMQTT doesn't crash at this point (at least for me). But if a user has InsteonMQTT running on a seperate machine from the broker, then it is possible that network errors could cause issues. Or power issues could happen as well.

The nice thing is that this would give an indication in the front end of an issue and would accurately reflect that any changes would not be acted on.

You could also create a simple binary_sensor that tracked or had some automation triggered by the availability of InsteonMQTT.

The coding seems simple enough, I don't see a reason not to do this.

@tstabrawa
Copy link
Contributor

For people using hubs, this could possibly be further enhanced to update the availability based on connectivity to the hub -- or generalized to change availability whenever there are connectivity problems detected with the modem (e.g. someone unplugs a USB PLM and the serial device disappears).

@krkeegan
Copy link
Collaborator Author

krkeegan commented Oct 7, 2021

It is an interesting idea. It could be carried through to PLMs too, such as if the usb cable is unplugged.

I don't think this would be super easy to implement though. My guess, is that you would want to create an available object that components could register with. Each component could then send available or unavailable signals. The available object would then send the appropriate mqtt messages based on the global state of the components.

This isn't super high on my list of things to do.

@krkeegan krkeegan closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants