Environment Canada integration - 2021.11 onwards

Thank you vey much. :+1:

Thanks for your work.

Hey folks, here is a status update on the state of the Environment Canada integration.

A PR was just merged and will show up in 2022.3 that is a breaking change. Simple summary is that alerts have changed format and a timestamp sensor was added. Iā€™ll let you read the PR notes and ask questions from there. Add SensorEntityClass support for Environment Canada integration by gwww Ā· Pull Request #58615 Ā· home-assistant/core Ā· GitHub.

Also in the same PR is converting the sensors to SensorEntityClass. This is not a breaking change. It does add the functionality that many of the sensors can be tracked in history. Look here Add SensorEntityClass support for Environment Canada integration by gwww Ā· Pull Request #58615 Ā· home-assistant/core Ā· GitHub for sensors described with StateClassEntity.MEASUREMENT for those that record history.

Upcoming changesā€¦ this PR Use _attr_ and add radar_type service for Environment Canada by gwww Ā· Pull Request #58657 Ā· home-assistant/core Ā· GitHub needs some rework. Its around selecting the radar type. Even though the PR is there, it is lower priority than the next item below.

Higher priority is to add back AQHI. PR to be written but is reasonably trivial. This PR was waiting for the sensor PR at the top of this note. I expect to submit that in the next couple of days.

One last note which we have not talked about recently. Radar entities were overwhelming the Environment Canada servers. We add a patch in early December to cache as many of the radar images as we could. This results in a 92% reduction in requests to the EC servers. Yeah!

Two requests to this group. If you are not using radar, please disable it in your configuration. If you are, really really, using radar, please make sure that you are running at least 2021.12 release of HA where the caching is turned on.

1 Like

Thanks for all your hard work!

1 Like

Great work with the caching functionality! Not only does it make life easier for ECā€™s servers and IT crew, but itā€™s significantly improved the load times of my dash.

1 Like

Hi everyone! a fellow Canadian here with a question that is burning me: Iā€™m trying to use this simple template {{ states("sensor.warnings") }} but it returns ā€œā€ (empty string)ā€¦ if I check the history, I can see that the current state is:
image
Can anyone help me out to understand why I get ā€œā€ (empty string) instead of ā€œExtreme Cold Warningā€? If I access this entity using python_scripts, I do get the correct value!!!

As long as the entity name is right that should work.

Hello, my camera displays nothing with the default integration parameters and with only the station ID. The color scale is displayed, but no satellite image. But you are right, the camera works fine when I also set the lat/lon coordinates.
Thankā€™s for your work, my Rhasspy voice system now tells me in french, the temperatures and "les previsions meteo !

The following does not explain your problem but here is config works and will work after a bug fix that might show in the March release.

Right now if station and coordinates are specified then station is used for weather and coordinates are used for radar. If only station is specified then coordinates from the station are used. If only coordinates are specified they are used for radar and to find the closest station for weather.

In the future the current plan is if both station and coordinates are specified then station will be used for weather (same as now) and the stationā€™s coordinates will be used for radar (instead of what was in in the config screen). This is proposed. Feedback appreciated! There is no change if only one of station or coordinates are specified.

Regardless of where we end up, this would be a good update to the docs.

As to the mostly blank radar, that usually occurs when Environment Canada doesnā€™t return radar data. It could be there is no radar data for the coordinates.

Hello and thanks for your answer, personnally I found out why my satellite map was not working by reading the forum and your comment about it. Since I could not find any documentation about it, I guess an easy fix would simply be to add a comment in the initial configuration section that station ID is required for weather and lon/lat are required for radar data. If there was a reason you kept these two separated to start with, I would say this a minor changeā€¦ Of course if you impose/request to add in both station ID and coordinates at initial configuration time, as I understand what you propose, then you would achieved the same result. Bye and have fun ! jrb.

Thanks for your replyā€¦ Something funny was going on with my HASS instanceā€¦ after reading your response I checked again and had the same issueā€¦ power cycled the server (using HassOS) and then it workedā€¦ cheers!

