ljmerza / light-entity-card

Control any light or switch entity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using Effects in Template Light entity

new-kirte opened this issue · comments

Hi,
The following template light works with the standard colour wheel:

  - platform: template
    lights:
      local_tuya_fairy_lights:
        unique_id: template_light.local_tuya_fairy_lights
        friendly_name: "Local Tuya Fairy Lights"
        value_template: "{{is_state('light.smart_fairy_lights','on')}}"
        effect_list_template: "{{ state_attr('input_select.fairy_lights_effects', 'options') }}"
        effect_template: "{{ states('input_select.fairy_lights_effects') }}"
        color_template: "{{state_attr('light.smart_fairy_lights', 'hs_color')}}"
        level_template: "{{state_attr('light.smart_fairy_lights', 'brightness')}}"
        turn_on:
          service: light.turn_on
          target:
            entity_id:
              - light.smart_fairy_lights
        turn_off:
          service: light.turn_off
          target:
            entity_id:
              - light.smart_fairy_lights
        **set_effect:
          - service: script.local_tuya_fairy_lights_change_scene_v10
            data_template:
              effect: '{{effect}}'**
        set_color:
          - service: light.turn_on
            data_template:
              hs_color: "({{h}}, {{s}})"
              entity_id:
                 - light.smart_fairy_lights
        set_level:
          - service: light.turn_on
            data_template:
              brightness: "{{brightness}}"
              entity_id:
                 - light.smart_fairy_lights

However, when using this custom card {{effect}} parameter is empty, so changing effects is not possible. Would it be possible to fix?