Weather forecast for Australia using WillyWeather

Hi all,

I recently wrote a weather parser for the RainMachine smart watering device using data from www.willyweather.com.au because they have an easy to use Rest API. Docs are here: https://www.willyweather.com.au/api/docs/v2.html

The issue I have with BoM data (and therefore the default BoM HA component) is that my local weather station, Castlemaine, only provides a 9am reading via the data feed. So in HA, I see one early morning temperature all day. This is pointless. The WW feed takes BoM data and gives the best local result for any location. This means my temp comes from Redesdale (32kms away), but its better than nothing.

Other people with HA living outside the capitals might find this useful too.

So I thought I would use the same service for Home Assistant sensors and weather. This is a very light-weight API that requires no special directories or downloads.

{EDIT 12/08/2019: The sensor component now supports data for the Dark Sky Custom Weather Card]

The catch is that WillyWeather is a commercial service, but it’s very cheap - my current usage is AUD$0.000033 per request. Which is $1.73 / year for requests every 10 minutes.

Details and instructions are here: https://github.com/safepay/Home-Assistant-WillyWeather

I designed it to be easy to set up. Just add the WillyWeather sensor or component, together with the custom_components files and register your API key with WillyWeather.

Location is determined by your lat/long. You can also override settings if you want.

Note that I am not a programmer but have programmed over the years, so I am welcome of any suggestions.

I hope someone else finds this useful.

3 Likes

Is the data from that source more reliable? or is there some other reason you prefer it over the numerous free services?

Its probably the ozbargainer in me but even $2 a year for something I can do for free doesnt feel right…

It was easier for me to write the code for the RainMachine - avoiding FTP’s, etc.

I also like the way it pulls the closest data for your location. For example, I’m in central Victoria, so there is no nearby weather station. WW pulls data from Bendigo, Redesdale and Castlemaine to give me a local snapshot.

So yes, I prefer it to the Bureau service, even though it uses Bureau data.

Other people on RainMachine have commented that it is much more accurate that the other available sources (which don’t include the nice BoM custom components people have developed for HA, of course).

I’m all for more integrations. Well done.

But all of the BoM ftp info can be collected for you using this integration for free:

Yes, I think the other integrations are great. And I agree with getting data for free is better, but only if you live near a weather station that provides all the data.

But outside the capital cities, the BoM data from FTP is basically useless as you can only choose one weather station.

E.g. Castlemaine’s weather station only does a 9am reading:
http://www.bom.gov.au/products/IDV60801/IDV60801.95853.shtml

The WillyWeather API provides all data for a given location, taken from the nearest weather station that provides the data.

E.g. I get temperature from Redesdale and Cloud from Bendigo when I call the API using my location coordinates.

If another weather station came on-line near me, then the API would use those values where possible.

If I used Bendigo as my sole weather station, it would not be as accurate for the variety of readings.

Hi Riccardo, I have managed to set up the component and can see the current weather sensors, but how do I get the forecast?

Thanks,
CB

Hi CB1.

Use the weather component instead of the sensors. Then you can add a weather card to your screen.

Thanks Riccardo, I didn’t read the instructions properly! Nice neat component.

Hi again Riccardo, the weather component works fine, but is it possible to retrieve the individual forecast values? The reason is that I currently use a DarkSky custom weather card with the BoM values. I do not want to use the standard weather card if possible. I realise that it may mean extending the sensor component to return forecast values as well. Have you thought of this before?

I haven’t tried to, but this post:

Mentions that you can still get array values from the forecast attributes.

E.g.

{{states.weather.location.attributes.forecast[0].condition}}

Here is a working example:

sensor:
  - platform: template
    sensors:
      day_0_temp_high:
        friendly_name: "Day 0 Temp High"
        unit_of_measurement: "°C"
        value_template: '{{states.weather.melbourne.attributes.forecast[0].temperature}}'

Where weather.melbourne is the name of your weather component.
Then just increment the “0” to get the remaining days.

Apart from temperature there are datetime, templow, precipitation, and condition.
These are all the attributes that the HA weather component accepts.

I’ve uploaded a new version of sensor.py that extracts forecast data in to individual sensors.

Just add days: 7 to get the additional sensors.

Days can be 1 to 7, but for DarkSky you will need at least 6.

I have it working with the DarkSky Weather Card like this:

In configuration.yaml:

sensor:
  - platform: willyweather
    api_key: XXXXXXXXXXXXXXXXXX
    forecast_days: 7

And in the Dark Sky Custom Weather Card:

