Breaking Change to Environment Canada Integration Introduced by HA 0.107

I am seeing the following errors when I run the Check Home Assistant configuration Addon:

General Errors:
- Platform error weather.environment_canada - No module named ‘bs4’
- Platform error sensor.environment_canada - No module named ‘bs4’

I know this is related to the Environment Canada integration breaking change introduced by HA 0.107, but I am unclear how to resolve these errors.

Environment Canada was updated to version 0.0.35 in the manifest. Looks like this update is on 0.107.4.

0.0.35 looks like it removed BeautifulSoup (bs4) dependencies. At least, it’s what they say. But looking at their current version, it’s still there…

But they removed it in 0.0.35…

So yeah, this is a bug.

If you want this to work right now, it looks like you can use version 0.0.34. It was removed due to this mandate:

I would just modify the manifest.json to use version 0.0.34 for now until it’s fixed. Also should open a bug report.

The manifset.json would be at homeassistant/components/environment_canada.

Sorry for the delay, I’m working on a fix for this.

1 Like

Is this related to my issue which is weather.richmond has been AWOL for a long time now and I have the following log entry at startup…

Error adding entities for domain weather with platform environment_canada
Error while setting up environment_canada platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 243, in state
    return self.condition
  File "/usr/src/homeassistant/homeassistant/components/environment_canada/weather.py", line 164, in condition
    elif self.ec_data.hourly_forecasts[0].get("icon_code"):
IndexError: list index out of range

I’ve also tried the Vancouver station as well as unspecified but same error.
My config is:

weather:
  - platform: environment_canada
#    name: richmond
#    station: BC/s0000862
#    name: vancouver
    station: BC/s0000141
    forecast: daily

Edit: Replied in the main support thread instead.