-
Notifications
You must be signed in to change notification settings - Fork 58
-
Is there a way to list all entities in a given area. I'd also like to be able to filter by entity domain, but i can do that manually if needed.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
ALERTua
Jul 15, 2023
# https://github.com/home-assistant/core/blob/master/homeassistant/helpers/template.py
import homeassistant.helpers.template as template
class Area:
def __init__(self, area_name):
self.name = area_name
def area_id(self):
return template.area_id(hass, self.name)
def entity_ids(self):
return template.area_entities(hass, self.name)
def devices(self):
return template.area_devices(hass, self.name)
via https://github.com/ALERTua/ha_pyscript_modules/blob/main/entities/area.py
Replies: 1 comment
-
# https://github.com/home-assistant/core/blob/master/homeassistant/helpers/template.py
import homeassistant.helpers.template as template
class Area:
def __init__(self, area_name):
self.name = area_name
def area_id(self):
return template.area_id(hass, self.name)
def entity_ids(self):
return template.area_entities(hass, self.name)
def devices(self):
return template.area_devices(hass, self.name)
via https://github.com/ALERTua/ha_pyscript_modules/blob/main/entities/area.py
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Answer selected by
tal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment