hello !
first post ,im new in the esp32 and i need some help.
i have a relay that is activating a water pump and i can control it through HA as a switch and not momentary button . i want to add and a physical button and when it pressed will activate the pump for 30 sec. and if for some reasson need it to stop before the time ends, press again to stop it.
i have search but with no luck
this is what i have for now
esphome:
name: pump
platform: ESP8266
board: nodemcuv2
switch:
- platform: gpio
name: "pump"
pin: D1
id: pump
inverted: yes
binary_sensor:
- platform: gpio
pin: D7
name: "pumpbutton"
id: button1
on_press:
then:
- switch.turn_on: pump
- delay: 30s
- switch.turn_off: pump
on_double_click: #(I prefer to turnit off with a single click but i havent use labda to make the state)
then:
- switch.turn_off: pump
The button is connected at +5v and D7,should i add mode: INPUT_PULLUP ?
(Sorry for my english!)
Any help?