Trying to understand a few things about Snips->HA and Snips<-HA

#1

New here, thanks in advance for everyones great work.

I have snips and HA working together, both on separate RaspberryPis and have it working for the most part. Toggle lights, control the TV, lock doors, and can ask Snips for status of doors and what not. There are though a few things that I have not yet been about to work out and have not found answers here or elsewhere online.

#1: I cannot get the HA snips.say service to work. The request is received by snips but it does not play the audio. Keep in mind that when I call ‘speech:’ in an HA intent script it does play the audio. Here is the sam watch output while calling the snips.say service:

[18:57:01] [Dialogue] was asked to start a session on site default
Custom Data ->
[18:57:01] [Asr] was asked to stop listening on site default
[18:57:01] [Hotword] was asked to toggle itself ‘off’ on site default
[18:57:01] [Dialogue] session with id ‘1e14813c-6a69-4fff-954d-9a0096f68ccb’ was queued on site default
Custom Data ->
[18:57:01] [Dialogue] session with id ‘1e14813c-6a69-4fff-954d-9a0096f68ccb’ was started on site default
Custom Data ->
[18:57:01] [Tts] was asked to say “Garage door just opened”
[18:57:01] [AudioServer] was asked to play a wav of 55.5 kB with id ‘3242d829-41e9-4ed4-bb89-60cfda074803’ on site default
[18:57:17] [Dialogue] session with id ‘1e14813c-6a69-4fff-954d-9a0096f68ccb’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner
Custom Data ->
[18:57:17] [Asr] was asked to stop listening on site default
[18:57:17] [Hotword] was asked to toggle itself ‘on’ on site default


#2: Should I expect snips to pass on intents which it already handled to HA? Example, if I ask snips what time it is, the intent is handled by rgholmes:getCurrentTime but HA also receives the intent and produces an error since it has not been told how to handle it. I guess its not the end of the world to get the error in HA but I was just wondering if this is expected behavior.


#3 (Not HA related but I’ll over step and ask here anyway): I cannot get ozie:mathsQuestion to work. Cannot find anything online as to why. sam watch output:

[17:06:12] [Asr] was asked to listen on site master
[17:06:14] [Asr] captured text “what 's two plus two” in 2.0s
[17:06:14] [Asr] was asked to stop listening on site master
[17:06:14] [AudioServer] was asked to play a wav of 93.1 kB with id ‘0009564d-d959-4509-880e-61301d063c9e’ on site master
[17:06:16] [AudioServer] finished playing wav with id ‘0009564d-d959-4509-880e-61301d063c9e’
[17:06:16] [Nlu] was asked to parse input “what 's two plus two”
[17:06:16] [Nlu] detected intent ozie:mathsQuestion with confidence score 1.000 for input “what 's two plus two”
Slots ->
number -> 2 (confidence: 1.000)
function -> plus (confidence: 1.000)
number -> 2 (confidence: 1.000)
[17:06:16] [Dialogue] New intent detected ozie:mathsQuestion with confidence 1.000
Slots ->
number -> 2 (confidence: 1.000)
function -> plus (confidence: 1.000)
number -> 2 (confidence: 1.000)
[17:06:16] [Dialogue] was ask to end session with id a43726eb-12d5-469f-b82e-13f488ecd91b by saying ‘Something went wrong, I can not do that maths calculation for you’
[17:06:16] [Tts] was asked to say “Something went wrong, I can not do that maths calculation for you”
[17:06:16] [AudioServer] was asked to play a wav of 127.3 kB with id ‘9b37dd11-3e74-4ddc-8ae7-26b2644e09ac’ on site master
[17:06:21] [AudioServer] finished playing wav with id ‘9b37dd11-3e74-4ddc-8ae7-26b2644e09ac’
[17:06:21] [Tts] finished speaking with id ‘9f0f4aac-d188-4001-b5d0-b8cd6f69838f’
[17:06:21] [Dialogue] session with id ‘a43726eb-12d5-469f-b82e-13f488ecd91b’ was ended on site master. The session ended as expected
[17:06:21] [Asr] was asked to stop listening on site master
[17:06:21] [Hotword] was asked to toggle itself ‘on’ on site master


Does anyone have any thought on these issues?

Thanks everyone.

#2

I can answer the maths question😁 seems it hit a problem and can’t work
What version of snips are u running snips-nlu —version

i think my maths app is failing because of some changes… the version I just published an update works fine in the latest snips version

#3

i have also just published my maths up with an update
it no longer uses snippet code and instead uses github app code
its python3 now
and fixed a few bugs