Hey folks, a couple more updates and a reminder on the request we asked of the group. Let me start with the request.

If you are not using radar please disable the entity. This will reduce the load on the Environment Canada servers. Thanks!

On to the updatesā€¦

AQHI is added back in and works as expected.

Radar being down will no longer block weather!

Both of those should show up in the March release.

What is left is to figure out the best approach to be able to switch radar between snow/rain and there is a small inconvenience (bug?) with the config flow where it will use the station for weather and the coordinates for AQHI and radar. It most notable when the station and the coordinates are not the same place and causes the possibility of getting a duplicate entity.

Both the above are low priority.

Thanks for the work that went into this integration. Iā€™m trying to set up some automations to notify us when weather alerts come up, but would like to be able to react based on the severity of the weather event (Tornado Warning vs Rainfall Warning). Can anyone point me to a list of the advisories, warnings, watches, and statements that EC uses in their messaging?

I hadnā€™t looked for this info before, but I believe that this is the list of alert types:

https://www.canada.ca/en/environment-climate-change/services/types-weather-forecasts-use/public/criteria-alerts.html

However, I wouldnā€™t recommend relying on Home Assistant for life-threatening alerts like tornado warnings. For that I would recommend push notifications via the WeatherCAN app:

https://www.canada.ca/en/environment-climate-change/services/weather-general-tools-resources/weathercan.html

2 Likes

Thank you for the link. I do have the WeatherCAN app installed, and I have a weather radio, this will be another layer for notifications. I want to try using HA to flash some lights to draw attention to a new alert. Iā€™ve found that I canā€™t rely on the weather radio, the reception from our local transmitter has dropped off and I no longer receive weekly tests or alerts. Several years ago we did have a tornado warning in our areaā€¦ we received thunderstorm warnings before and after the tornado warning via weather radio, but did not receive a tornado warning. I lost some faith in the weather radio service after that.

1 Like

You wouldnā€™t happen to have a handy link to a list of the weather icon values would you? I see the mapping in but I canā€™t find a list of what the icon numbers represent.

Thanks! I had already found that. I was actually looking for a list of what the icon numbers meant. The link in the code is dead. But I just did a search for current_conditions_icon_code_descriptions_e.csv and found someone that had it posted.

Here it is if anyone is curious.

current_conditions_icon_code_descriptions_e.csv

