#Custom Weather Intent

1 messages ยท Page 1 of 1 (latest)

hallow bison
#

@sullen copper Created a thread instead of clogging main chat

#

I am using the openweathermap integration, but it can be applied elsewhere, you just have to be mindful of your condition names. I convert them to nicer strings for playback-ability

sullen copper
hallow bison
#

This may sound crazy, but I wonder if you can do a catch all type of deal. Give me a second.

#

No luck, what are you actually trying to do?

#

If you want a custom response, you can do that by setting up a _common.yaml file

raw tusk
sullen copper
raw tusk
#

I just meant following up on "Sorry, i don't understand". Actual conversations are a planned feature for the default conversation agent.

Can you give an example of such a follow up automation?

sullen copper
#

I envision something like this (excuse the formatting):

alias: Sorry I couldn't understand that
description: "Pass all mis-understood stuff to Alexa"
trigger:
  - platform: conversation
    on_response: "Sorry I couldn't understand that"
condition: [add filters for specific first-word actions like "Play" "what", etc if needed, otherwise send all failures to Alexa]
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen_alexa
    data:
      media_content_type: custom
      media_content_id: {{conversation__agent_input_sentence}}

documented here:
https://github.com/alandtse/alexa_media_player/wiki#run-custom-command

sullen copper
atomic onyx
#

Hi guys, I have 2 questions:

  1. I'm sorry for getting off topic. I was checking the @hallow bison 's code. Is there any documentation where I can see the syntax for intents? I mean, when do I need to use (), {, [ and others?
  2. Setting up the custom commands to send them to alexa described here https://github.com/alandtse/alexa_media_player/wiki#run-custom-command How can I grab my command said to nabu, to resend it to alexa with an intent_script?
sullen copper
#

So, I do this w/ automations and sentance triggers.

description: ""
trigger:
  - platform: conversation
    command:
      - what is the weather
      - weather forecast
      - weather
condition: []
action:
  - service: script.Play_msg_on_Kitchen_Alexa_with_volume_set and_reset
    data:
      message: >-
        The current weather forcast is
        {{state_attr('weather.keul_daynight','forecast')[0]['detailed_description']
        }} 
mode: single

and the relavant part of the script it calls:

alias: Play msg on Kitchen Alexa with volume set and reset
sequence:
  - service: media_player.volume_set
    data:
      volume_level: 0.65
    target:
      entity_id: media_player.kitchen_original
  - service: notify.alexa_media_kitchen_original
    data:
      message: "{{ message }}"

As I started down this path I realized VERY quickly that this is NOT scalable. Like at all. There is too many things we do w/ our Assistants that HA Voice has no idea how to handle, and probably never will.
So this led me to asking about creating this "shim" between HA Assist and Alexa that would throw ANY command thats not recognized by HA Assist to Alexa until Voice matures more.

hallow bison
#
                                                                                      test
Sorry, I didn't want to understand that
raw tusk
#

@sullen copper that's exactly what pipeline fallback/chaining refers to. If a pipeline fails and returns an error response (for whatever reason), fall back to the next pipeline. Without analyzing if the response matches a certain sentence and all done internally. That's something that is being looked at. I've tried doing a custom integration for this, but there was too little support in the HA core

sullen copper
#

Im impatient, probably just like you guys are ๐Ÿ™‚

raw tusk
#

Regarding too many things that HA doesn't know how to handle, you have custom sentences/custom intents and sentence triggers. Both with their pitfalls, but you have them

sullen copper
#

@raw tusk How's. the weather in Romania????

hallow bison
raw tusk
sullen copper
hallow bison
#

I didn't want* vs couldn't

raw tusk
hallow bison
#

Can't do screenshots in here, but using a _common file works

hallow bison
#

As I understood it, the _common file is global, so it should work no?

raw tusk
hallow bison
#

What you linked earlier.

I just used the _common on from the intents repo and changed the error response.

raw tusk
#

You don't need to call anything _common.yaml

hallow bison
#

That's true.

#

Just need this entry:

responses:
  errors:
    no_intent: "Sorry, I didn't want to understand that"```
raw tusk
#

Exactly

hallow bison
#

With that, I thought I read somewhere that you can define a list or etc in the _common file and it could be referenced globally, while lists in a specific file are local

raw tusk
#

That's somewhat true if you work on the built-in sentences

#

Not if you're just using HA

hallow bison
#

I don't think I follow. It would just affect the built-in sentences? Or do you mean via the python scripts?

raw tusk
#

I can't say for certain since i'm merely guessing what docs you've read. This is the built-in intent repo, where each language has a _common.yaml file in the sentences folder https://github.com/home-assistant/intents

raw tusk
# sullen copper LOL

I wanted to ignore this at first, take it as merely a funny "ha ha", but my spider senses are tingling with irony. What do you mean? That it's not what you expected?

sullen copper
raw tusk
#

I meant the "LOL"

#

I guess it's not what you expected, to have a dedicated weather entity. Which made my argument (that you can query for weather in 2023.12) laughable

sullen copper
#

you told me to install a weather entity for that... I was just making converation!

#

I have weather apps up the wazoo!

raw tusk
#

Ok, sorry, i thought you were sincerely dissatisfied with the fact that you have to have a dedicated weather entity to ask about the weather in HA

atomic onyx
#

Guys, thinking out loud: to achieve what you're mentioning, is it possible to create 2 input_text helpers, and through an automation triggered by an event, assign the value of the intent to one input_text, and similarly, for the VA's response in the other input_text. Then, with another automation triggered by an if condition, if the response in the second input_text is the desired one, send the text from the first one to Alexa using media_content_type: custom ?. Does it make sense?๐Ÿ˜…

sullen copper