pyscript
pyscript copied to clipboard
Generate promote for AI conversation agent
With HA added Open AI, Google Gen AI as conversation agent, user now use Template in promote box to list out all rooms, device, entity for AI. Is that possible to be done by PyScript?
Without the examples I can only show you how to list all HA devices:
from homeassistant.helpers import device_registry
from homeassistant.helpers.device_registry import DeviceEntry
from typing import List
registry = device_registry.async_get(hass)
devices: List[DeviceEntry] = registry.devices.values()
The devices object is filled like so: https://github.com/home-assistant/core/blob/2024.6.4/homeassistant/helpers/device_registry.py#L977
The DeviceEntry object is described here: https://github.com/home-assistant/core/blob/2024.6.4/homeassistant/helpers/device_registry.py#L977