I had an automation which used to work well, but since it last mattered things have broken
The automation checks my window sensor group and warns us if we’ve left windows open - we’re currently in a heatwave and after leaving the house with a window open realised it was giving me the wrong result… but it definitely used to give the right result
The following is in my check windows sensor node as the payload
(
$group:=$entity().attributes.entity_id;
$names:=$entities().*[entity_id in $group and state="on"].attributes.friendly_name;
$yes:="Warning! Windows open! The windows are: " & $join($names, ", ") & ". Warning!";
$no:="No windows are currently open";
$count($names)>0 ? $yes : $no
)
The group in question shows the correct state:
And it passes a payload. Unfortunately it only ever passes the No payload…
So it appears the $names variable is no longer populating
Does anyone know why this might be, and more to the point, how to fix it?!
Edit: checking the complete message object it doesn’t look like it’s obtaining any state for the entities within that. Maybe that’s okay?