Hi,
I"m trying to port the following ZHA template to Zigbee2MQTT:
One of the features in the script is that it uses a input_text
to store the current light as a variable - which you can then dim using the Phillips Hue dial.
I’ve created an input_text
helper, and I’m able to set this successfully to the current light using the input_text.set
service.
(I also tested using an input_select
, which also seems to working - I’m still not sure of the pros/cons of an input_text
vs input_select
. I assume it’s mainly around validating input, right?).
However, when I try to use the value in an automation, it doesn’t work.
Originally, I had:
remote_dial_rotate_right_step:
- service: light.turn_on
data:
brightness_step_pct: 5
target:
entity_id: {{ lights[states(input_text.hue_dial_1_input_text)] }}
which didn’t seem to do anything. I figured it was because it was trying to cal the literal string input_text.hue_dial_1_input_text
.
I then tried:
entity_id: {{ lights[states(input_text.hue_dial_1_input_text)] }}
However, when I try to save this YAML in the Automation Editor, it gives me an error:
Message malformed: not a valid value for dictionary value @ data['action'][1]['choose'][16]['sequence'][0]['target']['entity_id']
Does anybody know the correct syntax to call the actual light stored in the input_select
, and use it in a lights.turn_on
service?
Also, should I be storing ligths.hallway_lights
, or is there some way to store hallway_lights
, and prepend lights.
to the string?
Thanks,
Victor