Today I migratted my first switch from Tasmota to ESPHome. But I can’t find how to control my status_led.
The status_led works, if there is no connection with HA it blinks, when there is connection it’s off.
But when there is connection I want to have the status led enabled when at least one of the output relay’s is on, and have it reverse blink for a short while when one of the buttons is pressed.
Specific boards use different GPIO for functions (other than ESPxx programming mode) so to give advice, we need to know exactly which platform you are using (e.g. Wemos D1 clone, Sonoff Basic v2, etc).
But I think It’s GPIO13, as the status led is working.
In this case it’s about a Sonoff T0 no neutral switch
sorry, for the dutch link,
but it’s exactly wired the same as the default t0, t1, t2 and t3
And those templates are ok:
In tasmota I just assing GPIO13 and all works as I whish.
But ESPHome by default sees this as a status switch of the device and totally ignores the relay statuses.
At least, with my template.
So I’m looking for a way to look at the relay statuses too.
You can control this led as other outputs. Forget “status_led” function. Define your led as output. So you can define when to light and flash. I use this code for my led: lights if not connected, steady flashing when connected to wifi and short flash when connected to HA. You can easily adopt it to your needs.(note that switch.${device_name}_wifi_api_connected is my led)
which is fine with 1 button, I need to add some if conditions when I go for the multi button switches.
I will take a look at your script then.
for as far as I understand using platform status_led, the error has automatically presence over the actual status, something which is great in my case.