Hello, I want to set brightness (and colors, but the issue is the same) from variables. For example I have variable configured: bedroom_lights_color_bright.
I’m doing this:
data:
brightness: '{{ states(''input_number.bedroom_lights_color_bright'') | int }}'
rgb_color:
- 0
- 0
- 255
entity_id: light.bedroom
service: light.turn_on
It will fail with message:
BedroomWallSwitchToggle: Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data['brightness']
state is correct. For instance this (to test) sends correct value (eg: “test 123”):
data:
message: 'test {{states(''input_number.bedroom_lights_color_bright'') | string}}'
service: telegram_bot.send_message
I’ve read most a lot of threads and examples. Besides in https://www.home-assistant.io/integrations/input_number/
example says:
data:
entity_id: light.bedroom
brightness: "{{ states('input_number.bedroom_brightness') | int }}"
I’ve tried different quotes, with and whiteout them.
Eg: doing like this
data:
brightness: {{ states(''input_number.bedroom_lights_color_bright'') | int }}
will be saved as:
brightness:
'[object Object]': null
What am I missing? Obviously something simple.