Just got stuck now. I’d like to update my Node-Red automations with the circadian light values.
So I called the attributes whenever I turn on a light as followed:
kelvin: “{{ state_attr(‘sensor.circadian_values’, ‘colortemp’) | int }}”
brightness_pct: “{{ state_attr(‘switch.circadian_lighting_circadian_lightning’, ‘brightness’) | int }}”
NodeRed node:
[{"id":"adbf97df.f01828","type":"api-call-service","z":"69fe71a0.9c25d","name":"Schalte Ganglicht an","server":"4d6df871.899408","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.tradfri_gang_1, light.tradfri_gang_2, light.tradfri_gang_3, light.tradfri_gang_4, light.tradfri_gang_5, light.tradfri_gang_6","data":"{\"kelvin\":\"{{ state_attr('sensor.circadian_values', 'colortemp') | int }}\",\"brightness_pct\":\"{{ state_attr('switch.circadian_lighting_circadian_lighting', 'brightness') | int }}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":260,"y":260,"wires":[[]]},{"id":"4d6df871.899408","type":"server","z":"","name":"Home Assistant"}]
ending up in the following error msg:
Call-service API error. Error Message: expected int for dictionary value @ data[‘kelvin’]
Although the colortemp value of circadian_values sensor is a int vlaue…
Also the same error happen with brightness and float expected, when I put kelving to a fixed value (e.g. 5000) for testing purpose.
Anyone an idea?