Lovelace UI Weather Forecast

Hi, I set darksky as WEATHER-FORECAST component, but the GUI show me every hour… How I change it to daily forecast?

Thanks!
image

4 Likes

Hi

I’m only new to Hassbian and I wanted to do a weather forecast section, but when I searched for that, I found Weather forecast card - Home Assistant

Unfortunately, for newbies like me, I found the documentation to be “lacking”.

For example, to simply say:

(string)(Required)The entity_id of the weather platform to use.

and show the example of:

entity: weather.demo_weather_north

didn’t really mean much to me since I’m a newbie.

Where do we find these “weather” platforms? I noticed in this thread, radinsky uses weather.yweather. Is this the only one? (edit: I found this page which has links to other weather services like BOM. I’ll need to read this further.)

I’m feeling lost when it comes to doing things in HA when you get pages like the weather forecast page linked above that seem to assume you know things such as weather platforms etc. I actually got to this forum page “accidentally” as I searched Google for the term “weather platform lovelace home assistant” to learn what weather platforms were available.

I have:

# Weather YWeather
sensor:
  - platform: yweather
    monitored_conditions:
      - weather
      - weather_current
      - temp_min
      - temp_max
      - wind_speed
      - pressure
      - visibility
      - humidity
      - temperature

in my configuration.yaml file that gives me icons at the top of the page, but to get the card in lovelace, radinsky says to have:

# Weather YWeather
weather:
  - platform: yweather

in the configuration.yaml file. Without it at the moment I’m getting an error in the lovelace interface.

Do I combine them to look like:

# Weather YWeather
sensor:
  - platform: yweather
    monitored_conditions:
      - weather
      - weather_current
      - temp_min
      - temp_max
      - wind_speed
      - pressure
      - visibility
      - humidity
      - temperature
weather:
  - platform: yweather

Thanks in advance.

I’m in the same boat as MadMax1412. I’ve been shamelessly copying YAML from various different repositories to develop my frontend. However I have run into difficulties in getting the “Weather Forecast” card to display.

In Configuration.yaml I have the following

  - platform: yweather
    name: yweather
    woeid: !secret woeid

# The code below is copied from the Arsaboo configuration - see Weather.yaml in the 
# packages folder

  - platform: darksky
    api_key: !secret darksky
    forecast:
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
    monitored_conditions:
      - summary
      - precip_probability
      - wind_speed
      - cloud_cover
      - icon
      - temperature_low
      - temperature_high
      - daily_summary
      - hourly_summary
      # - Added for weather card
      - humidity
      - temperature
      - wind_bearing
      - pressure
      - visibility
    update_interval:
      minutes: 5
  - platform: season
  - platform: template
    sensors:
      forecast_0:
        friendly_name: "Today"
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon.state ~ '.png'}}

      forecast_1:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
          {{ date | timestamp_custom("Tomorrow (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature_1.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_1.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_1.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_1.state ~ '.png'}}

      forecast_2:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (2 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature_2.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_2.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_2.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_2.state ~ '.png'}}

      forecast_3:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (3 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature_3.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_3.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_3.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_3.state ~ '.png'}}

      forecast_4:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (4 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature_4.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_4.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_4.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_4.state ~ '.png'}}

      forecast_5:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (5 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
          {{states.sensor.dark_sky_daytime_high_temperature_5.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_5.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_5.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_5.state ~ '.png'}}

      forecast_6:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (6 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
            {{states.sensor.dark_sky_daytime_high_temperature_6.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_6.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_6.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_6.state ~ '.png'}}

      forecast_7:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (7 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%m/%d)") | replace("(0", "(") | replace("/0", "/") }}
        value_template: >
            {{states.sensor.dark_sky_daytime_high_temperature_7.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_7.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_7.state|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_7.state ~ '.png'}}

In UI-Lovelace I then have:

  • icon: mdi:weather-cloudy
    id: weather
    title: Weather
    cards:

    • type: entities
      title: Weather
      entities:
      • sensor.dark_sky_temperature
      • sensor.dark_sky_daytime_high_temperature
      • sensor.dark_sky_overnight_low_temperature
      • sensor.dark_sky_wind_speed
      • sensor.dark_sky_cloud_coverage
      • sensor.pollen_level
      • sensor.cold_flu_risk
      • sensor.dark_sky_hourly_summary
      • sensor.dark_sky_daily_summary
  • type: entities
    title: Weather Forecast
    entities:

    • sensor.forecast_0
    • sensor.forecast_1
    • sensor.forecast_2
    • sensor.forecast_3
    • sensor.forecast_4
    • sensor.forecast_5
    • sensor.forecast_6
    • sensor.forecast_7
  • type: weather-forecast
    entity: weather.yweather

The weather and weather forecast cards display correctly however the final Weather-Forecast card results in an error:

“No state available for weather.yweather”

Can anyone advise what I am doing wrong and how to fix it?

you are mixing up yweather and darksky as far as I can see?

Hi,

Did you manage to fix this?

Nop, never found the solution, hope someone could help us

Same problem here. Did you ever figure this out?

Did you manage to fix this?

Hi everyone. I have problems with dark sky. all of a sudden it stopped working and gives me this error:

[homeassistant.components.sensor.darksky] Unable to connect to Dark Sky: HTTPSConnectionPool(host=‘api.darksky.net’, port=443): Max retries exceeded with url: /forecast/xxxxxxxxxxxxxxxxxxxx/44.xxxxxx,8.xxxxxx?units=si&lang=it (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x72ba6ab0>: Failed to establish a new connection: [Errno -3] Try again’,))

Seems like this link should do it for you:

from what I can get out of it you would do something like
weather:

  • platform: darksky
    api_key: YOUR_API_KEY
    mode: daily

That mode setting did it, thanks

How can I create card for WeatherUnderground to look like those https://www.home-assistant.io/components/sensor.wunderground/#temp_c samples for Forecast and overview?

The weather component returns the following attributes:
wind_bearing: 232
pressure: 1015.09
temperature: 29
ozone: 269.47
friendly_name: Dark Sky
wind_speed: 2.6
forecast: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
attribution: Powered by Dark Sky
humidity: 80
visibility: 6.91

Can anyone tell me how to access the forecast object Object in a template?

Solved :slight_smile: found the solution