mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Add encoding parameter to mqtt automation (#8247)
* Add encoding parameter to mqtt automation #20292 This is needed to trigger on received images/other byte payloads via mqtt because otherwise the decode fails. See also #16004 * Update trigger.markdown clarify
This commit is contained in:
parent
770908731f
commit
09cc247d49
@ -46,7 +46,7 @@ automation:
|
||||
|
||||
### {% linkable_title MQTT trigger %}
|
||||
|
||||
Triggers when a specific message is received on given topic. Optionally can match on the payload being sent over the topic.
|
||||
Triggers when a specific message is received on given topic. Optionally can match on the payload being sent over the topic. The default payload encoding is 'utf-8'. For images and other byte payloads use `encoding: ''` to disable payload decoding completely.
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
@ -55,6 +55,7 @@ automation:
|
||||
topic: living_room/switch/ac
|
||||
# Optional
|
||||
payload: 'on'
|
||||
encoding: 'utf-8'
|
||||
```
|
||||
|
||||
### {% linkable_title Numeric state trigger %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user