home-assistant / intents

Intents to be used with Home Assistant
https://developers.home-assistant.io/docs/voice/overview/
Creative Commons Attribution 4.0 International
449 stars 512 forks source link

Get area_name of matched results #1128

Open TheFes opened 1 year ago

TheFes commented 1 year ago

I was thinking about creating intents like in which room are there still lights on

In HA you could do something like {{ states.light | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | map('area_name') | select() | unique | list | sort }} however area_name is not working in the test environment, so I can not get responses using something like {{ query.matched | map(attribute='entity_id') | map('area_name') | select() | unique | list | sort }} to pass the tests. I would probably work in HA :)

Would it be possible to have area_name working in the test environment?

TheFes commented 1 year ago

This would also be a nice addition for the binary sensors, so you can ask in which room smoke/co/sound whatever is detected

TheFes commented 1 year ago

@synesthesiam would this be something which can be added?

synesthesiam commented 1 year ago

Sure, that seems pretty straightforward. I've added it to my TODO list :+1: