Rekhyt@lemmy.worldtohomeassistant@lemmy.world•IKEA's new smart plug to track power consumption could launch soonEnglish
15·
5 months agoWhy not just not use the switch function? You can even “disable” the switch in Home Assistant so you can’t accidentally turn it off, and most of these sorts of switches have a setting for default (on power restoration after power loss) of on or off.
Out of curiosity, is it something as simple as needing to wrap the template in quotes? I may be mixing up my YAML with the Ansible work I’ve been doing, but I think you need to have templates double quoted like this in order to resolve the jinja2 properly:
"{{ state_attr('light.etc', 'brightness') }}
I don’t think you need the quotes in the Templates section of dev tools but you do in YAML files. I could be wrong though, let me know if you try it.
Definitely use the
state_attr()
form overstates.etc.etc
form. I think there’s something about how HA handles startup that may mess with templates if you usestates.etc.etc
.