Simple "Tell me today's weather forecast"

Hi Everyone,
Thought I’d share my latest success with Rhasspy & HA. It is a simple “tell me today’s weather” that uses an intent script, and the Home Assistant National Weather Service (NWS) integration. I’m a beginner, so the really challenging part was getting the correct YAML to parse out the sensor data, but it seems to have been working well, and I wanted to share with the community to give something back.

First, install the NWS integration as per HA docs:


Second, make sure you have the “snips” integration included in your configuration.yaml:
snips:
Third, create your sentences in Rhasspy and train Rhasspy:
[GetWeather]
what’s the weather forecast
what is the weather forecast
weather forecast please
tell me the weather forecast
tell me today’s weather
what will the weather be like today
what will the weather be today
Fourth, add this intent to either your configuration.yaml:
intent:
  GetWeather:  # Intent type
    action:
    - service: mqtt.publish
      data_template:
        topic: hermes/tts/say
        payload_template: '{"text": "{{(states.weather.khaf_daynight.attributes.forecast[0].detailed_description)}}", "siteId": "default", "lang": null, "id": "", "sessionId": "", "volume": 1.0}'

Restart HA, and then ask Rhasspy, “what’s the weather” for the day’s forecast!

5 Likes