#I understand. Someone told me that
1 messages · Page 1 of 1 (latest)
I've successfully created an MQTT object in HA. Publishing state over MQTT works fine, so things like Sensors update in HA and trigger automations. I want to work with stateless objects now, Buttons and Events. I can get Buttons to trigger an MQTT message back to my app, so that's working. I can't seem to get an Event to fire in HA based on an MQTT message, though. What topic and content would I send over MQTT to get HA to trigger the Event?
I'm creating the Entity with the following MQTT post:
{
"event_types": [
"press"
],
"unit_of_measurement": "None",
"availability": {
"payload_available": "online",
"payload_not_available": "offline",
"topic": "hacommsclient/bridge/state",
"value_template": "{{ value_json.state }}"
},
"device": {
"identifiers": [
"hacomms"
],
"manufacturer": "",
"model": "",
"name": "HAcomms"
},
"json_attributes_template": "{{ value_json.data | tojson }}",
"json_attributes_topic": "hacommsclient/hacomms/test_event",
"name": "Test Event",
"object_id": "hacomms_test_event",
"state_topic": "hacommsclient/hacomms/test_event",
"unique_id": "hacomms_test_event",
"value_template": "{{ value_json.state }}"
}
And that works well. It shows up. I just don't know how to fire the event via MQTT and receive it in HA.
You are still talking about your chosen solution rather than your end goal. https://xyproblem.info/