Environment Canada integration - 2021.11 onwards

If you are interested in placing Environment Canada warnings, etc on your dashboard this bit of code may be interesting. The code requires editing for your weather entities, and as written supports up to 2 alerts in each category (warnings, watches, etc).

Place the following in a Markdown card:

{% set entities = [
  'error;sensor.ottawa_kanata_orleans_warnings',
  'warning;sensor.ottawa_kanata_orleans_watches',
  'info;sensor.ottawa_kanata_orleans_advisory',
  'info;sensor.ottawa_kanata_orleans_statements',
  'success;sensor.ottawa_kanata_orleans_endings'
] %}
{% for item in entities %}
  {% set level, entity = item.split(';') %}
  {% for i in ['1', '2'] %}
    {% set alert = state_attr(entity, 'alert_' + i) %}
    {% if alert %}
      {% set ts = strptime(state_attr(entity, 'alert_time_1'), '%A %B %d, %Y at %H:%M %Z') | relative_time %}
{{ '<ha-alert alert-type="%s">Environment Canada: <a href="https://weather.gc.ca/warnings/report_e.html?on41">%s</a> (%s ago)</ha-alert>' % (level, alert, ts) }}
    {% endif %}
  {% endfor %}
{% endfor %}

The link to the EC warnings is hardcoded and also needs to be changed for your station.

If there are no alerts then the card will be empty. You could place the markdown card inside a conditional card if you want it to appear only when there are alerts.

Here is what the Ottawa markdown card looks like at the moment (yah, its a crappy summer day!):

Enjoy!

4 Likes

I live near Pitt Meadows Airport in BC, which has a full time Environment Canada weather station. However, the weather forecast used for it Pitt Meadows, BC - 7 Day Forecast - Environment Canada is the exact same as the one for Vancouver Airport Vancouver, BC - 7 Day Forecast - Environment Canada .

Although the temperature reported for Pitt Meadows is accurate, the forecast is not. Because it’s warmer inland in the summer by three to five degrees than by the ocean, I end up with the wrong data in Home Assistant. The text forecast below the table will indicate “High 27 except 31 inland” but for some reason EC insists on reporting things this way. So I get the forecast values from the table and not the “except inland” temperature which is the correct one.

There are other weather forecasts which do similar things like St. John’s for example, since the forecast area is really large covering micro climates. Or Halifax-Shearwater which today reports a “High 27 except 22 along parts of the coast”

Is it possible to address this with the EC integration somehow so it works properly? I would prefer to continue to use the EC integration rather than Accuweather and it’s API call limits, but I may have to resort to that at least for summer months.

I want the correct forecast daily high temperature so I can issue reminders to close windows and turn on the air conditioning because if we don’t do that early in the morning, the house turns into an oven and the cooling can’t recover the heat soaked house.

2 Likes

Thanks, I hadn’t seen this before. It should be possible to configure a template sensor that extracts the inland temperature from the current day’s text forecast. I’ll take a crack at this and get back to you.

<works feverishly...>

Done!

Configuration snippet:

template:
  - sensor:
      - name: "Inland temperature"
        unit_of_measurement: "°C"
        state: >
          {{ states('sensor.vancouver_summary') | regex_findall(find='High \d. except (\d.) inland') | first }}

You should be able to use a similar pattern for the humidex as well. Let me know if you have any trouble.

1 Like

Hi folks, thanks for all of your hard work on this integration @gwww and @michaeldavie

I’ve read through all of this and the related threads, but I can’t seem to find anything about the radar entities not working, however, I can’t figure out how to get them to work on my end. They just always show as unavailable after the integration. Am I missing something? Thanks!

I assume that you enabled radar. By default it’s disabled when you add the EC integration.

Radar is not available in all regions. So that is one possible answer. What region are you using?

What version of HA are you using?

I’m on the most up to date version of HA (Core: 2022.8.6; Supervisor: 2022.08.03; OS: 8.5).

When I added the EC integration (I’ve tried both Toronto and Toronto Island), there was never an option for enabling radar, only places to add the Weather Station ID and/or latitude and longitude, and the option to select English or French.

