I am struggling. I believe I have not understood the basic concept of using ESPHome. I am trying to toggle a light (an Ikea traadfri, which is available in HA) by pushing a button connected to a nodemcu. But I really have no idea what I am doing, seem unable to get my head around it.
The light is called sengelys.
I would have thought it would be something like this:
And after the ‘then:’ I would have thought I could have something like light.toggle: sengelys, or light.toggle: light.sengelys. But no matter what I get errors when editing the file.
The above, with nothing after the then gives me this when I press the button:
[01:15:19][D][binary_sensor:036]: ‘sengelystoggle’: Sending state ON
[01:15:19][D][binary_sensor:036]: ‘sengelystoggle’: Sending state OFF
So it seems it is switching it on and then off immediately.
I have tried inserting some delays, have tried on_click, on_release, on_state, etc. It must be something very simple, but I can not get my head around it.
Ah, also a good one. While searching I had seen the homeasstistant.service call and tried it, briefly, did bit search enough to figure out the api: requirement. Thanks, might try it next time, perhaps a tiny bit faster.