entity_current_conditions: sensor.ww_day_0_icon
entity_current_text: sensor.ww_day_0_summary
entity_forecast_high_temp_1: sensor.ww_day_1_max_temp
entity_forecast_high_temp_2: sensor.ww_day_2_max_temp
entity_forecast_high_temp_3: sensor.ww_day_3_max_temp
entity_forecast_high_temp_4: sensor.ww_day_4_max_temp
entity_forecast_high_temp_5: sensor.ww_day_5_max_temp
entity_forecast_icon_1: sensor.ww_day_0_icon
entity_forecast_icon_2: sensor.ww_day_1_icon
entity_forecast_icon_3: sensor.ww_day_2_icon
entity_forecast_icon_4: sensor.ww_day_3_icon
entity_forecast_icon_5: sensor.ww_day_4_icon
entity_forecast_low_temp_1: sensor.ww_day_0_min_temp
entity_forecast_low_temp_2: sensor.ww_day_1_min_temp
entity_forecast_low_temp_3: sensor.ww_day_2_min_temp
entity_forecast_low_temp_4: sensor.ww_day_3_min_temp
entity_forecast_low_temp_5: sensor.ww_day_4_min_temp
entity_summary_1: sensor.ww_day_0_summary
entity_summary_2: sensor.ww_day_1_summary
entity_summary_3: sensor.ww_day_2_summary
entity_summary_4: sensor.ww_day_3_summary
entity_summary_5: sensor.ww_day_4_summary
entity_temperature: sensor.ww_temperature
entity_sun: sun.sun
entity_daytime_high: sensor.ww_day_0_max_temp
entity_wind_bearing: sensor.ww_wind_direction
entity_wind_speed: sensor.ww_wind_speed
entity_humidity: sensor.ww_humidity
entity_pressure: sensor.ww_pressure
entity_apparent_temp: sensor.ww_feels_like
entity_pop: sensor.ww_day_0_rain_probability
entity_pop_1: sensor.ww_day_1_rain_probability
entity_pop_2: sensor.ww_day_2_rain_probability
entity_pop_3: sensor.ww_day_3_rain_probability
entity_pop_4: sensor.ww_day_4_rain_probability
entity_pop_5: sensor.ww_day_5_rain_probability
type: 'custom:dark-sky-weather-card'

Hi safepay, thank you for the component.

Either of these give me an error with the config check of

Invalid config for [sensor.willyweather]: [forecast_days] is an invalid option for [sensor.willyweather]. Check: sensor.willyweather->forecast_days. (See ?, line ?).

Am I misreading your instructions somehow?

- platform: willyweather
  api_key: !secret willyweather
  forecast_days: 7
  monitored_conditions:
    - temperature
    - apparent_temperature
    - cloud
    - humidity
    - dewpoint
    - pressure
    - wind_speed
    - wind_gust
    - wind_direction
    - rainlasthour
    - raintoday
    - rainsince9am

The correct config is

    forecast_days: 7

I had a typo in the README - apologies.

I’ve also done a release to make sure the latest code is in the system.

1 Like

Did both the update and config and working great, thank you safepay.

1 Like

Is there any chance you could add the tides data that willyweather provides? I can sse that you pull from the api using …weather.json?forecasts=weather,rainfall&days={}’ if I insert ‘tides,’ after weather I can see that willy delivers tide data but I have no idea how to take that through to delivering a useful sensor.
thx

Not what you asked but for Aus tides I have been using

That actually might suit well as willy only delivers tides for a subset of its weather locations so I can get the tides for place x from your suggestion and still look at the weather for location y. I’m onto it.
thx

ok, so i set that up and it just the time of the next high tide. Is that all we get into HA ?

- platform: worldtidesinfo
  api_key: abc
  name: stanwell_park
  # latitude: !secret latitude_loc_home
  # longitude: !secret longitude_loc_home
- platform: template
  sensors:
    stanwell_park_next_high:
      value_template: '{{ as_timestamp(states.sensor.stanwell_park.attributes.high_tide_time_utc) | timestamp_custom("%a %d/%m/%Y %H:%M") }}'
      friendly_name: "Stanwell Park Next High Tide"
    stanwell_park_next_low:
      value_template: '{{ as_timestamp(states.sensor.stanwell_park.attributes.low_tide_time_utc) | timestamp_custom("%a %d/%m/%Y %H:%M") }}'
      friendly_name: "Stanwell Park Next Low Tide"
1 Like

Can I monitor 2 locations with this component?. I did not add station ID in the configuration.yaml.

I have added two locations/stations in my willy weather account. These locations are 400km apart.