Can I check the status of devices located in an Area?

Hello I have a simpe question. I have a little template :

{% if is_state('light.light_group_salon', 'on') %}
{% else %}
   background: rgba(var(--rgb-primary-background-color), 0.3);
{% endif %} 

This one checks the devices in the light group with on state.

Can be this done with an area ?

I have a livingroom area where I have multiple devices. Can above code be modified with areas instead of light groups ?

1 Like