Hello all,
My end goal here is to reset my hue lights back to what they were after an event happens that triggers a script… at the moment I have the following test script:
This script gets the current brightness of the light, dims it, then turns it back to whatever brightness it was originally set at. Everything works up to setting the brightness back
test_script:
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.right_table_lamp_brightness
value: '{{states.light.right_table_lamp.attributes.brightness}}'
- service: light.turn_on
entity_id: light.right_table_lamp
data:
brightness_pct: 30
transition: 1.15
- delay:
milliseconds: 2300
- service: light.turn_on
entity_id: light.right_table_lamp
data:
brightness: '{{states.input_text.right_table_lamp_brightness.state}}'
transition: 1.15
I cannot get "brightness: ‘{{states.input_text.right_table_lamp_brightness.state}}’ " to work I have tried many different iterations and variations of the line but I always get the same error:
Invalid service data for light.turn_on: expected int for dictionary value @ data['brightness']. Got '{{states.input_text.right_table_lamp_brightness.state}}'
What am I doing wrong here? Is there a better way to store a global variable? I feel like this should be something commonplace, but then again I am a programmer by trade.