Sonoff Basic:
I have an LED on GPIO 13 that in Tasmota indicated my “WiFi connected” status.
I would like to replicate this in ESPHome, but I don’t understand YAML well enough to fix the code error.
I would appreciate any assistance. Can someone point me to where in the documentation I might find my error?
Your if block is misplaced. It needs to have a trigger of some sort. Check the documentation for this condition:
It is inside an on_....: block. Are you trying to check everytime the wifi signal changes whether it is connected? If so you could use on_value: from this sensor. See:
Many thanks. When I first read up on the status_led component, I was thinking that I want the LED on if everything is ok. Then, a duh! moment, inverted: True. Blinking doesn’t care if the LED logic is inverted or normal. It still blinks.
While this solves my goal of an LED on if all is good…
Many thanks for the reply.
While Nick helped with my goal, I am still flummoxed by how do I do a simple if?
Code snippets in the docs are a great reference; If you know YAML and where to put the snippets. I spent hours with the snippets in the docs and could not figure out where to put this in my code. What does on_…: refer to?
on_...:
if:
condition:
wifi.connected:
then:
- logger.log: WiFi is connected!
Thanks for the tips. I am still learning…
I’ve often wondered, if the light is only on or off, what difference does it make whether I use the light or switch component?