I need to send to hass.io the siteid of the rhasspy client, but it is not passed in the intent json.
I use 2.5.0-pre.
Docker server/client installation
Any help?..
Can anyone help me with this please?
Did you tried site_id with latest version ?
just debug intent and see what is in
this is the json sent
{
“entities”: [],
“intent”: {
“confidence”: 1,
“name”: “GetTime”
},
“raw_text”: “what time is it”,
“raw_tokens”: [
“what”,
“time”,
“is”,
“it”
],
“recognize_seconds”: 0.3672276649158448,
“slots”: {},
“speech_confidence”: 1,
“text”: “what time is it”,
“tokens”: [
“what”,
“time”,
“is”,
“it”
],
“wakewordId”: “”
}
and this is the log
[DEBUG:2020-04-10 18:35:14,457] rhasspyserver_hermes: Handling AudioPlayFinished (topic=hermes/audioServer/MASTER_BEDROOM/playFinished, id=e098bd04-4e02-4e51-9797-77df7c3c9924)
[DEBUG:2020-04-10 18:35:12,179] rhasspyserver_hermes: Handling TtsSayFinished (topic=hermes/tts/sayFinished, id=e098bd04-4e02-4e51-9797-77df7c3c9924)
[DEBUG:2020-04-10 18:35:12,177] rhasspyserver_hermes: Handling AudioPlayBytes (topic=hermes/audioServer/MASTER_BEDROOM/playBytes/a38ab82d-c3ec-4551-8ed1-08f9b82aded7, id=e098bd04-4e02-4e51-9797-77df7c3c9924)
[DEBUG:2020-04-10 18:35:11,990] rhasspyserver_hermes: Publishing 132 bytes(s) to hermes/tts/say
[DEBUG:2020-04-10 18:35:11,990] rhasspyserver_hermes: -> TtsSay(text='The time is 21 35', lang='', id='a38ab82d-c3ec-4551-8ed1-08f9b82aded7', siteId='MASTER_BEDROOM', sessionId='')
[DEBUG:2020-04-10 18:35:11,940] rhasspyserver_hermes: Publishing 28 bytes(s) to rhasspy/handle/toggleOn
[DEBUG:2020-04-10 18:35:11,939] rhasspyserver_hermes: -> HandleToggleOn(siteId='MASTER_BEDROOM')
[DEBUG:2020-04-10 18:35:11,937] rhasspyserver_hermes: Sent 239 char(s) to websocket
[DEBUG:2020-04-10 18:35:11,933] rhasspyserver_hermes: Handling NluIntent (topic=hermes/intent/GetTime, id=451b4706-5365-484b-b726-cdca3b86a1fe)
[DEBUG:2020-04-10 18:35:11,933] rhasspyserver_hermes: <- NluIntent(input='what time is it', intent=Intent(intentName='GetTime', confidenceScore=1.0), slots=[], id='70de14b7-7d48-40bd-9e66-37cd10e04ad3', siteId='MASTER_BEDROOM', sessionId='70de14b7-7d48-40bd-9e66-37cd10e04ad3', customData='', asrTokens=['what', 'time', 'is', 'it'], asrConfidence=1.0, wakewordId='', rawAsrTokens=['what', 'time', 'is', 'it'])
[DEBUG:2020-04-10 18:35:11,745] rhasspyserver_hermes: Publishing 195 bytes(s) to hermes/nlu/query
[DEBUG:2020-04-10 18:35:11,744] rhasspyserver_hermes: -> NluQuery(input='what time is it', intentFilter=None, id='70de14b7-7d48-40bd-9e66-37cd10e04ad3', siteId='MASTER_BEDROOM', sessionId='70de14b7-7d48-40bd-9e66-37cd10e04ad3', wakewordId='')
[DEBUG:2020-04-10 18:35:11,743] rhasspyserver_hermes: Publishing 28 bytes(s) to rhasspy/handle/toggleOff
[DEBUG:2020-04-10 18:35:11,743] rhasspyserver_hermes: -> HandleToggleOff(siteId='MASTER_BEDROOM')
Hello,
I finally managed to get the satellite site_id whithin hass.io
trigger.event.data._intent.siteId
What i don’t understand is how to send tts to the correct satellite who started the wakeword?
In configuration.yaml I have m
rest_command:
rhasspy_speak:
url: 'http://192.168.1.106:13202/api/text-to-speech'
method: 'POST'
payload: '{{ payload }}'
headers: content_type: 'text/plain'
This one is only good if i have 1 satellite.
How to change it so it can send automatically to the correct one when I have multiple satellites?
I can only help with MQTT, there it is working.
If you shoot for instaance
{“text”: “First satellite”, “siteId”: “hubdmk”, “lang”: null, “id”: “400a55c4-852f-4269-a444-67c16bcac307”, “sessionId”: “”} onto the MQTT-Server at topic hermes/tts/say - the text is spoken at the satellite named hubdmk.
If you shoot for instance the JSON
{“text”: “Different Satellite”, “siteId”: “satez”, “lang”: null, “id”: “400a55c4-852f-4269-a444-67c16bcac309”, “sessionId”: “”} onto the MQTT-Server at topic hermes/tts/say - the text is spoken at the satellite named satez.
Just tried at my test suite, for me this is working.
I use 2.5-pre, venv installation.
HTH
BR
Martin
Thank you.
I’m using the internal MQTT and sent events to hass from the satellite as describes in this page: https://rhasspy.github.io/rhasspy-voltron/tutorials.html#remote-http-server.
Can you give me an example how exactly you do it your way?
How do you shoot
{“text”: “First satellite”, “siteId”: “ hubdmk ”, “lang”: null, “id”: “400a55c4-852f-4269-a444-67c16bcac307”, “sessionId”: “”} onto the MQTT-Server at topic hermes/tts/say?
I switched to HASS MQTT
my satellite is configured like this
Intent handling is set to “Send events to Home Assistant (/api/events)”
my server is configured like this
Events fire the specific automation in hass
#Get Current Time
- id: '100'
alias: GetTime
description: 'Current Time'
trigger:
- event_data: {}
event_type: rhasspy_GetTime
platform: event
condition: []
action:
- alias: ''
data_template:
payload: The time is {{ now().hour }} {{ now().minute }}
service: rest_command.rhasspy_speak
In conf.yaml I have:
rest_command:
rhasspy_speak:
url: 'http://192.168.1.101:12101/api/text-to-speech'
method: 'POST'
payload: '{{ payload }}'
headers:
content_type: 'text/plain'
the problem is that tts play on the server and not in the satellite
here’s how i do it:
rest_command:
tts:
url: 'http://192.168.1.101:12101/api/text-to-speech?siteId={{site}}'
method: POST
payload: '{{ payload }}'
headers:
content_type: 'text/plain'
and in my intents:
GetTime:
action:
- service: 'rest_command.tts'
data_template:
payload: '{{ now().hour }} heure {{ now().minute }} '
site: '{{ site_id }}'
Thanks, i will try this
Thanks, works as a charm.
I have another question: intent handling with home assistant has 2 options:
- Send events to Home Assistant
- Send intents to Home Assistant
Right now i’m using events, but i understand that you are using intents.
Which method is more efficient?
well… dont really know
according to rhasspy docs:
More recent versions of Home Assistant can accept intents directly.
so i supposed this was the best option
but the intent handling in 2.5pre seems broken soi just disabled the intent handling from rhasspy and added
snips:
in homeassistant’s configuration.yalm wich enables the mqttt/hermes protocol
Thanks to snippets of information in this thread and elsewhere on the forums I have managed to get 2.5.0 pre to invoke tts on the original sending satellite using the site ID from the Event Data sent to home assistant as per the originally posed question.
I am using Events as opposed to Intents. The master/satellite as per Voltron Tutorial ‘server and satellites’.
I use a rest command in a rest_commands.yaml file.
The following gets the humidity value from a sensor in the bathroom.
**Automation trigger:-**
event_data:
room_name: bathroom
event_type: rhasspy_GetHumidity
platform: event
**Automation Action:-**
data_template:
payload_data: |
{% set response %}
{% set the_humid = states('sensor.lumi_lumi_weather_2650d403_humidity') %}
the humidity is {{ the_humid }} percent
{% endset %} {{ response }}
site: '{{ trigger.event.data._intent.siteId }}'
service: rest_command.rhasspy_speak_site
**rest command from my rest_commands.yaml**
rhasspy_speak_site:
url: 'http://192.168.1.42:12101/api/text-to-speech?siteId={{ site }}'
method: 'POST'
headers:
accept: 'text/plain'
Content-Type: 'text/plain'
payload: '{{ payload_data }}'