I read the EC integration page and saw the section about choosing the radar_type, but there wasn’t any other documentation about getting the camera entity to work, nor about some regions not having radar available.

Here are the codes, I’ve used:

Codes English Names Province Codes Latitude Longitude
s0000458 Toronto ON 43.74N 79.37W
s0000785 Toronto Island ON 43.63N 79.37W

Do you know if there is any way that I might be able to figure out in advance which regions do have active radar/cameras? If in fact the reason that the radar entity is unavailable for me right now is because neither of the two I’ve loaded (Toronto and Toronto Island) have radar/cameras available, I’d like to try adding a region that does have cameras, but I don’t see any way to find this information out


The radar images for the camera integration are built using the same data as the Environment Canada page:

https://weather.gc.ca/map_e.html?layers=radar&zoom=-1&center=43.74,-79.37

If you zoom out there you can see the overall coverage.

Hmmm, well that’s what I find confusing - Toronto most certainly is covered by the Environment Canada coverage area. It’s just that when I add the Toronto or Toronto Island stations, the radar entity for either shows as unavailable. For what it’s worth the entities called Hourly forecast also show as unavailable for both services.

Well, now I feel like an idiot - I didn’t realize that it was as simple as going into the service, clicking on the radar entity, going to Advanced settings and selecting Enabled. I’d made the incorrect assumption that the entity status being listed as unavailable meant that it wasn’t working upstream for some reason, not that it was just disabled by default.

It might be worth clarifying this a bit in the Environment Canada integration documentation. I did see where the documentation says - “Note that many of the entities are disabled by default” - but I guess I over-complicated things in my head and assumed that there was a problem upstream with the EC radar cameras, since I’d periodically run into problems accessing the feeds from some of the Canadian radar stations via Weather Underground in the past. When @gwww asked whether I’d enabled the radar, I mistakenly thought he meant that there should have been an option to enable the radar during the initial configuration of the integration, when you select the Weather station ID and language
 Anyway, it’s fixed now. I might create a PR to make this process a little more explicit in the documentation, if that makes sense to you all.

1 Like

That would be great, since it would help others from running into the same issue.

I’m glad, I’m not the only one :slight_smile: .I reinstalled the integration to troubleshoot something else and could not get the radar working again. I was just about to restore my backups. Thanks for that.

I would like to connect a roof heating cable to Home assistant switch so that when it ACTUALY snow per environment canada in my area it would trigger it ON for say 2 hours . I did that manualy last year but would find it convenient if that is possible. NoteI have environment canada integration properly installed with report for my location but have no clue how to use it . Thanks for reply.

Hey folks, I updated the Environment Canada docs to include descriptions of the entities that are disabled by default. Actually, it was already there. It editorialized it to hopefully make it stand out more.

I also add a pointer to where you can get raw data to look at – for when you say “hey, why is this sensor missing”. We operate on the same raw data that Environment Canada gives us.

Last thing, 2022.11 (most probably) will have a “Download diagnostics” button on the integration page. You can use that to see what raw data that the integration has. There will be a reference to the diagnostics in the docs once the pull request is accepted.

The goal of the improvements is to reduce the confusion (and hence questions) around “where’s my entity” and “why is sensor not showing up”.

If after reading the docs you believe that they can be improved further you have a couple of options. Tell us here. Be specific and suggesting new text is appreciated. The other option is get a Github account and update the docs yourself. Both @michaeldavie and myself will see the update and one of us will have to approve it.

I hope this helps!

2 Likes

If you’ve been experiencing intermittent timeouts the past few days, this has been confirmed as an issue on Environment Canada’s end. The issue is being tracked at the link below.

1 Like

I added 'info;sensor.ottawa_kanata_orleans_statements' to the list to also get Special Weather Statements displayed on the card.

1 Like

Good catch! Thank you!

1 Like

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.

  1. 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

  1. 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}]
  1. 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.

2 Likes

Is it be possible to read a sensor for water level (river) from environment canada?

I did build this capability into the env_canada Python library, but it hasn’t been implemented as an HA sensor. You might be able to use an HTTP sensor to retrieve the value though. Take a look at the Python class linked below.