7 Day Weather Forecast

Nice tip

I chanced the ° to C and I got no errors anymore

I want to chance the names of the days ( to duch) . In dark_sky_friendly_names.py you can change the names, but nothing changes here .
I also want to change the date from 03/13 to 13/03. Is that possible ?

 forecast_2:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (2 * 86400 ) -%}
          {{ date | timestamp_custom("%A (%-m/%-d)") }}
        value_template: >
          {{states.sensor.dark_sky_daily_high_temperature_2.state|round(0)}}°/{{states.sensor.dark_sky_daily_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'}}

Changing (%-m/%-d)") to %d/%m should change the date format

Stupid me. That was too easy to ask for :slight_smile:

Did the new template.py make it into 0.65.5? I didn’t see it in the release notes?

Doesn’t look like. It will be part of 0.66.

Friendly names not working for me either on hassio 0.65.4 with the custom_component/sensor/template.py file

Will have to wait for next version

I was also having same problem as @Faecon with the ° character, which is strange because it works elsewhere for other template sensors in my config. Hass would not start at all until I changed it

Hi, I have three questions and would like to ask you for help. Thank you in advance.

  • How can I add call´s counter as per #90?
  • Is it possible to rename sensors to my preffered language? When I added it into sensons.yaml, it will double the calls
  • Is it also possible to rename names of days

Once you understand how the template works, you can modify it to your preferences. Basically, change the templates to reflect how you want things to appear for you.

Ok, will try it. But I´ve got problem with this issue…

Unable to connect to Dark Sky. HTTPSConnectionPool(host=‘api.darksky.net’, port=443): Max retries exceeded with url: /forecast/e75d7ad6bc77026a2f428cd5dd5e8874/50.1997,14.8457?units=si (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x70a8a0d0>: Failed to establish a new connection: [Errno -3] Try again’,))

I only copy your config, but have no idea why I have this problem. Any idea please?

And also how can I add call´s counter?

You mostly have darksky added in multiple places, which is causing excessive use of API calls.

Hello, how can I add the counter as you have please?

If you are referring to the count in my previous post, that’s not in HA, it’s from the darksky Api Account

Thank you, I have in average max 700 api calls, so don´t understand, why i have in log this…

Unable to connect to Dark Sky. HTTPSConnectionPool(host=‘api.darksky.net’, port=443): Max retries exceeded with url: /forecast/e75d7ad6bc77026a2f428cd5dd5e8874/50.1997,14.8457?units=si (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x70a8a0d0>: Failed to establish a new connection: [Errno -3] Try again’,))

Disregard, I misread your post.

Try rebooting the system, sometimes things get a little out of wack restarting HA too many times.

Thank you for your help!!

Hi, I´m trying to do it, but don´t know, how to configure:
{% set date = [now().strftime + (2 * 86400 )] %}

If I delete it, it works perfectly, but of course date is today.

Here is my config. Can you pls advise?

forecast_2:
friendly_name_template: >
{% set date = [now().strftime + (2 * 86400 )] %}
{% set weekdays = [“Pondělí”, “Úterý”, “Středa”, “Čtvrtek”, “Pátek”, “Sobota”, “Neděle”] %}
{% set weekday = weekdays[now().strftime(’%A’) | int -1] %}
{{ weekday + ’ ’ + now().strftime(’%d’) + ‘.’ + now().strftime(’%m’) + ‘.’ }}
value_template: >
{{states.sensor.dark_sky_daily_high_temperature_2.state|round(0)}}°/{{states.sensor.dark_sky_daily_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”}}

Please check the code again. Where did you get the square brackets from?

From another topic - Date formatting…

So, I revise it, but it still not working via Jinja2… Do you have any idea why?

forecast_2:
friendly_name_template: >
{% set date = (now().strftime + (2 * 86400 )) %}
{% set weekdays = (“Pondělí”, “Úterý”, “Středa”, “Čtvrtek”, “Pátek”, “Sobota”, “Neděle”) %}
{% set weekday = weekdays(now().strftime("%A") | int -1) %}
{{ weekday + " " + now().strftime("%d") + “.” + now().strftime("%m") + “.” }}
value_template: >
{{states.sensor.dark_sky_daily_high_temperature_2.state|round(0)}}°/{{states.sensor.dark_sky_daily_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”}}

This works for me. You should be able to modify it for your situation:

{% set weekdays = ["Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"] %}
{%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
{% set weekday = weekdays[now().strftime("%A") | int -1] %}
{{ weekday }}