Weather forecast for Australia using WillyWeather

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.

Note that the Willy Weather service at a basic subscription level only supports a single location.

If you want more than one location, then adjust your WW settings in their system. Then try adding more than one location_id in your config in HA and let us know how you go.

I have not tried more than one location, so I have not built the component to support more than one location, but it may work.

1 Like

Hi Riccardo,

Love the component so far. What I’m having problems with at the moment (and I’ve only started with HA) is that I can’t get the Willyweather data showing on a Darksky card. In fact, I’m not sure I’ve even got that configured correctly.

The error I’m seeing in the logs is:
Unable to connect to Dark Sky: 403 Client Error: Forbidden for url: https://api.darksky.net/forecast/123/-33.39880790795851,151.35502696037295?units=si&lang=en

Obviously, I don’t have an API Key and from what I read, it isn’t possible to subscribe any longer. But I thought your component would just make use of the Dark Sky component and I wouldn’t need to connect.

Regs,
Paul

@pspeirs

Not sure about Dark Sky. I tried it a while ago but I don’t like it, so can’t really help.

No problems, thanks for the reply.

I did read about https://pirateweather.net/ recently which aims to be a replacement for Dark Sky. Not sure if it would help or not yet but I have signed up for an api key.