Thanks, this helps a lot. I’ll see if I can rework the dependencies so that it’ll run properly on Debian Stretch. Edit: I tried it with a Debian Stretch container and it worked…
I’ve only been working on the env_canada library for now; I’ll rework the components once I get the library fixed.
Working well for me in hassio 95.4. Really happy about this component. I’ve parsed through the thread and saw that there was quite a bit of work put into the warning,statements, and ending statements, etc portion and how people used it in cards and how the work was incorporated into the component. Maybe when the installation hubub dies down somebody could throw me a bone on some automation ideas for bad weather. I was hoping to get bad weather announced with google tts. This might actually score some “significant other” acceptance points for my technology hobby
I’m thinking about increasing the update frequency to every minute (maybe I should make this configurable…), and then having an automation trigger this kind of script if the alert sensors change. It’s a work in progress.
Running pip install numpy==1.16.4 --force-reinstall --ignore-installed --no-binary :all:
as @jmll suggested fixed the Numpy error with the sensor, as well as the “platform not found” error.
But as of now, I’m not getting any readings for temperature and condition. I’m getting the weather forecast and wind speed though.
EDIT: Problem has to do with my closest station… I tried with another one and everythoing works
Problem replicated manually:
>>> from env_canada import ECData, ECRadar
>>> data = ECData(station_id='ON/s0000430')
>>> print(data.conditions['condition'])
Mainly Sunny
>>> print(data.conditions['temperature'])
20.9
>>> data = ECData(station_id='QC/s0000416')
>>> print(data.conditions['temperature'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'temperature'
>>> data = ECData(station_id='QC/s0000620')
>>> print(data.conditions['temperature'])
20.2
The process took quite a while but I had to make sure everything was properly installed. However, the sensors were working fine. I was looking for weather.environment_canada but instead the sensor is named after the location weather.toronto (I know, RTFM). The platform is now working pretty nice and fully integrated with my TTS alerts - thank you and great job @michaeldavie. Just one little thing: I noticed yesterday with a “heat warning” I couldn’t get the details parsed - maybe an issue with Environment Canada? Not sure.
@Answer maybe try manually setting to the second closest location temporarily in the config file?
@Answer, it seems like Environment Canada has some sites that they only publish forecasts for, without any, or at least a full set of, observations. In that case, manually setting the closest site that has a full set is probably your best option.
I should also mention that the coordinates provided for the sites are only specified to 2 decimal places, so sometimes the closest by that measure is not actually the closest. In that case, you can also override the automatic selection.
@jmll, thanks, I noticed that too. It was a problem with case sensitivity, and I’ve submitted a PR to handle this in the future.
@michaeldavie yeah, I’ll try to get more info on this. The auto discovered station is the correct one. I’m using an alternate one in the meantime. Would be kinda weird for a station not to provide temperature, but hey, we never know! lol!
Thanks again for that great component!
Thanks so much. Still learning and it’s great to have something to work off. In terms of update frequency I think I read u have set it to a default of 10 minutes. I thought that was based on environment Canada’s updates. I noticed that for example temperature doesn’t seem to change every 10 minutes whereas my dark sky temp sensor seems to be more exacting. With 5 minute polling I seem to pick up even small changes in temperature with dark sky. I’m supposing that environment Canada would offer updates more often on weather warnings and emergencies. I remember they were trying to achieve a minimum warning time for tornadoes forming but don’t remember what it was. For things like this I suppose the sooner the better. An F5 rolled thru prairies but was about a decade ago but F4’s are becoming more frequent too
How are u running your TTS alerts if u don’t mind me asking
@ others
I had a similar problem with my closest weather station not reporting observations so I switched to the main one at the airport. A little research on environment Canada indicated that not all weather stations provide observations (maybe this actually requires a human/metrologist) and obviously some weather stations are simply automated data collection)
Yeah, I wonder if some of these “stations” with no data are really just target locations for their forecasting models.
@dasbooter, in my latest PR I’ve changed the polling frequency to 1 minute to capture alerts as soon as possible. I should probably make it configurable.
Pretty much as @michaeldavie suggested but I’m using tts.google_translate_say instead:
And bit more info in the message (still WIP):
Outside, it will be {{ states('sensor.condition') }} with a current temperature of {{ states('sensor.temperature') }} degrees. The forecast for today is a high of {{ states('sensor.high_temperature') }} degrees, low of {{ states('sensor.low_temperature') }} degrees and a humidex of {{ states('sensor.humidex') }} degrees.
{% if states.sensor.warnings.state != 'unknown' %}
There is a {{ states("sensor.warnings") }} in effect: {{ state_attr("sensor.warnings", "alert detail") }}.
{% endif %}