Sonoff not switching relay off

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jme
Normal user
Posts: 43
Joined: 11 Apr 2018, 14:20

Sonoff not switching relay off

#1 Post by jme » 11 Jun 2021, 11:26

Hi,

I'm using a sonoff 4 with espeasy to control my watering systeM

Domoticz send the request to espeasy to switch the water on and off.
I already discover some days that the watering was not switched off, i assume there where a wifi issue when domoticz sended the request to switch off.

I think i can make a rule in espeasy to switch off the watering after a few minutes for security reason.
What's the best way to do it ?

Thx

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff not switching relay off

#2 Post by TD-er » 11 Jun 2021, 12:05

You can start a timer when you switch on the relay.
I assume you followed this description to setup a relay with Domoticz (and MQTT) https://espeasy.readthedocs.io/en/lates ... #p029-page

If not, you can still 'monitor' the GPIO pin of the relay and act on its changes.
But that may lead to some 'flip-flop' behavior if you're not paying attention.

To summarize:
- Act on change of relay state by setting a timer.
- If timer expires, turn off the relay, but keep in mind where you turn it off.

For example in the link I gave above, you should act as if a push button is pressed. Thus generate the same event as if you pressed a push button.
Otherwise you may end up in a lot of turning off/on switches if the ESP is connected to the network.

Another approach can be to not let Domoticz send the on and off signal, but only send an event to start it and let the ESP be responsible for turning it off.
This event can still be like the switch you now use. But this may be a bit tricky to setup correct.
I would suggest to start with the first suggestion.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 23 guests