#kabukiman

1 messages · Page 1 of 1 (latest)

icy elk
#

put them all in a group

wet grove
#

ah yeah that's a good direction

#

thanks

#

was trying to use the more elegant expand but didn't work

icy elk
#

then:
{{ expand('group.my_group')|map(attribute='state')|map('int')|max }}

wet grove
#

ok will try immediately, looks much better

icy elk
#

same thing for your other one

wet grove
#

thanks ! groups are not in the frontend yet or are they?

icy elk
#

they aren't

wet grove
#

ok thanks, wasn't sure

#

will implement now

#

thanks a lot already!

icy elk
#

for the other one, what value are you looking to return? the last changed time or the name of the thing that changed last?

wet grove
#

was group change to groups? doc says group: but getting an error if i don't use groups:

wet grove
#

still group: , else the config gives an error, all fine

#

had a duplicate in the config, my bad

icy elk
#
{{ '{}: {}'.format(last_changed.name, last_changed.last_changed) }}
wet grove
#

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 !

icy elk
#

nice! if you want something fun try relative_time(last_changed.last_changed))

wet grove
#

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!

wet grove
#

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.

icy elk
#

|as_local() is what you want

#

|as_local(last_changed.last_changed)

wet grove
#

can't use it on the last line as it uses only 1 positional argument

icy elk
#

{{ '{}: {}'.format(last_changed.name, last_changed.last_changed|as_local) }} should do it

wet grove
#

wow indeed works, thanks you