Hi Dave,
sessionEnded will be used as topic, when the session has ended
If you don’t end it by yourself, it will be ended after 30 seconds.
To end it in time, you should:
- Start the session with hotword
- Save the sessionID for that session (in NodeRed use a global variable)
- Mute the TV (hermes/dialogueManager/sessionStarted)
- Speak your sentence
- finish the session (hermes/dialogueManager/endSession)
- Unmute the TV (hermes/dialogueManager/sessionEnded)
hermes/dialogueManager/endSession
This will end the session, identified by the sessionID
topic: hermes/dialogueManager/endSession
payload{
"siteId": "{{siteId}}",
"text":"{{text}} ",
"sessionId":"{{sessionId}}"
}
with:
sitIeId: The Satellite, which started the session
sessionId: The saved SessonId from (above #2)
text: Optional text, that should be spoken
Here some examples for Homeassistant
Example 1: Event (DENON_mute, above #3 / #6)
- id: DENON_mute
alias: DENON_mute
trigger:
- platform: mqtt
topic: hermes/dialogueManager/sessionStarted
action:
- data_template:
is_volume_muted: true
entity_id: media_player.denon_avr_x2400h
service: media_player.volume_mute
mode: single
Example 2: Event (getTime, above #4)
id: 'rhasspy_GetTime'
alias: rhasspy_GetTime
trigger:
- platform: event
event_type: rhasspy_GetTime
action:
- service: script.turn_on
data_template:
entity_id: script.script_talk_to_satellite
variables:
siteId: >
{{trigger.event.data._intent.siteId}}
sessionId: >
{{trigger.event.data._intent.sessionId}}
text: >
Es ist {{ now().strftime('%H : %Mh') }}
mode: single
The script to finish session: (above #5)
script_talk_to_satellite:
alias: script_talk_to_satellite
sequence:
- service: mqtt.publish
data_template:
topic: hermes/dialogueManager/endSession
payload_template: >
{
"siteId": "{{siteId}}",
"text":"{{text}} ",
"sessionId":"{{sessionId}}"
}
In Nodered:
Example to get relevant Infos
- use a mqtt In-Node to get Slots, Intent-name, SessionId
- save the SessionId
- do the Indent-Handling (+ create the Answer)
- use a mqtt Out-node to finish Session and say answer
I hope , that helps.