I have some hardware I want to integrate into HA using ESPHome.
It has a physical push button on it for powering it on and off. I.e. press the momentary switch once to turn it on, and once to turn it off.
I’ve hijacked the wiring and got an ESP8266 “pushing” the switch electrically, and turning it on and off fine.
I can make this work in ESPHome like this:
switch:
- platform: gpio
pin: GPIO5
id: my_sw
name: "My Device"
on_turn_on:
- delay: 100ms
- switch.turn_off: my_sw
However, this doesn’t render how Id like in HA.
This shows a toggle switch in HA, and when I click it, it turns on and then off again after 100ms. This activates the device but the switch shows as off in the UI. I can then click it again and the same UI experience happens, and my device turns off.
How do I have a momentary output on my GPIO, but a stateful toggle switch in the HA UI?
Thanks
1 post - 1 participant