7 Day Weather Forecast

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 }}

Thank you. But it doesn´t work, if you change (X * 86400 ).

This one below works perfectly… You only have to double weekdays due to forecast_7 has int +6.

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

Hi!
i have change to this setup:https://hastebin.com/baxeqazayu.coffeescript
But i can get the pictures to show. It only shows the picture for “today”
I am on 0.65.6

image

If today works, the others should work too. Make sure they icons have the same permissions and user. Double check that they are accessible by homeassistant (or whatever user you have configured) user.

OK so I joined beta chanel and updated to 0.66.0.beto.0 and the templating is still not working here. Back to the python script again.

friendly_name_template is already part of master.

@DetroitEE @arsaboo short note to thank you for sharing this project. I have taken your idea and along with a great tool from @eddi89 -

created this

Here are the components
This is the package
https://hastebin.com/ozefakeday.coffeescript

This is the style sheet
https://hastebin.com/itiyilanuq.css

and these are the icons
https://www.dropbox.com/s/j8htjxd0q9dx5jr/icons.zip?dl=0

These icons are animated and modified from Free animated SVG weather icons - amCharts

2 Likes