-
Notifications
You must be signed in to change notification settings - Fork 14
Feature Request: Support loading entities using "Voice assistants" and Aliases #46
Comments
I have also thought about that, but Home assistant does not populate this information via their websocket API. Instead I would need to query the REST API for each entity to get its metadata. And probably additional requests to get the Voice assistant config. i wanted to make the communications between my app and HA as easy as possible and used a similar include/exclude mechanism as Alexa and Apple Home configurations (except for the improvement from the other issue 😁 ). Let’s keep that issue as a reminder for a future improvement. But I’ll not do that in the next days. |
Sry confused the github site. Would be feasable for the homeassitant addon. I have a potential idea. Does the Addon have access to config.storage.core\entity_registry? I have created a Node-RED flow(with help of GPT), I read this file, filter for entries where {"should_expose": true}, and then generate a configuration file tailored to my needs. This flag indicates whether the entity is configured for Assistants. You might consider creating a configuration file using a similar approach. An if this idea is a nogo for you someone could still make a node red flow when the addon allows for a config file. here´s an example of my filter function: const data = msg.payload && msg.payload.data;
const entities = data && data.entities;
if (Array.isArray(entities)) {
const filteredEntities = entities
.filter(entity => entity.entity_id && entity.options && entity.options.conversation && entity.options.conversation.should_expose === true);
const includeEntities = filteredEntities
.map(entity => ` - ${entity.entity_id}`)
.join('\n');
let entityConfig = 'entity_config:';
filteredEntities
.filter(entity => entity.aliases)
.forEach(entity => {
entity.aliases.forEach(alias => {
entityConfig += `\n ${entity.entity_id}:\n name: "${alias}"`;
});
});
msg.filename = '/config/alexa_expose/generated_smart_home.yaml';
msg.payload = `smart_home:\n locale: de-DE\n endpoint: https://api.eu.amazonalexa.com/v3/events\n client_id: !secret alexa_client_id\n client_secret: !secret alexa_client_secret\n filter:\n include_entities:\n${includeEntities}\n\n ${entityConfig}`;
} else {
msg.payload = '';
}
return msg;
|
Yes, using the registry is exactly what I intended to do 😁 I don’t think I need another config file. As a next step i wanted to use that "conversation.expose" property. So, having that in mind, but other stuff was higher priority yet 😅 |
This issue is stale because it has been open for 30 days with no activity. |
Hi @t0bst4r
Please consider loading entities by using the Voice assistants and associated aliases feature in HASS.
I'm sure you have your own plans for what you want to do but I thought I would get my requests in first :-)
The text was updated successfully, but these errors were encountered: