i use one of my sonoff basics to turn on/off a water pump. it has a little swimmer switch that turn GPIO14 on when the water reaches a certain level. then the pump needs only seconds to pump off the water and turn off. there are a lot of waves as some water runs back through the pump off pipe and the switch turns on again, and off and on and … you get it.
i would need some kind of delay, before the switching can happen again. unfortunately all the “logic” happens inside the sonoff. is there a better way to configure it?
The sonoff ignores the switch and sends only a mqtt payload to the switch topic.
Then you can make an automation in HA with the mqtt and state trigger for x seconds to switch the relay.
this does NOT work. nothing happens. triggering the automation in HA directly makes the pump start/stop (well, that’s the easy part even for me).
wha is also missing is an idea on how to add some timer or delay. i want the pump to be activated for at least a minute as soon as it receives an ON-trigger signal. then check for it after 60s and sees if it’s still on, etc …
thanks rainer. that works better than anything i was able to do yet
still it does NOT stay on, or extend the relais time. it seems it only reacts on state change.
this leads to the following situation: schachtrelais is ON, schachtpumpe turns ON for a minute, then turns off, and STAYS off. is this the expected behaviour?
no no. it works fine so far. normally acitvating the pump for 1min is long enough to empty the well. i could set that to 2min to be super sure.
BUT in case the sensor state switch to ON is missed, OR there is more water to be pumped away, it will never turn on again, as the well will fill more and more.
i guess i’ll just raise the timer.