0,Sunny,Day Conditions Only
1,Mainly Sunny,Day Conditions Only
2,Partly Cloudy,Day Conditions Only
3,Mostly Cloudy,Day Conditions Only
6,Light Rain Shower,Day Conditions Only
7,Light Rain Shower and Flurries,Day Conditions Only
8,Light Flurries,Day Conditions Only
10,Cloudy,Day and Night Conditions
11,Precipitation,Day and Night Conditions
11,Squalls,Day and Night Conditions
11,Light Precipitation,Day and Night Conditions
11,Heavy Precipitation,Day and Night Conditions
12,Rain Shower,Day and Night Conditions
12,Light Rain and Drizzle,Day and Night Conditions
12,Light Rain,Day and Night Conditions
12,Rain,Day and Night Conditions
13,Rain and Drizzle,Day and Night Conditions
13,Rain Shower,Day and Night Conditions
13,Heavy Rain and Drizzle,Day and Night Conditions
13,Heavy Rain Shower,Day and Night Conditions
13,Heavy Rain,Day and Night Conditions
13,Rain,Day and Night Conditions
14,Light Freezing Drizzle,Day and Night Conditions
14,Light Freezing Rain,Day and Night Conditions
14,Heavy Freezing Drizzle,Day and Night Conditions
14,Heavy Freezing Rain,Day and Night Conditions
14,Freezing Drizzle,Day and Night Conditions
14,Freezing Rain,Day and Night Conditions
15,Rain and Flurries,Day and Night Conditions
15,Rain and Snow,Day and Night Conditions
15,Light Rain and Snow,Day and Night Conditions
15,Heavy Rain Shower and Flurries,Day and Night Conditions
15,Heavy Rain and Snow,Day and Night Conditions
16,Light Snow,Day and Night Conditions
16,Snow,Day and Night Conditions
17,Flurries,Day and Night Conditions
17,Heavy Flurries,Day and Night Conditions
17,Snow,Day and Night Conditions
18,Heavy Flurries,Day and Night Conditions
18,Heavy Snow,Day and Night Conditions
19,Thunderstorm with Rain,Day and Night Conditions
19,Thunderstorm with Heavy Rain,Day and Night Conditions
19,Thunderstorm with Light Rain,Day and Night Conditions
19,Thunderstorm with Rain,Day Conditions Only
19,Thunderstorm,Day Conditions Only
19,Heavy Thunderstorm with Rain,Day Conditions Only
19,Heavy Thunderstorm,Day Conditions Only
23,Haze,Day and Night Conditions
24,Fog,Day and Night Conditions
24,Ice Fog,Day and Night Conditions
24,Fog Patches,Day and Night Conditions
24,Shallow Fog,Day and Night Conditions
24,Mist,Day and Night Conditions
25,Drifting Snow,Day and Night Conditions
26,Ice Crystals,Day and Night Conditions
27,Snow Pellets,Day and Night Conditions
27,Ice Pellets,Day and Night Conditions
27,Hail,Day and Night Conditions
28,Snow Grains,Day and Night Conditions
28,Light Drizzle,Day and Night Conditions
28,Heavy Drizzle,Day and Night Conditions
28,Drizzle,Day and Night Conditions
30,Clear,Night Conditions Only
31,Mainly Clear,Night Conditions Only
32,Partly Cloudy,Night Conditions Only
33,Mostly Cloudy,Night Conditions Only
36,Light Rain Shower,Night Conditions Only
37,Light Rain Shower and Flurries,Night Conditions Only
38,Light Flurries,Night Conditions Only
39,Thunderstorm with Rain,Night Conditions Only
39,Thunderstorm,Night Conditions Only
39,Heavy Thunderstorm with Rain,Night Conditions Only
39,Heavy Thunderstorm,Night Conditions Only
40,Blowing Snow,Day and Night Conditions
41,Funnel Cloud,Day and Night Conditions
42,Tornado,Day and Night Conditions
43,Windy,Day and Night Conditions
44,Smoke,Day and Night Conditions
45,Dust Devils,Day and Night Conditions
45,Dust Storm,Day and Night Conditions
45,Volcanic Ash,Day and Night Conditions
45,Blowing Dust,Day and Night Conditions
45,Sandstorm,Day and Night Conditions
45,Drifting Dust,Day and Night Conditions
46,Thunderstorm with Hail,Day and Night Conditions
46,Heavy Thunderstorm with Hail,Day and Night Conditions
47,Thunderstorm with Blowing Dust,Day and Night Conditions
47,Thunderstorm with Dust Storm,Day and Night Conditions
48,Waterspout,Day and Night Conditions

1 Like

The icons themselves are also described at https://dd.weather.gc.ca/citypage_weather/docs/Current_Conditions_Icons-Icones_conditions_actuelles.pdf

To be clear, we donā€™t use the Environment Canada icons and instead map them to the HA icon set. The icon code is also provided as a sensor if youā€™d like to fetch it with a path like this: https://weather.gc.ca/weathericons/03.gif

1 Like

Cool! I just may be able to use those. Thanks!

I have a template weather entity that is a mix of envcan and my own weatherflow data. I was just trying to complete my own mapping for the current condition (Iā€™m just using the standard lovelace weather card). Picking them off one by one as they came up was getting irritating. :smile:

Your integration has been more reliable than Environment Canadaā€™s weather forecasting, so thanks!

(For the record, envcan is actually pretty good)