-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement entity area property #2
Comments
Testing with Home Assistant 2023.3.6 Get areas: {
"type": "config/area_registry/list",
"id": 4
} Result (sample): {
"id": 4,
"type": "result",
"success": true,
"result": [
{
"aliases": [],
"area_id": "living_room",
"name": "Living Room",
"picture": null
},
{
"aliases": [],
"area_id": "kitchen",
"name": "Kitchen",
"picture": null
},
{
"aliases": [],
"area_id": "bedroom",
"name": "Bedroom",
"picture": null
}
]
} So far so good. But how do we get the entities in an There's the entity registry: {
"type": "config/entity_registry/list",
"id": 5
} Result (sample): {
"area_id": null,
"config_entry_id": "18c9ecbd442b0fad06359ece6efe4bbe",
"device_id": "3d293c15b9646fa6ee3c4659a3b17317",
"disabled_by": null,
"entity_category": null,
"entity_id": "light.esstisch",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"id": "f5bb2da87a4a4de5ea257d282d672f96",
"name": null,
"options": {},
"original_name": "Esstisch",
"platform": "hue",
"translation_key": null,
"unique_id": "3fd17309-9d07-4b50-8e6c-a8b78d20e84a"
} Buth Interestingly the manually defined power switch to control a Sonos speaker has an area: {
"area_id": "essen",
"config_entry_id": null,
"device_id": null,
"disabled_by": null,
"entity_category": null,
"entity_id": "switch.mystrom_switch",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"id": "00212855345302ed74851d23db636556",
"name": "Sonos Esstisch",
"options": {},
"original_name": "myStrom Switch",
"platform": "mystrom",
"translation_key": null,
"unique_id": "30AEA491D184"
} This doesn't seem to work: from my 100+ entities all except 3 return Looks like that quite a few things have changed. My current understanding:
Only example I've found: Then let's try with the device registry: {
"type": "config/device_registry/list",
"id": 6
} Bingo! {
"area_id": "essen",
"configuration_url": null,
"config_entries": [
"18c9ecbd442b0fad06359ece6efe4bbe"
],
"id": "3d293c15b9646fa6ee3c4659a3b17317",
"name": "Esstisch",
"sw_version": "1.101.2",
"via_device_id": "ee5dbf4b9197e2863380054b26dcc3ed"
},
So, no more easy way to get the area, now we have an additional indirection to deal with... |
As in YIO v1: request areas and set entity.area property in available entities.
WebSocket: https://community.home-assistant.io/t/how-to-get-list-of-areas-through-websocket-api-or-hass-object/426485/3
The text was updated successfully, but these errors were encountered: