Hello everyone,
My first post here, thanks all for the impressive amount of content.
I’m reaching out as I’ve been trying to create a light template. The idea of the template is to combine a Shelly 1 plus switch (installed behind the wall switch) and a Zigbee Ikea Tradfri led pannel into 1 single entity. The on/off of this entity would be the on/off attribute of the Shelly switch and the brightness + the colour temperature would be the brightness + colour temperature of the Ikea Tradfri pannel.
So far, so good, I’ve been able to turn on/off the Shelly switch. I’ve not tried the colour temperature yet, but when I try to change the brightness using my template I get the following error:
Here is the code of my template:
light:
- platform: template
lights:
template_sh_lig_officeli_ceiling_combined:
friendly_name: “OFFICE LI - CEILING COMBINED”
unique_id: template_sh_lig_officeli_ceiling_combined
value_template: >-
{% if is_state('light.sh_lig_burli', 'on') %}
on
{% else %}
off
{% endif %}
level_template: >-
{% if is_state('light.office_li_ceiling_panel_level_light_color_on_off', 'on') %}
{{ (states.light.office_li_ceiling_panel_level_light_color_on_off.attributes.brightness)|int }}
{% else %}
0
{% endif %}
turn_on:
service: light.turn_on
entity_id: light.sh_lig_burli
turn_off:
service: light.turn_off
entity_id: light.sh_lig_burli
set_level:
service: light.turn_on
data_template:
entity_id: light.office_li_ceiling_panel_level_light_color_on_off
brightness: “{{ brightness }}”
Anyone could help to identify what is wrong with my brightness?
Thanks in advance!