mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Improve explanation of state_value_template and add example (#31928)
* Improve explanation of state_value_template and add example * Fix syntax problems in documentation * tweaks, in an attempt to fix the build * Update source/_integrations/light.mqtt.markdown * Update source/_integrations/light.mqtt.markdown --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
8b67075c83
commit
8088152e50
@ -363,7 +363,7 @@ state_topic:
|
||||
required: false
|
||||
type: string
|
||||
state_value_template:
|
||||
description: "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the state value. The template should match the payload `on` and `off` values, so if your light uses `power on` to turn on, your `state_value_template` string should return `power on` when the switch is on. For example if the message is just `on`, your `state_value_template` should be `power {{ value }}`."
|
||||
description: "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the state value. The template should return the `payload_on` and `payload_off` values, so if your light uses `power on` to turn on, your `state_value_template` string should return `power on` when the switch is on. For example, if the message is just `on`, your `state_value_template` should be `power {{ value }}`. When your `payload_on = 27`, `payload_off = 'off'`, then this template might be `'off' if value_json.my_custom_brightness_field <= 0 else 27`."
|
||||
required: false
|
||||
type: template
|
||||
unique_id:
|
||||
|
Loading…
x
Reference in New Issue
Block a user