Hi all,
I want to get a state attribute based on a variable (for example hard coded) with the entity_id.
{{ state_attr('switch.shellyplug_1', 'last_changed') }}
{{ states.switch.shellyplug_1.last_changed }}
The states
function return the value, but state_attr
not. I’m I doing something wrong?
UPDATE:
Okay I’ve read last_changed
is a property and not an attribute. What is the difference between states and state_attr - #6 by tom_l
How can I use a variable in this line then?
{{ states.switch.shellyplug_1.last_changed }}
5 posts - 2 participants