I noticed that my current forecast & tomorrow forecast templates for the integrations Accuweather and Meteorologisk institutt (Met.no) don’t work anymore. Both show unavailable.
- platform: template
sensors:
# Meteorologisk institutt
meteoswiss_weather_temphigh_today:
friendly_name: "Clotilde Weather Forecast Temperature High Today"
value_template: "{{ state_attr('weather.forecast_home', 'forecast')[0]['temperature'] }}"
meteoswiss_weather_templow_today:
friendly_name: "Clotilde Weather Forecast Temperature Low Today"
value_template: "{{ state_attr('weather.forecast_home', 'forecast')[0]['templow'] }}"
# Accuweather
accu_weather_temphigh_tomorrow:
friendly_name: "Accu Weather Forecast Temperature High Tomorrow"
value_template: "{{ state_attr('weather.geneva', 'forecast')[1]['temperature'] }}"
accu_weather_templow_tomorrow:
friendly_name: "Accu Weather Forecast Temperature Low Tomorrow"
value_template: "{{ state_attr('weather.geneva', 'forecast')[1]['templow'] }}"
accu_weather_temphigh_today:
friendly_name: "Accu Weather Forecast Temperature High Today"
value_template: "{{ state_attr('weather.geneva', 'forecast')[0]['temperature'] }}"
accu_weather_templow_today:
friendly_name: "Accu Weather Forecast Temperature Low Today"
value_template: "{{ state_attr('weather.geneva', 'forecast')[0]['templow'] }}"
The previously deprecated forecast attribute of weather entities, has now been removed. Use the weather.get_forecasts service to get the forecast data instead.
So had a look at the “Example template sensor that contains the hourly forecast”, went to Settings > Devices & Services > Helpers. and created a template binary
but that doesn’t work, error message:
“This template does not listen for any events and will not update automatically.”
Again, I’m not good in coding, any idea what I’m doing wrong.
Additionally, what would be the code to be entered into the configuration.yaml ?
You said you created a Template Binary Sensor helper but the example you posted is a Trigger-based Template Binary Sensor. Currently, there are only two kinds of Template helpers: sensor and binary_sensor (the Trigger-based variant isn’t supported).
Did you put all of that YAML code into the State Template field? Because if you did, it would cause the error message you received. That field is meant to contain a Jinja2 template and nothing else.
You’re absolutely correct, yes I did put it into the State Template field.
I’m not fully into HA, sometimes it could help if HA would tell these “stupids” where exactly a code has to be entered. Anyway…
So where should I enter it or how do I amend my existing configuration.yaml entry to make it work again. Besides, Accuweather doesn’t support hourly updates, only daily one.
# Accuweather
- platform: template
sensors:
accu_weather_temphigh_tomorrow:
friendly_name: "Accu Weather Forecast Temperature High Tomorrow"
value_template: "{{ state_attr('weather.geneva', 'forecast')[1]['temperature'] }}"
accu_weather_templow_tomorrow:
friendly_name: "Accu Weather Forecast Temperature Low Tomorrow"
value_template: "{{ state_attr('weather.geneva', 'forecast')[1]['templow'] }}"
accu_weather_temphigh_today:
friendly_name: "Accu Weather Forecast Temperature High Today"
value_template: "{{ state_attr('weather.geneva', 'forecast')[0]['temperature'] }}"
accu_weather_templow_today:
friendly_name: "Accu Weather Forecast Temperature Low Today"
value_template: "{{ state_attr('weather.geneva', 'forecast')[0]['templow'] }}"
Anyone coming here for accuweather does not need to make templates. The integration outputs all the information OP is asking for. They are separate sensors, check the list of disabled sensors in the accuweather entities integration list.
In the template evaluator I ran the following to list all attributes,
{% for k,v in states.weather.tomorrow_io_cabin_daily.attributes.items() -%}
{{ k }}: {{ v }}
{% endfor %}
Yep the forecast attribute is definitely gone.
But the strange thing is, when I click the above entity in the integration, I can see the forecast weather data (e.g it’s going to rain tomorrow).
But I can’t figure out where/how to access that data. i.e Obviously HA has it somewhere, but it is no longer an attribute of that entity, and there are no other Tomorow.IO entities that contain that information.
I have searched for all (including disabled/hidden) entities of Tomorrow.io, and all entities containing the name “forecast” etc, I cant find the forecast data anywhere.
Thanks, ya got it, used [This](https://community.home-assistant.io/t/forecast-depreciation/713543/2)
Yes its a super unclear new changed, for people who are not super intimate with HA. (And I’m fairly intimate, share a few blueprints etc).
I think what is missing from the docs/explanations (for me anyhow) is just a clearer explanation of the work flow.
Also, it really doesn’t help that the docs dont show an example of how to get all the forecast data. (Sure, that would be obvious to a HA Dev, but it’s clearly not an obvious jump for many)
I would put it like this:
Your weather Entity used to have a “forecast” Attribute, which is how you used to get your forecast data. You perhaps accessed your daily forcast something like this: {{state_attr('weather.myweatherservice', 'Forecast')[0] }}
The forecast Attribute has now been removed. So, what we are going to do is create a new Sensor that contains the forecast data, and then query that new Sensor, instead of querying the Weather Service.
*First: we need to create a new “Template Sensor”, which is triggered every hour, that will query the Weather Service and populate our Sensor for us.
*Now, you can get your daily forecast again, by querying the new sensor, instead of querying the weather integration, like this: state_attr('sensor.my_weather_forecast', 'forecast')[0])
(Obviously the last line etc will change a bit depending on the Template example). But for sure this is far from the smoothest “change” home assistant has had - the documents could be a lot better and describing the transition process IMHO. Lots of people are struggling with this one, for a reason.
When they have a sizeable full time paid team, these kind of snark responses don’t look good. If they want to build a real smart home brand as the recent announcements claim, they have to make clear instructions for people and not snarkily reply to people that they should do it themselves.
Home assistant is still largely done by volunteers, like myself. You will always get snark from me when you complain instead of just simply asking for help.
Just to be sure because I don’t want to break my HA (like you, I’m very new to HA and what should be simple is never explained anywhere for new-comers): does this sensor template setup go in the main HA configuration.yaml file? I tried adding it as a helper to a template binary sensor, but nothing.