home-assistant.io/source/_components/notify.mqtt.markdown
Alok Saboo 1aca7b08cf Misc fixes: e.g. -> e.g., and proper case for Home Assistant (#4942)
* e.g. to e.g., and proper case for Home Assistant

* Instructions how to -> Instructions on how to
2018-03-17 20:20:37 +01:00

1.3 KiB

layout title description date sidebar comments sharing footer logo ha_category ha_iot_class
page MQTT Notifications Instructions on how to add MQTT notifications to Home Assistant. 2016-02-01 08:00 true false true true mqtt.png Notifications depends

The MQTT notification support is different than the other notification platforms. It is a service. This means that you don't have to create a configuration entry but you need to provide more details when calling the service.

Call Service section from the Developer Tools allows you to send MQTT messages. Choose mqtt/publish from the list of Available services: and enter something like the sample below into the Service Data field and hit CALL SERVICE.

{"payload": "Test message from HA", "topic": "home/notification", "qos": 0, "retain": 0}

Using the REST API to send a message to a given topic.

$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \
       -H "Content-Type: application/json" \
       -d '{"payload": "Test message from HA", "topic": "home/notification"}' \
       http://IP_ADDRESS:8123/api/services/mqtt/publish