Reviewers needed: Environment Canada component with weather, sensor, and camera (radar) platforms

I’ve submitted my first major pull request, and I’d really appreciate it if more experienced contributors could spare a few minutes to review it.

It’s new code to leverage leverage Environment Canada weather data, and includes weather, sensor, and camera platforms, along with a simple component to pull them all together.
Thanks in advance!

How is the progress for this component going? Looking forward to its release.

It’s all running fine locally, but to be honest I’m a bit stuck on getting it merged into the project. A large part of this is my lack of familiarity with Git, but there’s also been a bit of back and forth about whether there should be a component or not. Thanks for your interest, and I’ll try to move it forward.

Thanks for the reply.

The core team has been quite busy with their October bug and tidy blitz. I sure hope they can give you some priority now at least for some kind of Alpha release…

I would be pleased to try it here and provide feedback. I run Hassio on a Pi3+ and pretty much push it to its limits. Could be a good test for the component’s tolerance to problems. I’m not sure that I’d give the camera component much priority but the individual sensors and weather aggregate would both get a real-world workout here.

You’ve done very well with a fairly steep learning curve from what I can gather of the GH chronology. Keep up the great work!

For the radar component i use the following and it works quite well with lovelace as well.


  • platform: generic


name: “Ottawa radar”

Hi Michael,

What’s happening with your component?
Can we download and install it separately while the Home Assistant team approves it?

I really want the environnement canada data as it is the only one I trust.

Best regards,

Sure, I’d love some feedback. Here’s what it looks like on my system (in Ottawa):


EDIT: See the updated post below

Here are the configs that I’m using as well:


  - platform: environment_canada

  - platform: environment_canada

  - platform: environment_canada
      - temperature
      - wind_chill
      - humidex
      - humidity
      - condition
      - wind_speed
      - wind_gust
      - wind_dir
      - high_temp
      - low_temp
      - pop
      - warning

    - name: Weather Alerts
      url:     <---Change to your location
      icon: mdi:weather-lightning-rainy


    view: yes
    icon: mdi:weather-partlycloudy
      - sensor.ec_warning
      - sensor.ec_humidex
      - sensor.ec_wind_chill
      - sensor.ec_high_temperature
      - sensor.ec_low_temperature
      - sensor.ec_chance_of_precip
      - group.weather_alerts
      - weather.ottawa_kanata_orleans   <---Change to your location
      - camera.franktown_radar          <---Change to your location

    name: ' '
      - weblink.weather_alerts


      friendly_name: Next High
      friendly_name: Overnight Low
      friendly_name: Humidex
      friendly_name: Wind Chill
      friendly_name: Chance of Precip.
      friendly_name: Warning

Hi Michael,

Thank you very much it is working very well.

I had some problems making the camera work at first but the log files & Google helped.

For those with problem with the camera, you need to install some package.

sudo apt-get install libatlas-base-dev libopenjp2-7

I’ll keep you updated if something happens.

Best regards,

1 Like

Awesome, I’m glad you like it. Let me know if you come across any other issues.

When I try to set up Environment Canada weather i get the following errors:

Platform not found: weather.environment_canada 
Platform not found: camera.environment_canada 
Platform not found: sensor.environment_canada

When checking my configuration.

i’m located in BC, so it’s not because I don’t live in Canada

Sorry, I could have been more clear about that. The components haven’t been merged in yet, so you need load them as custom components, or in the case of the sensor, sideload it.

The required files can be downloaded from the Dropbox link above, then the files need to be placed in the following folders:

Sensor: components/sensor
Weather: custom_components/weather
Camera: custom_components/camera

I hope that helps, but let me know if you have any more trouble.

I have not installed it yet but how does one specify the polling frequency?

I found this line in

from homeassistant.components.sensor.environment_canada import (
    ECData, get_station, validate_station,

Should I put a min_times_between_updates parameter in the config file? Are the units minutes or seconds?

The time between updates is not currently configurable in the config file, though I should probably make it that way. In the meantime, you can set it for both the sensor and weather components at line 40 of sesnor/, and for the camera at line 36 of its file. Both lines currently read:

MIN_TIME_BETWEEN_UPDATES = datetime.timedelta(minutes=10)

I’ve set it to 10 minutes as the (hard-coded) default as this seems to be the frequency of updates from Environment Canada.

I just found this and it’s something that I really want to implement.

I’m getting the 3 Platform not found messages

I am running my Home Assistant in docker.
I placed the camera and weather in my custom_components folder which is inside the config folder.
So my path for these two are ~/home-assistant/config/custom_components/camera and ~/home-assistant/config/custom_components/weather

For the sensor platform I placed that inside the ~/home-assistant/dep folder.
I don’t know if that is right as all my other sensors are located inside the docker container but I can’t for the life of me paste or copy file contents into the file I created (I deleted the empty file before creating the one in /dep)

Any ideas?

I’m running it in Docker too. I have my custom_components folder in the config root, with the camera and weather sub-folders underneath and the appropriate file in each. The sensor file is also in the config root (but could be anywhere) and is mapped in as a core component.

Here’s how I’m mapping things in as part of my docker run command:

    -v ~/home-assistant:/config \
    -v ~/home-assistant/ \

I hope that helps, but let me know if you’re still stuck.

I have this in my docker run aswell. I assumed this created the config folder in ~/home-assistant instead of it being in /usr/src/app/homeassistant/config, it looks like my assumption was correct :slight_smile:

For this one, is it basically saying the the file located in ~/home-assistant/ will appear (map) to be and be found in /usr/src/app/homeassistant/components/sensor/?
I’m a bit confused though on this one, you mentioned this file was in the config root. Is that the ~/home-assistant/ folder or the ~/home-assistant/config folder?

On the host, my config folder is located at ~/home-assistant. In the container, this is mapped to /config, i.e. it’s right off the root of the container file system. This folder is where the custom_components subfolder should be, and there isn’t a config subfolder below this.

It doesn’t matter where the sensor file is on the host (or what it’s called), but it needs to be mapped into /usr/src/app/homeassistant/components/sensor/ in the container, because the weather component relies on it being there.

I realize that this is a bit clunky, and I have a plan of how to address it, but haven’t been able to yet. Let me know if you’re still stuck.

Sorry I’m about 90% there on fully understanding this and it’s driving me in circles,

So you have ~/home-assistant/custom_components?

As long as it works I don’t mind the clunky :slight_smile: I just want to get it working…

That’s right, I have

So I used portainer and added the bind for the volume:

/home/bert/hassio/ to /components/sensor/

So in HA I now have a Weather Alerts card but I am also getting:

Entity not found: camera.franktown_radar
No state available for