Don’t suppose you would mind throwing an example of your script up and how you trigger it, etc. I have used this integration for years and its been a dream of mine to have it announce weather watches, advisory’s and warnings during waking hours.
I was trying to automate off a state change but every time the sensor would update it looked like a state change so google would announce, but there would be nothing. This got old with the wife pretty quick. It appears the text for the warnings would be an attribute too but now I see nothing when I check sensor.mycity_warnings ?
If you are interested in placing Environment Canada warnings, etc on your dashboard this bit of code may be interesting. The code requires editing for your weather entities, and as written supports up to 2 alerts in each category (warnings, watches, etc).
Place the following in a Markdown card:
{% 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 %}
{{ '<ha-alert alert-type="%s">Environment Canada: <a href="https://weather.gc.ca/warnings/report_e.html?on41">%s</a> (%s ago)</ha-alert>' % (level, alert, ts) }}
{% endif %}
{% endfor %}
{% endfor %}
The link to the EC warnings is hardcoded and also needs to be changed for your station.
If there are no alerts then the card will be empty. You could place the markdown card inside a conditional card if you want it to appear only when there are alerts.
Here is what the Ottawa markdown card looks like at the moment (yah, its a crappy summer day!):
Although the temperature reported for Pitt Meadows is accurate, the forecast is not. Because it’s warmer inland in the summer by three to five degrees than by the ocean, I end up with the wrong data in Home Assistant. The text forecast below the table will indicate “High 27 except 31 inland” but for some reason EC insists on reporting things this way. So I get the forecast values from the table and not the “except inland” temperature which is the correct one.
There are other weather forecasts which do similar things like St. John’s for example, since the forecast area is really large covering micro climates. Or Halifax-Shearwater which today reports a “High 27 except 22 along parts of the coast”
Is it possible to address this with the EC integration somehow so it works properly? I would prefer to continue to use the EC integration rather than Accuweather and it’s API call limits, but I may have to resort to that at least for summer months.
I want the correct forecast daily high temperature so I can issue reminders to close windows and turn on the air conditioning because if we don’t do that early in the morning, the house turns into an oven and the cooling can’t recover the heat soaked house.
Thanks, I hadn’t seen this before. It should be possible to configure a template sensor that extracts the inland temperature from the current day’s text forecast. I’ll take a crack at this and get back to you.
Hi folks, thanks for all of your hard work on this integration @gwww and @michaeldavie
I’ve read through all of this and the related threads, but I can’t seem to find anything about the radar entities not working, however, I can’t figure out how to get them to work on my end. They just always show as unavailable after the integration. Am I missing something? Thanks!
I’m on the most up to date version of HA (Core: 2022.8.6; Supervisor: 2022.08.03; OS: 8.5).
When I added the EC integration (I’ve tried both Toronto and Toronto Island), there was never an option for enabling radar, only places to add the Weather Station ID and/or latitude and longitude, and the option to select English or French.
I read the EC integration page and saw the section about choosing the radar_type, but there wasn’t any other documentation about getting the camera entity to work, nor about some regions not having radar available.
Do you know if there is any way that I might be able to figure out in advance which regions do have active radar/cameras? If in fact the reason that the radar entity is unavailable for me right now is because neither of the two I’ve loaded (Toronto and Toronto Island) have radar/cameras available, I’d like to try adding a region that does have cameras, but I don’t see any way to find this information out…
Hmmm, well that’s what I find confusing - Toronto most certainly is covered by the Environment Canada coverage area. It’s just that when I add the Toronto or Toronto Island stations, the radar entity for either shows as unavailable. For what it’s worth the entities called Hourly forecast also show as unavailable for both services.
Well, now I feel like an idiot - I didn’t realize that it was as simple as going into the service, clicking on the radar entity, going to Advanced settings and selecting Enabled. I’d made the incorrect assumption that the entity status being listed as unavailable meant that it wasn’t working upstream for some reason, not that it was just disabled by default.
It might be worth clarifying this a bit in the Environment Canada integration documentation. I did see where the documentation says - “Note that many of the entities are disabled by default” - but I guess I over-complicated things in my head and assumed that there was a problem upstream with the EC radar cameras, since I’d periodically run into problems accessing the feeds from some of the Canadian radar stations via Weather Underground in the past. When @gwww asked whether I’d enabled the radar, I mistakenly thought he meant that there should have been an option to enable the radar during the initial configuration of the integration, when you select the Weather station ID and language… Anyway, it’s fixed now. I might create a PR to make this process a little more explicit in the documentation, if that makes sense to you all.
I’m glad, I’m not the only one .I reinstalled the integration to troubleshoot something else and could not get the radar working again. I was just about to restore my backups. Thanks for that.
I would like to connect a roof heating cable to Home assistant switch so that when it ACTUALY snow per environment canada in my area it would trigger it ON for say 2 hours . I did that manualy last year but would find it convenient if that is possible. NoteI have environment canada integration properly installed with report for my location but have no clue how to use it . Thanks for reply.
Hey folks, I updated the Environment Canada docs to include descriptions of the entities that are disabled by default. Actually, it was already there. It editorialized it to hopefully make it stand out more.
I also add a pointer to where you can get raw data to look at – for when you say “hey, why is this sensor missing”. We operate on the same raw data that Environment Canada gives us.
Last thing, 2022.11 (most probably) will have a “Download diagnostics” button on the integration page. You can use that to see what raw data that the integration has. There will be a reference to the diagnostics in the docs once the pull request is accepted.
The goal of the improvements is to reduce the confusion (and hence questions) around “where’s my entity” and “why is sensor not showing up”.
If after reading the docs you believe that they can be improved further you have a couple of options. Tell us here. Be specific and suggesting new text is appreciated. The other option is get a Github account and update the docs yourself. Both @michaeldavie and myself will see the update and one of us will have to approve it.
If you’ve been experiencing intermittent timeouts the past few days, this has been confirmed as an issue on Environment Canada’s end. The issue is being tracked at the link below.