I’m new to Home Assistant and I really like it (has started with openhab2, but the UI does not feels so good like the one of home assistant)
Actually I have installed at my NAS via Docker Container home assistant and mosquitto as mqtt broker (separate containers). With the MQTT intregration I successfully connected to the broker. With home assistant (web or app) I can actually manually control my shelly’s 2.5 for my shutters or my philips hue lights.
I have seen, that home assistant also provides options for more complex automatisation or the integration of Node-Red, but I want to use for my process / rule automatisation BPMN 2.0 / DMN via camunda (For someone it is a bit oversized, but it is for me a nice project). The aim is to publish mqtt comands from my camunda process app to home assistant to turn some lights on or off or to raise the shutters or so.
So my question is: Is it possible to control home assistant entities via mqtt commands / get status infos via subscribe of home assistant entities? How do I identify the correct topics for each entity and the correct payload, I have to send?
You can use this integration to automatically publish the state of selected (or all) entities to MQTT topics:
That’s good for your external system to receive the status of any entity. However, it doesn’t allow you to control the entities. I am unaware of an integration that allows a Home Assistant entity to be controlled via MQTT topics.
The cleanest solution is to define MQTT-based entities like MQTT Light, MQTT Switch, etc and then they can be controlled directly via MQTT topics.
Hello @123,
thank you for your Response. I will have a detailed look for it later…
Statestream sounds good. One question to MQTT things:
If I have understood it correctly, I can control with them real devices, that itself speak MQTT. For my Shelly’s I can configure to communicate via MQTT. So at the end the external Service in my usecase will directly send the cmd to the device and Homeassistant will recognize the state Change?
Do I also have the option to trigger from outside a MQTT Switch via configured topic, so somerhing else can control an entity like my homematic shutter devices (I don’t think that devices provides MQTT communication and perhaps I have in future devices that does not provide MQTT, but are supported by Home assistant)?
The topic names are set to whatever is used by the physical switch. The resulting entity is called switch.kitchen.
If you turn on switch.kitchen, using either the UI or a service call (switch.turn_on), it will publish ON to the command_topic. It will expect a reply (ON), from the physical switch, via the state_topic (to confirm it was truly turned on).
If you turn on the physical switch, either manually or by publishing ON to the command_topic, as long as the physical switch publishes ON to the state_topic, Home Assistant’s switch.kitchen will also indicate it is on.
NOTE:
The payloads for command_topic and state_topic are not obliged to be ON and OFF. You can configure MQTT Switch to use whatever payload is published by the physical switch.
“MQTT Statestream” is a great option to receive all different Infos. To control entities I prefer using the rest api REST API. I think I will produce a generic interface at my side, so I can control with specific params per usecase my entities using the rest api.