After choosing “Service” I wanted to choose “light.turn_on” but this entry is not available in the dropdown list (see screenshot). How can I get this service?
I set an ESP8266 as light with this code:
@anon43302295 From my point of view I configured an ESP as light (see code in first post). Isn’t this what you mean? @Syntox Right now I don’t have access to my HA, but can you please tell me where within the developer tools I can find the “real” domain of my entities?
Binary sensors gather information about the state of devices which have a “digital” return value (either 1 or 0). These can be switches, contacts, pins, etc.
I have an ESP8266.
First I defined it as switch and I was able to control it manually.
Then I started the next step and wanted to set it as light, so I used the code I found on GitHub (as posted above).
It seems that this setting is not working (because the service light.turn_on) is not available - I’ll check that this afternoon - thanks so far for this advice.
I’ll also try the suggestion from @aceindy to use this combination:
@Syntox: Thanks for your last post - I think you’re right, I configured that in ESPHome config - what would I need to configure in the HA config then to set my ESP entity as light?
If you look at config > integrations does your ESPHome node shows up in the ESPHome card? And is it a light if you click on the node > entities (light.lamp)?
sure this works too but it’s just an extra step you usually don’t need.
BTW this s my ESPHome config:
output:
- platform: gpio
pin: GPIO12
id: relay
light:
- platform: binary
name: light
output: relay
restore_mode: RESTORE_DEFAULT_OFF #this is just to ensure that the light is off if the ESP reboots
Good to know you got it working!
I tried it myself yesterday with a new D1 mini. First I configured a switch and that worked.
Then I deleted that switch from the esp config and added a binary light and for my surprise the esp didn’t got discovered. I had to manually add it by typing in the IP of the D1 mini. Maybe that was your problen too…