Struggling to send commands to ESPHome devices - could anyone please post an example flow?
Closed this issue · 3 comments
First, let me say how happy I am to see this project. All of my home automation is in Node-RED; I only use Home Assistant as an ersatz state machine. If this works, I can eliminate an entire VM.
Anyway, I installed it, and I can see devices, and see the exposed controls, which is exciting!
However, I am struggling to actually send commands. I know that the documentation seems to list what's required, but I'm not succeeding. If I get this working, I'm happy to write up a tutorial with steps for noob users that want to do this.
SO: here's my difficulty. There's an ESPHome device in this room that controls the light above me. I want to be able to turn it on and off - basic, right?
So I added an ESPHome Out node, correctly configured. The right device comes back, I can see the entities inside it.
So now I need to inject a command to make it work.
What I need is to understand how that instruction needs to be formatted, and where it should go: msg.payload?
Boolean True and False don't seem to work.
String ON and OFF don't seem to work.
If I could see one working example, I could figure it out from there, probably.
Halp? Thanks.
EDIT: I figured it out. I'm typing this here in case anyone else finds this via search. I am old, and not particularly clever.
Right, to inject a command into an ESPHome-OUT node, do this:
- Set JSON as the payload
- Check in the documentation what the thing is expecting; in my case, a light, it wants "true" or "false".
- Righto, then the msg is formatted thusly:
{"state": true}
Tadaaaaa suddenly you don't need Home Assistant anymore.
Hi @twocolors, I am willing to help write docs, only I don't know very much. I am still learning as I go, but I am very much enjoying your work.
However, I do write good English. Maybe if you have some basic notes, I can fill it out with more details?