schema: template
name: Luce Camera
state_topic: "shellies/shellydimmer-D46CF2/light/0/status"
- state_template: >
+ state_template: >
{% if value_json.ison %}
on
{% else %}
command_topic: "shellies/shellydimmer-D46CF2/light/0/set"
command_on_template: >
{"turn": "on"
- {% if brightness is defined %}
+ {% if brightness is defined %}
, "brightness": {{ brightness | float | multiply(0.3922) | round(0) }}
{% endif %}
- }
+ }
command_off_template: '{ "turn" : "off" }'
- brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
+ brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
retain: false
qos: 0
optimistic: false
schema: template
name: Luce Sala
state_topic: "shellies/shellydimmer-D3EA58/light/0/status"
- state_template: >
+ state_template: >
{% if value_json.ison %}
on
{% else %}
command_topic: "shellies/shellydimmer-D3EA58/light/0/set"
command_on_template: >
{"turn": "on"
- {% if brightness is defined %}
+ {% if brightness is defined %}
, "brightness": {{ brightness | float | multiply(0.3922) | round(0) }}
{% endif %}
- }
+ }
command_off_template: '{ "turn" : "off" }'
- brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
+ brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
retain: false
qos: 0
optimistic: false
{
"turn": "off",
"mode": "color"
- }
+ }
state_template: >
{% if value_json.ison == true and value_json.mode == "color" %}
on
red_template: '{{ value_json.red }}'
green_template: '{{ value_json.green }}'
blue_template: '{{ value_json.blue }}'
- white_value_template: '{{ value_json.white }}'
+ white_value_template: '{{ value_json.white }}'
effect_template: >
{%- if value_json.effect == 1 -%}
Pioggia di Meteore
# "turn": "off",
# "mode": "white",
# "effect": 0
-# }
+# }
# state_template: >
# {% if value_json.ison == true and value_json.mode == "white" %}
# on