Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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!

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

# 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

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

AltStyle によって変換されたページ (->オリジナル) /