#4

as for HA talking… what is the script you have that does not work??

is it something like

- id: snips_annouce_weather_changes
  alias: Snips announcement of weather changes
  initial_state: true
  hide_entity: false
  trigger:
    platform: state
    entity_id:
    - sensor.dark_sky_minutely_summary
  action:
    service: snips.say
    data_template: 
      text: 'Weather update.  {{ trigger.to_state.state|default(''NULL to_state'') }}'
#5

Oh, hay @ozie, I guess if anyone would know about the maths thing it would be you. Thanks for getting back to me.

Snips version:
snips-nlu 1.1.2 (0.62.3) [model_version: 0.19.0]
I believe this is the latest version.

OK, I see your new version, I deployed my assistant to update the skill but I am getting the same results.

For the HA talking issue, here is my script:

- id: garage_door_just_opened
  alias: Garage Door Just Opened
  trigger:
  - entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level
    platform: state
    to: '255'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: device_tracker.me
        state: home
      - condition: state
        entity_id: device_tracker.thewife
        state: not_home    
  action:
  - service: notify.sms_to_me
    data:
      message: Garage Door Just Opened
  - service: snips.say
    data:
      text: Garage door just opened

I do receive the notification, and I do see the request in sam watch, but nothing is played on the speaker.

#6

Update.

I deleted the folder /var/lib/snips/skills/ozie.Calculations then rebuilt the assistant and it now works.

Thank you very much @ozie that did the trick. You rock.

Now I just need to figure out the other two issues.

1 Like
#7

shouldn’t the text be in quotes?? text: 'Garage door just opened'

#8

I dont think it should matter in yaml but I tested single quoted and same results. Snips says nothing.

[19:57:39] [Dialogue] was asked to start a session on site default
Custom Data ->
[19:57:39] [Asr] was asked to stop listening on site default
[19:57:39] [Hotword] was asked to toggle itself ‘off’ on site default
[19:57:39] [Dialogue] session with id ‘67728f8c-79c3-473b-b5a5-9547ee7d5ca6’ was queued on site default
Custom Data ->
[19:57:39] [Dialogue] session with id ‘67728f8c-79c3-473b-b5a5-9547ee7d5ca6’ was started on site default
Custom Data ->
[19:57:39] [Tts] was asked to say “Garage door just opened”
[19:57:39] [AudioServer] was asked to play a wav of 55.5 kB with id ‘6b3d6a7d-38d1-4e02-9d20-59d701a3323f’ on site default
[19:57:54] [Dialogue] session with id ‘67728f8c-79c3-473b-b5a5-9547ee7d5ca6’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner
Custom Data ->
[19:57:54] [Asr] was asked to stop listening on site default
[19:57:54] [Hotword] was asked to toggle itself ‘on’ on site default

#9

on the snips device that should be talking what does the /etc/snips.toml file have?

#10

/etc/snips.toml

[snips-common]
mqtt = "127.0.0.1:1883"

[snips-audio-server]
bind = "master@mqtt"

[snips-tts]
customtts = { command = ["pico2wave", "-w", "%%OUTPUT_FILE%%", "-l", "en-US", "%%TEXT%%"] }

everything else is commented

#11

you have bind = "master@mqtt"
so your devices name for hermes is master

but in the logs i can see

 [AudioServer] was asked to play a wav of 55.5 kB with id ‘6b3d6a7d-38d1-4e02-9d20-59d701a3323f’ on site default

which says on site default but it should be sent to site master. that’s why you are not hearing anything

#12

@ozie, I cant thank you enough. I never would have found that on my own.

I changed bind = "master@mqtt" to bind = "default@mqtt" and it now works as expected. And did not appear to break anything.

The only thing I now have to figure out in my install (for now anyways) is to find out if it is expected behavior for snips to send intents to HA even after snips handles the intent. And if there is a way to prevent it if it is expected.

Thanks very much!

#13

if you only have ONE snips device then default is fine… if you have more, then they all need unique names, else every device named default will talk etc at the same time

Snips septs out a MQTT topic /intent/xxxxx
only items subscribed to the intent will answer the intent… if HA does not have a setup to listen for that topic HA won’t do anything… same for snips apps… if they are not listening to a particular intent topic nothing happens

#14

That makes sense now, thank you for explaining it to me. I will keep it in mind as I start to add satellites.

Ok, fiiiiine, I will just ignore the errors in HA, if I must :smiley: - or likely more realistically I will eventually add intents that dont do anything, so I dont have to see the errors.

Thanks again for everything!!!