home-assistant.io/source/_docs/mqtt/service.markdown
Fabian Affolter 481320128f Re-organisation Documentation and Getting started (#2055)
* Split MQTT documentation

* Add more details

* Move content to /docs

* Enable sidebar

* Move content to /docs

* Enable sidebar

* Move content

* Update links

* Remove wizard stuff

* Enable sidebar

* Minor changes

* Move MQTT parts to /docs

* update links

* Update links and sync content

* Fix link

* Enable sidebar

* Remove navigation

* Remove navigation and other minor updates

* Update links

* Add overview page

* Make title linkable

* Update

* Plit content

* Update links

* Rearrange content

* New getting-started section

* Add icons for docs

* Update for new structure

* Update for new structure

* Add docs navigation

* Add docs overview page

* Remove ecosystem navigation

* Add docs and remove other collections

* Move ecosystem to docs

* Remove duplicate files

* Re-add ecosystem overview

* Move to ecosystem

* Fix permission

* Update navigation

* Remove collection

* Move overview to right folder

* Move mqtt to upper level

* Move notebook to ecosystem

* Remove un-used files

* Add one more rectangle for iOS

* Move two parts back from docs and rename Run step

* Remove colon

* update getting-started section

* Add redirect

* Update

* Update navigation
2017-02-23 11:09:41 +01:00

830 B

layout, title, description, date, sidebar, comments, sharing, footer, logo, redirect_from
layout title description date sidebar comments sharing footer logo redirect_from
page MQTT Publish service Instructions how to setup the MQTT Publish service within Home Assistant. 2015-08-07 18:00 true false true true mqtt.png /components/mqtt/#publish-service

The MQTT component will register the service publish which allows publishing messages to MQTT topics. There are two ways of specifying your payload. You can either use payload to hard-code a payload or use payload_template to specify a template that will be rendered to generate the payload.

{
  "topic": "home-assistant/light/1/command",
  "payload": "on"
}
{
  "topic": "home-assistant/light/1/state",
  "payload_template": "{% raw %}{{ states('device_tracker.paulus') }}{% endraw %}"
}