Use Home Assistant Assist Conversation in Alexa 😊
- Create/Activate a Home Assistant API for your user and obtain a long-term access token.
-
Create an Alexa-hosted (Python) Skill in the Alexa Developer Console:
- Name your Skill: Choose a name of your preference (e.g., HomeAssist)
- Choose a primary locale: Portuguese (BR)
- Type of experience: Other > Custom > Alexa-hosted (Python)
- Hosting region: You can leave the default (US East (N. Virginia))
- Templates: Click on Import Skill
- Insert the address: https://github.com/rodrigoscoelho/skill-alexa-chatgpt4-assistpipeline-HomeAssistant.git
-
Go to the "Code" tab
-
Enter your information in the
config.txt
file:- Open the
config.txt
file in the root directory of the project (/Skill Code/lambda/). - Insert the following information:
home_assistant_url=https://YOUR-HOME-ASSISTANT-URL:8123/api/conversation/process home_assistant_token=YOUR-HOME-ASSISTANT-TOKEN home_assistant_agent_id=YOUR-AGENT-ID
- home_assistant_url: Your Home Assistant conversation API URL (including the default port 8123).
- home_assistant_token: Your Home Assistant's long-term access token.
- home_assistant_agent_id: The conversation agent ID configured in your Home Assistant.
- Open the
-
Save the changes.
- The default invocation name configured in the code is "home mode".
- To change the invocation name:
- Go to the "Build" tab in the Alexa Developer Console.
- Click on "Invocations" and then on "Skill Invocation Name".
- Enter the new desired invocation name and save the changes.
- Rebuild the model (Build skill).
- The
agent_id
can be found in the debug assistant for your target conversation agent:- Go to Settings > Voice assistants > OpenAI (or the name you gave to the OpenAI assistant) > three dots menu > Debug.
- The
agent_id
will be displayed in the debug section.
- Build the Model and Deploy the Code in the "Deploy" tab.
- Test the Skill in the Alexa Developer Console to ensure it's working correctly.
Now you can use your Alexa Skill to integrate and interact with Home Assistant via the Assist Conversation API. If you liked it, remember to send a "Thank you" to the developer.
Use o Home Assistant Assist Conversation na Alexa 😊
- Crie/Ative uma API Home Assistant para seu usuário e obtenha um token de acesso de longa duração.
-
Crie uma Skill Alexa-hosted (Python) na Alexa Developer Console:
- Name your Skill: Escolha um nome de sua preferência (Ex: HomeAssist)
- Choose a primary locale: Portuguese (BR)
- Tipo de experiência: Other > Custom > Alexa-hosted (Python)
- Hosting region: Pode deixar o padrão (US East (N. Virginia))
- Templates: Clique em Import Skill
- Insira o endereço: https://github.com/rodrigoscoelho/skill-alexa-chatgpt4-assistpipeline-HomeAssistant.git
-
Vá na aba "Code"
-
Insira suas informações no arquivo
config.txt
:- Abra o arquivo
config.txt
no diretório raiz do projeto (/Skill Code/lambda/). - Insira as seguintes informações:
home_assistant_url=https://YOUR-HOME-ASSISTANT-URL:8123/api/conversation/process home_assistant_token=YOUR-HOME-ASSISTANT-TOKEN home_assistant_agent_id=YOUR-AGENT-ID
- home_assistant_url: URL da API de conversação do seu Home Assistant (incluindo a porta padrão 8123).
- home_assistant_token: Token de acesso de longa duração do seu Home Assistant.
- home_assistant_agent_id: ID do agente de conversação configurado no seu Home Assistant.
- Abra o arquivo
-
Salve as alterações.
- O nome de invocação padrão configurado no código é "modo casa".
- Para alterar o nome de invocação:
- Vá para a aba "Build" no Alexa Developer Console.
- Clique em "Invocations" e depois em "Skill Invocation Name".
- Insira o novo nome de invocação desejado e salve as alterações.
- Rebuild o modelo (Build skill).
- O
agent_id
pode ser encontrado no assistente de debug para o seu agente de conversação alvo:- Acesse Settings > Voice assistants > OpenAI (ou o nome que você deu ao assistente OpenAI) > menu de três pontos > Debug.
- O
agent_id
será exibido na seção de debug.
- Faça Build do Modelo e Deploy do Código na aba "Deploy".
- Teste a Skill no console da Alexa Developer para garantir que está funcionando corretamente.
Agora você pode usar sua Skill Alexa para integrar e interagir com o Home Assistant via Assist Conversation API. Se gostou, lembre-se de mandar um ""Obrigado"" para o desenvolvedor.