Hi!
I would like to list (separated by comma) the friendly_name of all lights that are unavailable.
I got this far but then I got stuck.
{{ states.light|selectattr('state','equalto','unavailable')|list|join('\n') }}
It returns the text below where I can see the friendly_name, but I do not know how to extract it.
<template state light.portable_2=unavailable; restored=True, supported_features=40, friendly_name=portable 2 @ 2020-05-11T22:57:59.805573+02:00>
<template state light.sovrum_sangbord_daniel=unavailable; friendly_name=sovrum (sängbord daniel), supported_features=33 @ 2020-05-11T22:57:30.971928+02:00>
<template state light.sovrum_sangbord_ninni=unavailable; friendly_name=sovrum (sängbord ninni), supported_features=33 @ 2020-05-12T19:51:07.774874+02:00>
<template state light.tradfri_bulb_8=unavailable; restored=True, supported_features=0 @ 2020-05-11T22:57:59.811603+02:00>
<template state light.tyra_fonster_3=unavailable; friendly_name=tyra (fönster), supported_features=33 @ 2020-05-11T22:57:30.968700+02:00>
Thanks!