# ha-brave-summarizer
Uses the Brave search api to ask the Home Assistant Voice Assistant simple questions and get meaningful results.
The flow for this is a little convoluted because accessing the correct Home Assistant properties in the correct places proved tricky.
AskQuestion
detects that a question is being asked and pipes the question to a custom Home Assistant Script ask_question
ask_question
sends the question to a custom service brave_summarizer
which makes the web request to Brave Searchbrave_summarizer
returns the question, summary, and sources to the script ask_question
in the variable brave_response
ask_question
then calls the python_script.set_state 3 times in parallel to update template sensors question_asked
, answer_summary
, and answer_sources
.AskQuestion
now considers the process complete and answers the user from a template which uses sensorsanswer_summary
and answer_sources
.custom_sentences
that will intercept the question type and wildcard (this is broken into two parts so we don't just put a wildcard as the base)summarizer_service
including setting the X-Subscription-Token
configuration.yaml
with sensors that will hold the values for the question_asked
, the answer_summary
, and the answer_sources
. I used a template type that updates at midnight just so the question does hang out foreverconfiguration.yaml
to include python scriptsconfiguration.yaml
to include the custom brave_summarizer
configuration.yaml
to include the intent_script
: AskQuestion
scripts.yaml
to include the ask_question
script (Just paste it onto the bottom)