Sorry for the late reply, here is how I get automated weather voice alerts with google home, this has worked reliably and is a nice feature. I am not a programmer so you can make this work if you understand how to IMPORT the code into Node Red, and how to edit the homeassistant script to change your EC weather station and google home speaker names and IPs.
- I have 4 scripts in the scripts.yaml file in my homeassistant. One for warnings, watches, advisories, and one for statements. I also included 2 extra scripts I use when I speak to google that I want the forecast or the temperature and UV outside. It will tell me also my garage temp and humidity (make sure tools wont rust in garage, etc) but you will need your own garage sensors to add that feature.
weather_warning_tts:
alias: weather warning tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.55
- service: tts.google_translate_say
entity_id:
- media_player.hallway_speaker
data_template:
message: '{{ state_attr(''sensor.saskatoon_warnings'',''alert_1'') }} in effect.
{{ state_attr(''sensor.saskatoon_warnings'',''alert_1'') }}'
- delay: 00:00:10
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
weather_advisory_tts:
alias: weather advisory tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
- service: tts.google_translate_say
entity_id: media_player.hallway_speaker
data_template:
message: '{{ state_attr(''sensor.saskatoon_advisories'', ''alert_1'') }} in
effect. {{ state_attr(''sensor.saskatoon_advisories'', ''alert_1'') }}'
- delay: 00:00:12
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
weather_watch_tts:
alias: weather watch tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.45
- service: tts.google_translate_say
entity_id: media_player.hallway_speaker
data_template:
message: '{{ state_attr(''sensor.saskatoon_watches'',''alert_1'') }} in effect.
{{ state_attr(''sensor.saskatoon_watches'',''alert_1'') }}'
- delay: 00:00:10
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
weather_statement_tts:
alias: weather statement tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.35
- service: tts.google_translate_say
entity_id:
- media_player.hallway_speaker
data_template:
message: '{{ state_attr(''sensor.saskatoon_statements'',''alert_1'') }} in effect.
{{ state_attr(''sensor.saskatoon_statements'',''alert_1'') }}'
- delay: 00:00:12
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
weather_forecast_tts:
alias: weather forecast tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.6
- service: tts.google_translate_say
entity_id:
- media_player.hallway_speaker
data_template:
message: 'Hello, the Temperature outdoors is {{states(''sensor.saskatoon_temperature'')}} And.
{{ states(''sensor.saskatoon_summary'') }} . . . pow. the garage temperature
is {{ states(''sensor.garage_temperature'') }} . degrees and the garage humidity
is {{ states(''sensor.garage_humidity'') }} percent. pow. The Temperature
outdoors is {{states(''sensor.saskatoon_temperature'')}} '
- delay: 00:00:25
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
hallway_weather_tts:
alias: hallway weather tts
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.4
- service: tts.google_translate_say
entity_id: media_player.hallway_speaker
data_template:
message: Hello, the Temperature outdoors is {{states('sensor.saskatoon_temperature')}} And.
{{ states('sensor.saskatoon_forecast') }} . . . pow. the garage temperature
is {{ states('sensor.garage_temperature') }} . degrees and the garage humidity
is {{ states('sensor.garage_humidity') }} percent. pow. The chance of precipitation
is {{states('sensor.saskatoon_chance_of_precip')}}. The Temperature outdoors
is {{states('sensor.saskatoon_temperature')}} And. UV level {{states('sensor.saskatoon_uv_index')}}
- delay: 00:00:30
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
talk_temp_all:
alias: temperature
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
- service: tts.google_translate_say
entity_id: media_player.hallway_speaker
data_template:
message: Temperature outdoor is {{states('sensor.saskatoon_temperature')}} And.
UV level {{states('sensor.saskatoon_uv_index')}} .The garage temperature is
{{states('sensor.garage_temperature')}} . The temperature upstairs is {{states('sensor.upstairstemp')}}.
The temperature outdoor is {{states('sensor.saskatoon_temperature')}}
cache: false
- delay: 00:00:12
- service: media_player.volume_set
data_template:
entity_id: media_player.hallway_speaker
volume_level: 0.5
- I use Node Red addon to activate the scripts when the EC weather addonâs sensors get important data that I would want to know
[{"id":"a47c00b2.158fc","type":"server-state-changed","z":"b60fe273.ae36d","name":"","server":"96168c927d5e6e27","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.saskatoon_warnings","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is_not","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":480,"wires":[["ac6d84bb.efb848","3877a35.1611e5c"]]},{"id":"16f3bd5.2e41243","type":"api-call-service","z":"b60fe273.ae36d","name":"Run weather warning script","server":"96168c927d5e6e27","version":5,"debugenabled":false,"domain":"script","service":"weather_warning_tts","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":480,"wires":[[]]},{"id":"34482325.087aec","type":"server-state-changed","z":"b60fe273.ae36d","name":"","server":"96168c927d5e6e27","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.saskatoon_watches","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is_not","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":200,"y":540,"wires":[["7dad6655.08cd08"]]},{"id":"af557bbb.97d918","type":"api-call-service","z":"b60fe273.ae36d","name":"Run weather watch script","server":"96168c927d5e6e27","version":5,"domain":"script","service":"weather_watch_tts","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":540,"wires":[[]]},{"id":"30ea0955.c74826","type":"server-state-changed","z":"b60fe273.ae36d","name":"","server":"96168c927d5e6e27","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.saskatoon_advisories","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is_not","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":600,"wires":[["6379c4e8.9c1c6c"]]},{"id":"fd3b12ce.bc671","type":"api-call-service","z":"b60fe273.ae36d","name":"Run weather advisory script","server":"96168c927d5e6e27","version":5,"domain":"script","service":"weather_advisory_tts","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":600,"wires":[[]]},{"id":"ac6d84bb.efb848","type":"switch","z":"b60fe273.ae36d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":520,"wires":[["a9a25d89.f2a42","16f3bd5.2e41243"],[]]},{"id":"7dad6655.08cd08","type":"switch","z":"b60fe273.ae36d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":560,"wires":[["af557bbb.97d918"],[]]},{"id":"6379c4e8.9c1c6c","type":"switch","z":"b60fe273.ae36d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":600,"wires":[["fd3b12ce.bc671"],[]]},{"id":"3877a35.1611e5c","type":"debug","z":"b60fe273.ae36d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":420,"y":420,"wires":[]},{"id":"a9a25d89.f2a42","type":"debug","z":"b60fe273.ae36d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":630,"y":420,"wires":[]},{"id":"806ea34a.a0f9a","type":"inject","z":"b60fe273.ae36d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"123 test test test. di i i i i i iiiiiii ck","payloadType":"str","x":250,"y":440,"wires":[["ac6d84bb.efb848"]]},{"id":"7fe8f99de7a4fd14","type":"server-state-changed","z":"b60fe273.ae36d","name":"","server":"96168c927d5e6e27","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.saskatoon_statements","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is_not","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":660,"wires":[["6b05c17ad480f252"]]},{"id":"f6f92add26b44c6b","type":"api-call-service","z":"b60fe273.ae36d","name":"Run weather statement script","server":"96168c927d5e6e27","version":5,"debugenabled":false,"domain":"script","service":"weather_statement_tts","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":660,"wires":[[]]},{"id":"6b05c17ad480f252","type":"switch","z":"b60fe273.ae36d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":660,"wires":[["f6f92add26b44c6b"],[]]},{"id":"ec311e4182310cec","type":"comment","z":"b60fe273.ae36d","name":"Spoken Weather Danger Info","info":"","x":120,"y":400,"wires":[]},{"id":"96168c927d5e6e27","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"559","areaSelector":"friendlyName","deviceSelector":"id","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
- I use Node Red also to make my google speakers tell me when there is precipitation so I can close windows or bring things inside. The data from Env Canada is not that accurate here but it still helps alert me.
[{"id":"44ec5cf1.4bbae4","type":"switch","z":"b60fe273.ae36d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Snow","vt":"str"},{"t":"cont","v":"Sleet","vt":"str"},{"t":"cont","v":"Hail","vt":"str"},{"t":"cont","v":"Precipitation","vt":"str"},{"t":"cont","v":"storm","vt":"str"},{"t":"cont","v":"Rain","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":7,"x":330,"y":1060,"wires":[["6f4b5c05.353244","1c52ce37.d8a2c2"],["6f4b5c05.353244","1c52ce37.d8a2c2"],["6f4b5c05.353244","1c52ce37.d8a2c2"],["6f4b5c05.353244","1c52ce37.d8a2c2"],["1c52ce37.d8a2c2","6f4b5c05.353244"],["6f4b5c05.353244","1c52ce37.d8a2c2"],["380b9508.c3eaaa"]]},{"id":"380b9508.c3eaaa","type":"debug","z":"b60fe273.ae36d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":530,"y":1080,"wires":[]},{"id":"fdea9ad7.1a82a8","type":"cast-to-client","z":"b60fe273.ae36d","name":"Hallway TTS","url":"","contentType":"","message":"","language":"en","ip":"10.0.2.18","port":"","volume":"60","x":790,"y":980,"wires":[[]]},{"id":"6f4b5c05.353244","type":"function","z":"b60fe273.ae36d","name":"add \"pow\" for truncated TTS","func":"msg.payload = (\" precipitation alert\" + msg.payload + \" \") ;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":980,"wires":[["fdea9ad7.1a82a8"]]},{"id":"12f9ca71.bf3916","type":"function","z":"b60fe273.ae36d","name":"Create message content","func":"msg.payload=\"Light snow\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":980,"wires":[["6f4b5c05.353244"]]},{"id":"b5bb995a.a0fd88","type":"inject","z":"b60fe273.ae36d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":980,"wires":[["12f9ca71.bf3916"]]},{"id":"1c52ce37.d8a2c2","type":"debug","z":"b60fe273.ae36d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":550,"y":1020,"wires":[]},{"id":"aecd8288.4fda8","type":"server-state-changed","z":"b60fe273.ae36d","name":"Precipitation","server":"96168c927d5e6e27","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.saskatoon_current_condition","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is_not","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":1040,"wires":[["44ec5cf1.4bbae4"]]},{"id":"88a88b45.fd5278","type":"inject","z":"b60fe273.ae36d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Thunderstorm","payloadType":"str","x":170,"y":1100,"wires":[["44ec5cf1.4bbae4"]]},{"id":"db35137423196fe6","type":"comment","z":"b60fe273.ae36d","name":"Spoken Precipitation Info","info":"","x":110,"y":940,"wires":[]},{"id":"96168c927d5e6e27","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"559","areaSelector":"friendlyName","deviceSelector":"id","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
I noticed ppl discussing that it is possible to have more than 1 alert simultaneously. I did not add anything for more than 1 alert and hopefully it wont be relevant. I mostly needed the voice alerts for tornado warnings and real time precipitation alerts and this works.