Looks like your Home Assistant URL is empty. Make sure to check the Settings page.
Iâve been playing around with Node-Red, and it works quite well with Rhasspy through MQTT (receiving intents) and HTTP (via the HTTP API). Iâm adding a /api/text-to-speech
end-point to Rhasspy in an upcoming version so youâll be able to have Rhasspy speak at the end of a Node-Red flow.
I admit I didnât dive at all into Rhasspy structure and donât know if it as already doable, but couldnât this /api/text-to-speech
end-point feature open the possibililty of decentralized clients in different rooms to listen for speech commands and talk to a âcentral Rhasspy brainâ ?
This is actually possible right now with the api/speech-to-intent
endpoint. POST-ing some WAV data to this endpoint will cause Rhasspy to process it as a voice command (and send it to Home Assistant).
This has to be some kind of bug, because everything looks good with your settings. Have you made sure to restart Rhasspy since you changed the Home Assistant URL?
Wow, Iâve never seen that error before. Was there anything in your Home Assistant logs? Maybe it got the connection, but closed it for some reason?
I just moved into the package
homeassistant:
customize:
package.rhasspy:
customize: &customize
package: 'rhasspy'
exposed: &exposed
<<: *customize
emulated_hue_hidden: true
homebridge_hidden: false
not_exposed: ¬_exposed
<<: *customize
emulated_hue_hidden: false
homebridge_hidden: true
hidden: &hidden
<<: *customize
hidden: true
#################################################################
##group
#################################################################
group:
rhasspy:
control: hidden
name: rhasspy
entities:
- group.rhasspy
##################################################################
#switch
##################################################################
switch:
- platform: command_line
switches:
living_room_lamp:
command_on: âecho âLiving room lamp ONââ
command_off: âecho âLiving room lamp OFFââ
garage_light:
command_on: âecho âGarage light ONââ
command_off: âecho âGarage light OFFââ
##################################################################
#sensor:
##################################################################
sensor:
- platform: command_line
name: LVR Temperature
unit_of_measurement: â°Câ
command: âdate +%Sâ
##################################################################
#input_boolean
##################################################################
input_boolean:
rhasspy:
name: rhasspy
initial: off
##################################################################
#automation
##################################################################
automation:
-
alias: âTurn living room lamp on/offâ
trigger:
platform: event
event_type: rhasspy_ChangeLightState
event_data:
name: âliving room lampâ
action:
service_template: âswitch.turn_{{ trigger.event.data[âstateâ] }}â
data:
entity_id: switch.living_room_lamp -
alias: âTurn garage light on/offâ
trigger:
platform: event
event_type: rhasspy_ChangeLightState
event_data:
name: âgarage lightâ
action:
service_template: âswitch.turn_{{ trigger.event.data[âstateâ] }}â
data:
entity_id: switch.garage_light -
alias: âTurn bedroom light onâ
trigger:
platform: event
event_type: rhasspy_ChangeLightState
event_data:
name: âbedroom lightâ
state: âonâ
action:
service: mqtt.publish
data_template:
topic: âbedroom_light/setâ
payload: âon,255,255,255â -
alias: âTurn bedroom light offâ
trigger:
platform: event
event_type: rhasspy_ChangeLightState
event_data:
name: âbedroom lightâ
state: âoffâ
action:
service: mqtt.publish
data_template:
topic: âbedroom_light/setâ
payload: âoff,0,0,0â -
alias: âSay garage open/closedâ
trigger:
platform: event
event_type: rhasspy_GetGarageState
action:
service: tts.picotts_say
data_template:
message: >
{% if is_state(âbinary_sensor.garage_doorâ, âoffâ) %}
The garage door is closed.
{% else %}
The garage door is open.
{% endif %} -
alias: âSay the timeâ
trigger:
platform: event
event_type: rhasspy_GetTime
action:
service: tts.picotts_say
data_template:
message: âIt is {{ now().strftime(â%Iâ) | int }} {{ now().strftime(â%M %pâ) }}.â -
alias: âSay the LVR Temperatureâ
trigger:
platform: event
event_type: rhasspy_GetTemperature
action:
service: tts.picotts_say
data_template:
message: âIt is {{ states(âsensor.LVR Temperatureâ) }} degrees.â -
alias: âSet bedroom light color (red)â
trigger:
platform: event
event_type: rhasspy_ChangeLightColor
event_data:
name: âbedroom lightâ
color: âredâ
action:
service: mqtt.publish
data:
topic: âbedroom_light/setâ
payload: âon,255,0,0â -
alias: âSet bedroom light color (green)â
trigger:
platform: event
event_type: rhasspy_ChangeLightColor
event_data:
name: âbedroom lightâ
color: âgreenâ
action:
service: mqtt.publish
data:
topic: âbedroom_light/setâ
payload: âon,0,255,0â -
alias: âSet bedroom light color (blue)â
trigger:
platform: event
event_type: rhasspy_ChangeLightColor
event_data:
name: âbedroom lightâ
color: âblueâ
action:
service: mqtt.publish
data:
topic: âbedroom_light/setâ
payload: âon,0,0,255â -
alias: Light voice command (rhasspy)
trigger:
platform: event
event_type: rhasspy_ChangeLightState
action:
service_template: >
{% if trigger.event.data[âcommandâ] == âaccendiâ %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
data_template:
entity_id: âlight.{{ trigger.event.data[ânameâ] }}_{{ trigger.event.data[âroomâ] }}â
Thank you very much for your work on this. I could make it to work in a straightforward way. Still working in a Pi3 that I had laying around for testing purposes.
But I could not find in the docs anything about changing brightness of a light.
How it can be done?
I noticed that after some minutes, it stops from accepting the wake word. I canât understand the reason, So I had to restart it, then it works for some minutes more.
I am using:
Rpi3 + HASSIO 0.90.2
USB dongle with a microphone attached (blue chinese dongle)
Instaled Rhasspy Assistant only (Okay Rhasspy wake word)
I appreciate any help on this.
I have some more questions⌠Sorry, I am new to it and I am having many doubtsâŚ
What if I want to request a temperature from another sensor?
How can I use GetTemperature intent from another sensor?
And if I want to request the weather? Is it possible?
Thanks!
If you want to create a weather request, you should have some application to respond to your question.
Rhasspy only handle the Sppecht To Text and publishes intents to Hassio.
Your Hassio will need to handle those intents, which can be done in several ways.
Sure, but I was meaning to request in a natural way. Something like âHow is the weather today?â, âHow will be the weather tomorrow?â.
I know I can do it with âTurn on the weatherâ, but it is not natural.
Sorry if there is something that I misunderstood, but Rhasspy is really new for.me. Thanks!
This is actually a situation where Rhasspy shines You can add any new voice commands youâd like in Sentences tab of the web interface. For your situation, Iâd probably add a GetWeather
intent with a few sentences like this:
[GetWeather]
how is the weather (today){when}
how will the weather be (tomorrow){when}
Make sure to re-train Rhasspy after saving your new sentences. Now, when you say âhow is the weather todayâ, Rhasspy will send Home Assistant a rhasspy_GetWeather
event with a when
property set to today
. You will need to catch this event in one of your Home Assistant automations, and (Iâm guessing) look up the appropriate information in your weather sensor to send to your tts component. My garage door example does this when handling a rhasspy_GetGarageState
event.
If you get this working, Iâd be interested in adding it as an example in the default Rhasspy install.
The wake word is still a weak point for Rhasspy. If you have a regular Rpi3 (not the B+), you might give the snowboy system a try instead of the default pocketsphinx one.
If you happen to have some external wake word system that works well for you, you can always integrate it with Rhasspy by just doing an HTTP POST to /api/listen-for-command
to wake Rhasspy up and have it start listening. Another option is using MQTT.
Could you try re-creating your authentication token in Home Assistant and updating it in Rhasspy? I canât think of any other reason that Home Assistant would just disconnect like that.
Great! I will digest the information and bring back my findings.
Thank for your help.
Both worked like a charm. Thanks!