I wrote several simple scripts to turn on the lights in my house and I’m trying to get the dimmer to change depending on the time of day. Here’s one of the most basic scripts:
alias: Office Light
sequence:
- type: turn_on
device_id: 5c8368a214e8941e9041b5496866ce19
entity_id: light.boob_light
domain: light
brightness_pct: ‘100’
mode: single
icon: mdi:currency-usd
Now here’s my evil, nasty little ?!#?!>?!? of a problem: every time I try to replace the 100 with:
‘{{ (states(“var.light_pct”) | int) }}’
it fails. Every time. I get the following error message:
Message malformed: expected float for dictionary value @ data[‘brightness_pct’]
The states command works – I can get notify to send a push notification with the exact number, no problem. So I haven’t the foggiest flippin’ idea why I can’t get past this.
Anyone out there think they might be able to help me?