I want to use the MQTT Publish service on a button and don't know how to write the payload.
First of all, the "Call service" action starts with an "Entities" parameter. Do I really need to select an entity here?
Normally, the device I want to send the MQTT message to, gets addressed by the MQTT topic string. And isn't that topic string a part of the payload of the MQTT Publish service? I'm confused.
And the MQTT message I want to send needs a payload itself, in my case it's as simple as { 'name': 'mcdog' }. But putting just this into the "Payload" field and selecting the device I want to send/publish in the "Entities" field dosen't work.
Here's the yaml code that works inside a HA automation's action part:
Here's an additional screenshot of the visual editor for the same action in HA:
Now the question is: how can I make this work in Companion? I tried to write everything from the data: part of the above yaml code as JSON and put that into the Payload field ...
I want to use the MQTT Publish service on a button and don't know how to write the payload. First of all, the "Call service" action starts with an "Entities" parameter. Do I really need to select an entity here? Normally, the device I want to send the MQTT message to, gets addressed by the MQTT topic string. And isn't that topic string a part of the payload of the MQTT Publish service? I'm confused.
And the MQTT message I want to send needs a payload itself, in my case it's as simple as
{ 'name': 'mcdog' }
. But putting just this into the "Payload" field and selecting the device I want to send/publish in the "Entities" field dosen't work.Here's the yaml code that works inside a HA automation's action part:
Here's an additional screenshot of the visual editor for the same action in HA:
Now the question is: how can I make this work in Companion? I tried to write everything from the
data:
part of the above yaml code as JSON and put that into the Payload field ...... and tried different formats, like:
and
... but to no avail.
I couldn't find any documentation on how to use the MQTT Publish service from within the homeassistant module. Hopefully someone can help? 😳