Hi all,
I have a garden cooling mist sprayer that needs to be pulsed at intervals. Ideally, i’d like it to present as a switch. When the switch is on, the output is pulsed for 500ms every 20 seconds. When the switch is off - nothing, obviously.
I’d prefer that the actual output is not exposed to to homeassistant, to reduce the risk that the output gets turned on and left like that.
I have the following code, which works, but all the time. I can’t enable and disable the interval timer.
any ideas?
esphome:
name: mister_minimal
platform: ESP8266
board: esp8285
wifi:
ssid: 'SSID'
password: 'why you wanna know'
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
output:
- platform: gpio
pin: GPIO16
id: mister_relay
switch:
- platform: template
name: "Mister"
id: mister_pulse
turn_on_action:
- output.turn_on: mister_relay
- delay: 500ms
- output.turn_off: mister_relay
interval:
- interval: 20sec
then:
- switch.turn_on: mister_pulse