Same error code as you posted above?
Some hassio users had issues with the degree symbol. Make sure you are using a reputable text editor like Notepad ++.
Possible issue with the temp…code has high and low…but return values just have temp.
using notepad++ and have show white space and tab turned on so I can make sure I don’t have to many spaces.
Update: updated the variables(temperatureLow\temperatureHigh) under monitored_conditions and the error line changed to several lines further down.
Update: moved the code back to config and had to comment out the temps to get it to show the card. still missing information and the icons, but the missing info could be the temp values missing.
update#3: it is the temp values missing that is causing my issue. If I remove the script that is looking for those values it does look to work…nothing there, but icon works properly.
Dark sky changed from max/min to high/low, see Sunonline’s post a few lines up. Not sure if that has anything to do with it. The dark sky component code may need to be changed to account for this.
Your error is the text format. Try copying arsaboos yaml file or a text editor like notepad ++.
When back thru there was a couple of lines that had the wrong spacing. fixed those and still not getting the weather.yaml file to be seen correctly. Still an error. Putting the code in the config is showing “unknown” for the output on the card. so some of it is working but still not working properly. Date is working at least.
Update: figured I would cut it down to just “today” that way if it is a spacing issue I would eliminate a large part that could have issues. still have Unknown for today…so not certain what I am missing.
First things first, is the Dark Sky component working? Take a look at the device states and see if you have “sensor.dark_sky_daytime_high_1”, “sensor.dark_sky_daytime_high_2”, etc.
Went back and looked at what you had asked. I do not have sensor.dark_sky… for any of of the dark sky monitored_conditions items in the states dev tools, but I do have a sensor.season. I have cleared all of the script (shown below) out except the the basic pieces. Looked at the spacing and I am still not seeing it. If I put the api key in a browser I get all of the data back, so that is able to work, just not pulling it in conf.
update:changed the name of the weather.yaml file to yaml.old and was able to get the packages under homeassisant to not give an error. Still need to figure out why I am not getting dark_sky data.
You’re missing the “forecast” section of the darksky sensor:
- platform: darksky
api_key: !secret darksky_api_key
update_interval:
minutes: 20
forecast:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
monitored_conditions:
- apparent_temperature
- apparent_temperature_max
- apparent_temperature_min
- cloud_cover
- daily_summary
- dew_point
- hourly_summary
- humidity
- icon
- minutely_summary
- ozone
- precip_accumulation
- precip_intensity
- precip_intensity_max
- precip_probability
- precip_type
- pressure
- summary
- temperature
- temperature_max
- temperature_min
- uv_index
- visibility
- wind_bearing
- wind_speed
- nearest_storm_distance
- nearest_storm_bearing
I’m unclear why you’ve got a URL in the api_key field. It should just be the letters and numbers of your api key, nothing more.
your right, api_key needed to be just the key. Moved back to the weather.yaml is the packages folder. I am getting data now. still not liking the - platform: template
update: went back and pulled a fresh copy of the script, thinking that i adjusted and maybe i mucked something up…nope still getting an error with the - platform: template
I did update to hassio to .70 yesterday…looks like others are having the same issue with this version.
Update: screenshot of platform: template code
Please post a screenshot of the template sensor code in your weather.yaml file.
I get another problem with this package…
I get error in parsing template, and i think the error lies in this section:
friendly_name_template: >
{%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
as if i put away this the package is working good. How to change it to make it working?
I wonder if 0.70 broke something for hassio users using this template sensor.
I am not using hassio… i am on hassbian.
No it didn’t. It’s working fine with Hassio.
Just for a data point. I and running HA on Ubuntu. Updated this and HA today. Works perfect no issues. I was already running this though and it was running fine before I updated as well
This is what i get:
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Domenica 03 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_1’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Lunedì 04 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_2’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Martedì 05 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_3’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Mercoledì 06 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_4’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Giovedì 07 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_5’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Venerdì 08 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_6’
2018-06-02 17:16:20 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Sabato 09 Giugno: UndefinedError: ‘homeassistant.core.State object’ has no attribute ‘_7’
And this is what i have in code regarding forecast:
forecast_0:
friendly_name_template: Giorno
value_template: Max | Min | Pioggia
icon_template: mdi:weather-partlycloudy
forecast_1:
friendly_name_template: >
{%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 ) -%}
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set m_ok = date | timestamp_custom("%m") | int %}
{% set g_ok = date | timestamp_custom("%w") | int %}
{{giorno[g_ok] + ' ' + date | timestamp_custom("%d") + ' ' + mese[m_ok - 1]}}
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 your value templates, you have an extra period after the word “temperature” that shouldn’t be there. Try fixing that.
Ah yes… i got it… just one question… am i still forced to use the python script and add python_script: to configuration.yaml?