Hi,
I can’t understand the difference between light and switch groups.
I have created to groups ‘light.kitchen_lights’ and ‘switch.kitchen_swithces’.
If I then try:
{{ expand(state_attr('light.kitchen_lights', 'entity_id')) }}
and
{{ expand(state_attr('switch.kitchen_swithces', 'entity_id')) }}
Then the fist group expands fine like this:
[<template TemplateState(<state light.kitchen_inner_spots=off; supported_color_modes=[<ColorMode.BRIGHTNESS: 'brightness'>], off_with_transition=False, off_brightness=29, friendly_name=KITCHEN-Inner Spots, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-02-01T12:10:49.713830+01:00>)>, <template TemplateState(<state light.kitchen_outer_spots=off; supported_color_modes=[<ColorMode.BRIGHTNESS: 'brightness'>], off_with_transition=False, off_brightness=0, friendly_name=KITCHEN-Outer Spots, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-02-01T11:43:46.689054+01:00>)>]
but the switch group expands to:
[]
What I really like is to get the number of switches that are on in the group. I works perfect in the light group using this template:
{{ expand(state_attr('light.kitchen_lights', 'entity_id') )
| selectattr('state', 'eq', 'on')
| list
| count
}}
Any ideas?