I have an 8266 which I am using with ESPHome. On my lovelace dashboard I have a grid with a switch on it which toggles the state of D1 on the 8266. So far so good.
What I additionally want to do is have a button on the grid which is the equivalent of a push to make. When I click the button and hold it in it raises the output voltage on D2. The moment I ket g of the button the D2 voltage drops to 0. This is for safety as this is controlling a linear actuator which raises my train board into an upright position.
Here is the code “wot I wrote” for the directional switch but this is latching.
Thanks in advance.
switch:
- platform: gpio
name: “Direction”
pin: D1
restore_mode: ALWAYS_OFF
on_turn_on:- logger.log: “Actuator up!”
on_turn_off: - logger.log: “Actuator down!”
- logger.log: “Actuator up!”