mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Fix MQTT trigger value_template example (#16755)
This commit is contained in:
parent
5e59569350
commit
39d3a758ae
@ -100,6 +100,8 @@ automation:
|
|||||||
The `payload` option can be combined with a `value_template` to process the message received on the given MQTT topic before matching it with the payload.
|
The `payload` option can be combined with a `value_template` to process the message received on the given MQTT topic before matching it with the payload.
|
||||||
The trigger in the example below will trigger only when the message received on `living_room/switch/ac` is valid JSON, with a key `state` which has the value `"on"`.
|
The trigger in the example below will trigger only when the message received on `living_room/switch/ac` is valid JSON, with a key `state` which has the value `"on"`.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
trigger:
|
||||||
@ -109,6 +111,8 @@ automation:
|
|||||||
value_template: "{{ value_json.state }}"
|
value_template: "{{ value_json.state }}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
It's also possible to use [limited templates](/docs/configuration/templating/#limited-templates) in the `topic` and `payload` options.
|
It's also possible to use [limited templates](/docs/configuration/templating/#limited-templates) in the `topic` and `payload` options.
|
||||||
|
|
||||||
<div class='note'>
|
<div class='note'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user