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

Failsafe mode in response to MQTT disconnect or last will topic event #869

Closed
Audiobuzz opened this issue May 18, 2018 · 5 comments
Closed
Labels

Comments

@Audiobuzz
Copy link

I've been looking through the web interface and the documentation and I'm yet to see this as an option.

I use sonoff devices to control a number of items in the house but there are still failure cases that might leave the devices either running for too long, or not running at all. In particular I use Home Assistant to turn on things like sprinker circuits, or pool pumps, or to turn off fridges overnight (non-critical ones).

What would be great would be to be able to define a failsafe state (much like the power on state) that is triggered based on either disconnection from wifi, disconnection from the MQTT broker, or in response to an MQTT last will and testiment (LWT) topic being published. Home assistant allows the definition of a LWT but this seems to be a single global LWT that occurs when it dies or disconnects. Being able to configure ESPURNA to subscribe to a particular topic and revert to failsafe mode (configurable either on or off per relay) would be a great step towards being more robust as a complete system.

If this work isn't planned or hasn't been done yet then I'll look at doing the development work and creating a pull request but I don't want to double up on someone elses effort.

Thanks

Jarrad

@Audiobuzz Audiobuzz changed the title Failsafe mode in response to MQTT dissconnect or last will topic event Failsafe mode in response to MQTT disconnect or last will topic event May 18, 2018
@xoseperez
Copy link
Owner

A similar feature is already available (see PR #653) but it has been currently reported as not working (#845). Would that be the solution?

@xoseperez xoseperez added duplicate This issue or pull request already exists question mqtt relay waiting for feedback labels May 19, 2018
@Audiobuzz
Copy link
Author

Thanks @xoseperez. That fixes half the problem, but doesn't help when the controlling applications (in my case home assistant) crashes/locks/disconnects from the mqtt broker. Thats what mqtt has LWT for but espurna has no way to define which topic to listen for and respond to.

@xoseperez
Copy link
Owner

Currently there is no way to subscribe to specific topics... so you will basically need a "translator" that listens to your HA LWT and translate forward it to your device(s) to turn them ON/OFF or whatever you want. In my case I would do it from outside (Node-RED for instance).

@stale
Copy link

stale bot commented Aug 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 13, 2018
@stale
Copy link

stale bot commented Aug 20, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

@stale stale bot closed this as completed Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants