Hi,
Soon i’m planning to build a garden irrigation system with ESPHome, and therefor will trigger a few relays which in turn will control solenoid valves to enable/disable my garden sprinklers.
For this, i’d like the relay to be ‘on’ for a certain amount of time and then be switched off.
Offcourse, this would be very easy to do in HomeAssistant by first sending the ‘on’ signal, then wait for the desired amount of time, and the send the ‘off’ signal.
But, the risk I see is with any possible hickup in the ESP’s wifi-signal/connection, or HomeAssistant crashing, etc.
Therefor, what I’d rather do is sending the 'on’signal together with a parameter/variable (the desired on-time), and then have the ESP switch off the relay after this amount of time itself, fully locally on the ESP, so independent off any connection or second command to turn it off again.
That would be interesting but not sure this is possible. Maybe someone can help you on exactly what you are trying to do.
But if they don’t then;
A work around could be, to put in a condition… “if HA or Wi-Fi not connected then turn off” you probably would like your Wi-Fi to be stable or have a good/strong connection to use this.