Skip to content

How do i enumerate all entities in an area (and filter by domain) #490

Answered by ALERTua
tal asked this question in Q&A
Discussion options

You must be logged in to vote
# 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

Comment options

You must be logged in to vote
0 replies
Answer selected by tal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants