#kabukiman
1 messages · Page 1 of 1 (latest)
ah yeah that's a good direction
thanks
was trying to use the more elegant expand but didn't work
then:
{{ expand('group.my_group')|map(attribute='state')|map('int')|max }}
ok will try immediately, looks much better
same thing for your other one
thanks ! groups are not in the frontend yet or are they?
they aren't
for the other one, what value are you looking to return? the last changed time or the name of the thing that changed last?
was group change to groups? doc says group: but getting an error if i don't use groups:
basically both, but ended up with a sensor for both as I couldn't do it in one
still group: , else the config gives an error, all fine
had a duplicate in the config, my bad
{{ '{}: {}'.format(last_changed.name, last_changed.last_changed) }}
temp group readout works perfectly ! Thanks, now the second one
Second one perfectly too, a ) was missing, but figured it out.
Thanks, will have to play more with templates to get more knowledge, quite powerful !
nice! if you want something fun try relative_time(last_changed.last_changed))
cool, got the same output when i put the template i was using previously into lovelace. Automatically got the duration since change displayed instead of the time it triggered. Very useful although, nice for notifications etc thanks!
dp you know a way to get the timestamp_local somewhere in there so i get local time instead of UTC ?
tried in few locations but still get utc, don't really know how to apply it only to the last_changed.last_changed value
I could use a second sensor like this one {% set last_changed = expand('group.motion') |sort(reverse=true, attribute='last_changed') | first %} {{ as_timestamp(last_changed.last_changed) | timestamp_local }}
that returns utc and then combine them in a third sensor e.g.
could i integrate it in this template or do I need to use the second one?
can't use it on the last line as it uses only 1 positional argument
{{ '{}: {}'.format(last_changed.name, last_changed.last_changed|as_local) }} should do it
wow indeed works, thanks you