Environment Canada integration - 2021.11 onwards

Hello, I am getting an error with the new HQHI sensor.

What’s your config? Station ID and coordinates. It could be AQHI is not supported for that location.

My location si Shawinigan, PQ

In order to check I need to know how you configured Environment Canada integration. Station ID and coordinates.

@michaeldavie, Love the integration and have been using it since it has been released. Not sure if this is a known issue or just on my system but I have noticed that the sensor.forecast is truncated at 256 characters. Not sure if this is a limit to the sensor state length or something else. I recall reading somewhere that state attributes don’t have this length restriction so not sure if there is a way to make the forecast an attribute or not.
Thanks for the great work!

Yup, it’s a limitation on the state property. I suppose we could store the full value in an attribute of the sensor as well, if it allows for longer values. I’ll take a look when I get a chance.

1 Like

I have two Raspberry Pis, one 32 bit (HA 2021.12.7) and the other 64 (HA 2022.2.3). Both have what should be identical homeassistant integrations, but the Environment Canada integration is behaving differently. I am using Victoria Harbour, configured in both installs with the same Province and ID code, but the sensors are different in each. The 32 bit has a sensor.victoria_harbour_forecast entity but the other does not. Why is this, and can I manually add an entity?

There’s beeen a few changes between those versions. See Environment Canada integration - 2021.11 onwards - #72 by gwww and Environment Canada integration - 2021.11 onwards - #63 by gwww. Probably a few more messages if you scroll back further.

Forecast has not changed between those versions. That one is curious.

You can’t create an entity, the integration creates them all.

I have this setup in my house, and it worked great until recently; depending on the severity of the weather, I have escalating notifications as well, from simple pushover notifications, up to flashing lights and Alexa notification in the case of a watch. I use node-red for this, but I do not filter on the event type.
The event types are listed here: https://www.canada.ca/en/environment-climate-change/services/types-weather-forecasts-use/public/criteria-alerts.html

For the last few days (could be longer) I’ve noticed that now my alerts don’t have the type of event, just a 1 or 0. In trying to find why I came across this thread and now see that the text of the alert is now in the attributes section.

The release notes for the breaking changes are here: 2022.2: Let's start streamlining! - Home Assistant (search for Environment Canada).

Today I fixed a minor text-to-speech annoyance in my setup. I use Amazon Polly to read the forecast aloud, and it has consistently pronounced “wind up to 15 km/h” as if “wind” rhymed with “bind”. The trick was to enable SSML support in Polly and add tags to specify that “wind” should be pronounced as a noun.

Here’s the Polly TTS config and the script:

tts:
  - platform: amazon_polly
    aws_access_key_id: !secret aws_key
    aws_secret_access_key: !secret aws_secret
    region_name: ca-central-1
    voice: Matthew
    text_type: ssml
    engine: neural
    cache: false
forecast_tts:
  alias: Forecast TTS
  sequence:
  - service: tts.amazon_polly_say
    data_template:
      message: >- 
        <speak>
        {{
          states("sensor.ottawa_kanata_orleans_forecast") | 
          replace("Wind up", '<w role="amazon:NN">Wind</w> up') |
          replace("wind up", '<w role="amazon:NN">wind</w> up')
        }}
        </speak>
    entity_id: media_player.kitchen

Hi! I was wondering if it’s possible to add the precipication in the daily forecast?

This might be possible, but some more information would help. Can you tell me what data you’re looking for specifically (for example: probability of precipitation, type, amount), and how you would like to display or use it?

Sure. I’m looking for the amount of precipitation for that day.

In other weather integration, it looks something like this (the precipitation attribute):

forecast: 
- datetime: '2022-04-10T11:53:46.224637-04:00'
  condition: rainy
  precipitation: 0.75
  temperature: 7.2
  templow: 1.8
  wind_bearing: 280
  wind_speed: 24.1

It’s useful to know if it’s going to rain a lot or not for the irrigation sprinkler.
Also pretty useful for the snow. I got an alert before going to bed that looks if there will be a good amount of snow tomorow so I can leave early for work since there will surely be more traffic.

As for the unit (cm or mm for snow or rain) in the past I have done some templating.
Something like : If the condition is snowy then it’s cm or else it’s mm.
If it’s something could be done directly in the weather integration it would be great, but it’s not necessary.

Thanks, that helps. Unfortunately, it doesn’t look like Environment Canada publishes this sort of information, other than sometimes in the text summary.

Oh too bad :frowning:
Thank you!

Hi All,

Fresh HA install, trying to add EC integration, using station code ON/s0000430 (Ottawa Kanata), results in an immediate ‘Aborted’. Nothing in the configuration file, nothing in the logs (set to debug). What’s the best way to chase this down?

Thanks
Roman

HA version? To be sure, does you logging have something such as:

logger:
  default: info
  logs:
    env_canada: debug
    homeassistant.components.environment_canada: debug

Quite weird. Consistently get ‘Aborted’, but after the 4 or 5 restart (due to installing other stuff), it just appeared.

Never got anything significant in the log file. Maybe ‘Aborted’ should at least say why?

Thanks.

Thank you for the link. I am trying to create an automation that will trigger whenever there is a frost warning (for my plants). I am not sure how to do that, I created a trigger on sensor.advisories changing from 0 but I don’t know what value will change for frost