-
Notifications
You must be signed in to change notification settings - Fork 639
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
Change relay status if MQTT disconnects #602
Comments
I have never thought about it. If the MQTT disconnects it should reconnect as soon as the WiFi connection is restored or the broker available again... what kind of safety reasons are you thinking about? |
Assume that espurna is ON by the broker and after some time connection is broken. Because of wireless connection this can happen if wireless signal is weak. So we have the issue that Espurna stays ON. So if there is a setting in web server for MQTT such that if the connection is broken e.g. for 5 minutes if Espurna should switch to OFF this issue can be solved. |
@gokalpakgul did you consider unconventionally using pulse mode? For example, set it to 5 minutes, Normally OFF and just periodically send 1 to |
That the timer will reset is a good start. I was looking exactly for the same functionality. Some application require that the relay switch off as a safety feature... e.g. if the broker crashes or wifi is borked, a gardening watering pump, which is suppose to run for 30 min a day, would run endless possibly creating larger damage to garden and buildings. Thus, we need a safety feature. If there is no connection and no response from the server side for e.g. 5 min, the pump should switch off. |
@torwag For device-only option there's also scheduling function that uses network time to turn on / off relay - see Scheduler on web interface.
If network is fairly stable, short pulse time and periodic keep-alive using relay/set does the thing. You can have 90 second pulse and 60 seconds interval between sending /set - 29 times and let the pulse timer run out to turn the relay off. Edit: there's also #653 |
@torwag I have the same need as you have. It seems solved using pulse mode normaly off with a timer on 30minutes and boot mode always off On the last release (espurna-1.12.6-itead-sonoff-4ch-pro.bin) there are also a On MQTT disconnect option but this option is not kept after reboot. |
Thanks for the comments. I use the same method as @fpalinf ... pulse mode with boot mode off. I will further investigate and see if it works as I need it to work. Thanks again for this great project. |
See also #845. |
Dear All
With Espurna 1.12.3 firmware is it possible that relay switches to OFF mode if the MQTT connection is broken for the safety reason? I saw MQTT retain option but no MQTT OFF option. Is there a plan to implement such a function?
Thks for your answers in advance
Gokalp
The text was updated successfully, but these errors were encountered: