Environment Canada integration - 2021.11 onwards

Have same issue as well. Only radar works

Unexpected error fetching environment_canada weather data: Weather update failed; no timestamp found

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/environment_canada/__init__.py", line 117, in _async_update_data
    await self.ec_data.update()
  File "/usr/local/lib/python3.10/site-packages/env_canada/ec_weather.py", line 378, in update
    raise ECWeatherUpdateFailed("Weather update failed; no timestamp found")
env_canada.ec_weather.ECWeatherUpdateFailed: Weather update failed; no timestamp found

Thanks for clarifying. As the log indicates, this is caused by bad data from Environment Canada.

It just came back on it’s own. Definitely problem on their end.

Thank you

So when there’s no alert is it just supposed this blank empty card?

I added “ECCC Weather Watches and Warnings” as the title for my card, so when there isn’t a warning, etc, it still shows something on the page.

1 Like

This has been a problem for me for the past several days. It just stopped working with the exact error message in the logs. Is it really something on their side? I would think that if it was a universal problem, there would be a lot more people on here complaining. Any thoughts? I have been waiting for days to see if it would self-correct, but no luck yet. Migrating to Pirate Weather shortly if this doesn’t work out.

Just removed the integration, restarted HA and re-added it. During the initial integration configuration, the following error occurs:

2023-05-20 10:40:47.948 ERROR (MainThread) [homeassistant.components.environment_canada.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/environment_canada/config_flow.py", line 53, in async_step_user
    info = await validate_input(user_input)
  File "/usr/src/homeassistant/homeassistant/components/environment_canada/config_flow.py", line 29, in validate_input
    await weather_data.update()
  File "/usr/local/lib/python3.10/site-packages/env_canada/ec_weather.py", line 378, in update
    raise ECWeatherUpdateFailed("Weather update failed; no timestamp found")
env_canada.ec_weather.ECWeatherUpdateFailed: Weather update failed; no timestamp found

I assume it is coming from their side, but what has anything changed that requires an update in the integration? Thanks!

Smart! Thanks.

For some reason, this isn’t working for me…

You can see there is an active alert but the card won’t show it

The card

This is what I’m using:

{% 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 %}
{{ ‘Environment Canada: %s (%s ago)’ % (level, alert, ts) }}
{% endif %}
{% endfor %}
{% endfor %}

Neither work for me but its fine thanks, Im using a conditional mushroom chip instead

type: markdown
content: |-
  {% set entities = [
    ‘error;sensor.vaughan_warnings’,
    ‘warning;sensor.vaughan_watches’,
    ‘info;sensor.vaughan_advisory’,
    ‘info;sensor.vaughan_statements’,
    ‘success;sensor.vaughan_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 %}
  {{ ‘Environment Canada: %s (%s ago)’ % (level, alert, ts) }}
      {% endif %}
    {% endfor %}
  {% endfor %}

With the core update to 2023.9.0, the forecast part will no longer be available with the 2024.3 update. I don’t understand what I have to do to keep the forecasts.

Do you have any examples of what to do?


Are you using the forecast data programatically? If you’re able to post what you’re doing now, we could try to map it to the new approach. If you’re only displaying the forecasts using the built-in weather card, I think you should be fine.

1 Like

Hi I am still facing issue with Environment Canada and suddenly it stopped working. I am using version 2023.7.1 and it was working well. I also tried fresh installation of version 2023.9.3 and 2023.10.1 but failed to add integration with both. Is EC server issue still persisting? Thank you.

1 Like

Hello, I noticed Environment_Canada weather has stopped working yesterday after performing an update yesterday. (I think it was the HA 2023.10.1 update)

Current system info:
Home Assistant 2023.10.1
Supervisor 2023.10.0
Operating System 10.5
Frontend 20231005.0 - latest

I tried removing it and re-adding it back to integration, but failed to do so.

Steps taken:

  1. removed and re-added Environment_Canada integration (tried to)
  2. add Province Code/Site Name (Lat and Long were auto populated.)
  3. returns [Unexpected error]
  4. cannot proceed further

Your help is appreciated.

Edit: Did some testing and found that it’s an issue with my area. Other areas seem to be fine. Not sure if Environment_Canada removed my area… (ON/s0000585)

1 Like

Hi, I tried multiple locations for Ontario, none of them worked and it kept giving the same error message “!Unexpected error”. We are supposed to input either station ID or longitude & latitude but it does not work either or both. Issue seems something different, Environment Canada integration does not work with existing installations and new installation.
If anyone else observed something different please do share! Thank You.

That’s really odd. What version are you running, and is there anything showing in the logs?

Yes, Environment Canada stopped reporting current conditions for that site. See the discussion at [environment canada] Weather update failed; no timestamp found ¡ Issue #101533 ¡ home-assistant/core ¡ GitHub

This issue was fixed in version 2023.10.2.

I am running 2023.7.1, 2023.7.3 and 2023.10.1; three different installations. 2023.7.x both were working but now showing status sensor status as “Unavailable” whereas 2023.10.1 is a fresh installation and was unable to add Environment Canada integration.

I upgraded 2023.10.1 to 2023.10.3 and it worked. All the weather sensors are getting updates. Thanks for pointing to issue#101533, they fixed it in version 2023.10.2. Your link really helped in fixing the issue that has been going on for almost a month. Thanks again.

1 Like

Hi, is there any way to access the hourly forecast information? The integration page describes an hourly sensor (Current conditions and hourly forecast, disabled by default), but I can’t find any way to enable this in the integration. However, I can see the hourly data is displayed in the weather card. Thank you.