I would like to expand a little on the topic of HA Voice. Overall, HA Voice works well and I have no complaints. However, as a Nabu Casa subscriber, I would expect a little more from the assistant than just turning the lights on and off. I have been struggling with this for a long time and still can’t get it to work. My connection HA with Perplexity dosent work.
The assistant is still called Nabu, but I have named the information network, i.e., the internet, “the box.” I have a script for this
> alias: Perplexity - Ask and Read (CORRECTED)
> description: Script for asking questions to Perplexity AI and reading the answers
> mode: single
> icon: mdi:robot-happy
> fields:
> query_text:
> description: Question for Perplexity AI
> example: What is the weather like in Szczecin?
> required: true
> selector:
> text: null
> sequence:
> - alias: Set question in input_text
> target:
> entity_id: input_text.perplexity_question
> data:
> value: "{{ query_text }}"
> action: input_text.set_value
> - alias: Send query to Perplexity API
> action: rest_command.perplexity_query
> data:
> query: "{{ query_text }}"
> response_variable: api_response
> - alias: Save the response
> target:
> entity_id: input_text.perplexity_answer
> data:
> value: "{{ api_response.content.choices[0].message.content }}"
> action: input_text.set_value
> - alias: Read the response via TTS
> data:
> entity_id: media_player.home_assistant_voice_09641e_media_player
> message: "{{ states('input_text.perplexity_answer') }}"
> action: tts.google_translate_say
> - alias: Create notification with answer
> data:
> title: Perplexity AI
> message: |
> Question: {{ query_text }}
>
>
> Answer: {{ states('input_text.perplexity_answer') }}
> action: persistent_notification.create
and an endless list of queries my custome sentence
> ```
> ```
> language: "pl"
> intents:
> AskPerplexity:
> data:
> - sentences:
> - "zajrzyj do pudełka {query}"
> - "sprawdź w pudełku {query}"
> - "pudełko {query}"
> - "zajrzyj do pudełka i {query}"
> - "sprawdź w pudełku co wiesz o {query}"
> - "pudełko powiedz mi o {query}"
> - "zajrzyj do pudełka i sprawdź {query}"
> - "pudełko co wiesz o {query}"
> - "zapytaj pudełko {query}"
> - "sprawdź w pudełku informacje o {query}"
> - "zajrzyj do pudełka i wyjaśnij {query}"
> - "sprawdź w pudełku dane o {query}"
> - "pudełko wyjaśnij {query}"
> - "pudełko daj informacje o {query}"
> - "zajrzyj do pudełka i daj mi szczegóły o {query}"
> - "sprawdź w pudełku szczegóły {query}"
> - "pudełko opowiedz o {query}"
> - "zajrzyj do pudełka i opowiedz o {query}"
> - "sprawdź w pudełku fakty o {query}"
> - "pudełko jakie są informacje o {query}"
> - "zajrzyj do pudełka co możesz powiedzieć o {query}"
> - "sprawdź w pudełku co wiesz na temat {query}"
> - "pudełko jakie masz dane o {query}"
> - "zajrzyj do pudełka i sprawdź dane o {query}"
> - "sprawdź w pudełku co jest ważne o {query}"
> - "pudełko co warto wiedzieć o {query}"
> - "zajrzyj do pudełka i podaj informacje o {query}"
> - "sprawdź w pudełku jakie są fakty o {query}"
> - "pudełko przedstaw {query}"
> - "zajrzyj do pudełka i przedstaw {query}"
> - "sprawdź w pudełku co mówią eksperci o {query}"
> - "pudełko jakie są zalety {query}"
> - "zajrzyj do pudełka i powiedz zalety {query}"
> - "sprawdź w pudełku wady {query}"
> - "pudełko czym jest {query}"
> - "zajrzyj do pudełka i wyjaśnij czym jest {query}"
> - "sprawdź w pudełku jak działa {query}"
> - "pudełko jak działa {query}"
> - "zajrzyj do pudełka i sprawdź jak działa {query}"
> - "sprawdź w pudełku definicję {query}"
> - "pudełko jaka jest definicja {query}"
> - "zajrzyj do pudełka i podaj definicję {query}"
> - "sprawdź w pudełku znaczenie {query}"
> - "pudełko co oznacza {query}"
> - "pudełko kto {query}"
> - "zajrzyj do pudełka i sprawdź kto {query}"
> slots:
> query:
> ```
, about 255 ofcors i give u sample in PL language. When I ask, “Hey Nabu, look in the box and check what the weather is like in Boston,” nothing happens. I only get a response saying that there is no access and it can be checked in internet, and so on.
Ofcors if u got time u can check my adds to config yaml
# ======================================================================
# POLE TEKSTOWE DO PRZECHOWYWANIA PYTANIA DLA PERPLEXITY
# ======================================================================
input_text:
perplexity_question:
name: Pytanie do Perplexity
initial: "Jaka jest pogoda?"
max: 255
mode: text
# ======================================================================
# INTEGRACJA PERPLEXITY AI - REST COMMAND
# ======================================================================
rest_command:
perplexity_query:
url: "https://api.perplexity.ai/chat/completions"
method: POST
headers:
Authorization: "Bearer pplx-Here is my API"
Content-Type: "application/json"
payload: >
{
"model": "sonar",
"messages": [
{"role": "system", "content": "Odpowiadaj zwięźle i jasno po polsku w maksymalnie 3-4 zdaniach."},
{"role": "user", "content": "{{ query }}"}
],
"max_tokens": 200,
"temperature": 0.2
}
# ======================================================================
# SENSOR PERPLEXITY AI - ODBIERANIE ODPOWIEDZI
# ======================================================================
rest:
- resource: "https://api.perplexity.ai/chat/completions"
method: POST
headers:
Authorization: "Bearer pplx-ZDRNLz API L7EvPqJFV"
Content-Type: "application/json"
payload: '{"model":"sonar","messages":[{"role":"system","content":"Odpowiadaj zwięźle i jasno po polsku w maksymalnie 3-4 zdaniach."},{"role":"user","content":"{{ states(''input_text.perplexity_question'') }}"}],"max_tokens":200}'
scan_interval: 30
sensor:
- name: "Perplexity Answer"
unique_id: perplexity_answer_sensor
value_template: >
{% if value_json.choices %}
{% set content = value_json.choices[0].message.content %}
{% if content|length > 250 %}
{{ content[:250] }}...
{% else %}
{{ content }}
{% endif %}
{% else %}
Brak odpowiedzi
{% endif %}
json_attributes_path: "$.choices[0].message"
json_attributes:
- content
# ======================================================================
# CONVERSATION - ASYSTENT GŁOSOWY
# ======================================================================
conversation: