Hi
I’ve read the documentation a few times and tried various things but to no avail.
I’d like to start making use of fields in my scripts in particular the selector target so it shows in the UI. Id like to pass this to a second script which is a helper script to transition the lights correctly due to a light limitation.
here is what i have so far.
script 1
scene_test:
alias: "Activate Scene Focus Test"
description: "Activates Focus Scene on Tradfri Bulb"
fields:
entities:
description: "Device or Devices to active scene on"
example: "light.lounge_main_light"
selector:
target:
entity:
domain: light
sequence:
- service: script.turn_on_ikea_light_test
target: "{{ entities }}"
data:
brightness_pct: 100
color_temp: 250
transition: 2
script 2 - helper script
turn_on_ikea_light_test:
sequence:
# Set the brightness of the lights.
- service: homeassistant.turn_on
target: "{{ entities }}"
data:
brightness_pct: "{{ brightness_pct | int }}"
transition: "{{ transition | int / 2 }}"
- delay: "00:00:{{ transition | int / 2}}"
# Set the color temperature.
- service: homeassistant.turn_on
target: "{{ entities }}"
data:
color_temp: "{{ color_temp | int }}"
transition: "{{ transition | int / 2 }}"
I’ve tried !input but that seems to be limited to blueprints. I have no idea where to go from here so throwing it out in the hopes someone else has done this. Searching the forums has been fruitless, maybe I’m searching the wrong thing, I dont know.
Help me home assistant community, you are my only hope.
Thanks in advance