mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
doc update for MQTT light shema template (#21062)
This commit is contained in:
parent
9761fcd89d
commit
717530f9b6
@ -19,7 +19,7 @@ The `mqtt` light platform lets you control your MQTT enabled lights through one
|
|||||||
| Color temperature | ✔ | ✔ | ✔ |
|
| Color temperature | ✔ | ✔ | ✔ |
|
||||||
| Effects | ✔ | ✔ | ✔ |
|
| Effects | ✔ | ✔ | ✔ |
|
||||||
| Flashing | ✘ | ✔ | ✔ |
|
| Flashing | ✘ | ✔ | ✔ |
|
||||||
| HS Color | ✔ | ✔ | ✘ |
|
| HS Color | ✔ | ✔ | ✔ |
|
||||||
| RGB Color | ✔ | ✔ | ✔ |
|
| RGB Color | ✔ | ✔ | ✔ |
|
||||||
| RGBW Color | ✔ | ✔ | ✘ |
|
| RGBW Color | ✔ | ✔ | ✘ |
|
||||||
| RGBWW Color | ✔ | ✔ | ✘ |
|
| RGBWW Color | ✔ | ✔ | ✘ |
|
||||||
@ -809,7 +809,7 @@ light:
|
|||||||
The `mqtt` light platform with template schema lets you control a MQTT-enabled light that receive commands on a command topic and optionally sends status update on a state topic.
|
The `mqtt` light platform with template schema lets you control a MQTT-enabled light that receive commands on a command topic and optionally sends status update on a state topic.
|
||||||
It is format-agnostic so you can use any data format you want (i.e., string, JSON), just configure it with templating.
|
It is format-agnostic so you can use any data format you want (i.e., string, JSON), just configure it with templating.
|
||||||
|
|
||||||
This schema supports on/off, brightness, RGB colors, XY colors, color temperature, transitions, short/long flashing and effects.
|
This schema supports on/off, brightness, RGB colors, XY colors, HS Color, color temperature, transitions, short/long flashing and effects.
|
||||||
|
|
||||||
## Template schema - Configuration
|
## Template schema - Configuration
|
||||||
|
|
||||||
@ -1034,7 +1034,7 @@ In this section you find some real-life examples of how to use this light.
|
|||||||
|
|
||||||
### Simple string payload
|
### Simple string payload
|
||||||
|
|
||||||
For a simple string payload with the format `state,brightness,r-g-b` (e.g., `on,255,255-255-255`), add the following to your `configuration.yaml` file:
|
For a simple string payload with the format `state,brightness,r-g-b,h-s` (e.g., `on,255,255-255-255,360-100`), add the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
@ -1045,7 +1045,7 @@ light:
|
|||||||
schema: template
|
schema: template
|
||||||
command_topic: "home/rgb1/set"
|
command_topic: "home/rgb1/set"
|
||||||
state_topic: "home/rgb1/status"
|
state_topic: "home/rgb1/status"
|
||||||
command_on_template: "on,{{ brightness|d }},{{ red|d }}-{{ green|d }}-{{ blue|d }}"
|
command_on_template: "on,{{ brightness|d }},{{ red|d }}-{{ green|d }}-{{ blue|d }},{{ hue|d }}-{{ sat|d }}"
|
||||||
command_off_template: "off"
|
command_off_template: "off"
|
||||||
state_template: "{{ value.split(',')[0] }}" # must return `on` or `off`
|
state_template: "{{ value.split(',')[0] }}" # must return `on` or `off`
|
||||||
brightness_template: "{{ value.split(',')[1] }}"
|
brightness_template: "{{ value.split(',')[1] }}"
|
||||||
@ -1080,6 +1080,9 @@ light:
|
|||||||
{%- if red is defined and green is defined and blue is defined -%}
|
{%- if red is defined and green is defined and blue is defined -%}
|
||||||
, "color": [{{ red }}, {{ green }}, {{ blue }}]
|
, "color": [{{ red }}, {{ green }}, {{ blue }}]
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- if hue is defined and sat is defined -%}
|
||||||
|
, "huesat": [{{ hue }}, {{ sat }}]
|
||||||
|
{%- endif -%}
|
||||||
{%- if effect is defined -%}
|
{%- if effect is defined -%}
|
||||||
, "effect": "{{ effect }}"
|
, "effect": "{{ effect }}"
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user