I think I’m a bit confused here and could use some help. I am trying to create a script that runs custom light effects depending on an input_select via a light template.
this is my light template:
- platform: template
lights:
living_room_light_template:
friendly_name: "Living Room Light Template"
level_template: "{{ state_attr('light.living_room_lights','brightness') }}"
value_template: "{% if states('switch.living_room_ceiling_light_relay') == 'off' %} {{'off'}} {%else%} {{ states('light.living_room_lights') }} {%endif%}"
temperature_template: "{{state_attr('light.living_room_lights','color_temp_kelvin') | int}}"
hs_template: "{{ state_attr('light.living_room_lights','hs_color') }}"
effect_list_template: "{{ state_attr('input_select.living_room_light_effects', 'options') | list}}"
effect_template: "{{ states('input_select.living_room_light_effects')}}"
turn_on:
action: script.living_room_lights_on
turn_off:
action: script.living_room_lights_off
set_level:
action: light.turn_on
target:
label_id: living_room_lights
data:
brightness: "{{ brightness }}"
set_temperature:
action: light.turn_on
target:
label_id: living_room_lights
data:
color_temp: "{{ color_temp }}"
set_hs:
action: light.turn_on
data:
entity_id: "{{ label_entities('Living Room Lights') | list }}"
#transition: "{{ transition | float }}"
hs_color:
- "{{ hs[0] }}"
- "{{ hs[1] }}"
set_effect:
- action: script.living_room_lights_effect
data:
effect: "{{ effect }}"
set_rgb:
action: light.turn_on
data:
entity_id: "{{ label_entities('Living Room Lights') | list }}"
#transition: "{{ transition | float }}"
rgb_color: ({{ r }} , {{ g }} , {{ b }})
########### not available on Wiz Matter Bulbs Currently
# set_rgbww:
# action: light.turn_on
# data:
# entity_id: "{{ label_entities('Living Room Lights') | list }}"
# #transition: "{{ transition | float }}"
# rgbww_color: ({{ r }} , {{ g }} , {{ b }}, {{ cw }}, {{ ww }})
# supports_transition_template: "{{ true }}"
And this is my script:
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{effect == 'Warm White'}}"
sequence:
- action: light.turn_on
target:
label_id: living_room_lights
data:
kelvin: 2650
- conditions:
- condition: template
value_template: "{{effect == 'Cool White'}}"
sequence:
- action: light.turn_on
target:
label_id: living_room_lights
data:
kelvin: 5400
alias: Living Room Lights Effect
description: ""
I’m getting an error:
2025-02-25 13:23:52.605 ERROR (MainThread) [homeassistant.helpers.script.living_room_light_template] Living Room Light Template: Error executing script. Service not found for call_service at pos 1: Action script.living_room_lights_effect not found
A pop up says: “action script.living_room_lights_effect uses action light.turn_on which was not found.”
I also think I’m not passing the effect variable properly and could use some guidance on that.
Thanks in advance