so i i think i did it right… but its not working… i setup the
icon, temperature low, temperature high, and precipitation… but none work…
the icon one i trying a couple ways… as there is another sensor that shows up so i trying to link but thats not working that way either…
so i def doing something wrong
@tom_l im stuck… i cant seem to convert the sensors to my template sensors… i took your link you sent… and i tried different things… ive tried stats states_attr multiple different ways i can not get the sensor value into the template sensor
today_min:
state: { states('sensor.peterborough_low_temperature') }
#{state_attr{ sensor.peterborough_current_condition}}
#sensor.peterborough_current_condition
#value_template: "{{ state_attr('weather.peterborough_forecast', 'forecast')[0].templow }}"
#value_template: "{state_attr{sensor.peterborough_low_temperature}}"
#value_template: "{{states('sensor.peterborough_low_temperature') |int}}"
#{{ this.attributes.test | default('Value when missing') }}"
friendly_name: Today's mimimal temperature
#availability_template: "{{ state_attr('weather.peterborough_forecast', 'forecast') is not none }}"```
so the sensor is no longer
```weather.peterborough_forecast```
but its
```sensor.peterborough_current_condition```
yet the current condition is in the states of the forecast
so i trying to add
sensor.peterborough_current_condition to my today_min: sensor
sensor.peterborough_high_temperature to my today_max: sensor
sensor.peterborough_chance_of_precipitation to my today_rain: sensor
and the multiple if statements for the Icon
today_icon::
#sensor.peterborough_current_condition
value_template: >-
{% if state_attr("weather.peterborough_forecast","forecast")[0].condition =='clear-night' %}
Ive been fiddling all day yesterday and here and there today... and nothing works i just get errors or unavaliable.. i dont know the right combination... i could use some more help i stuck. frustrated
@armedad
this is my code… it used to be
weather.peterborough_forecast for it all… but now its only some of it and now its sensors… but ya here is the code… but if i need to post in other form i can too
value_template: "{{ state_attr(‘weather.peterborough_forecast’, ‘forecast’)[0].templow }
no longer exists its now
sensor.peterborough_low_temperature
you can see
weather.peterborough_forecast’, ‘forecast’)[0].temperature
no longer exists
its now
sensor.peterborough_high_temperature
you can see
weather.peterborough_forecast’, ‘forecast’)[0].precipitation_probability
no longer exisits
its replaced with
sensor.peterborough_chance_of_precipitation
and you can see
weather.peterborough_forecast",“forecast”)[0].condition ==
no longer exisits
its replaced with
sensor.peterborough_current_condition
and i been having issues getting a number… i did get a value and the value was
sensor.peterborough_current_condition as a state
the rest of the stuff is wrong. but let’s get this part working first.
if you just reduce down to this code (get rid of the rest for now). are you getting the proper temperature when you put this into dev-tools->template:
it all looks like you just took the legacy format and threw it underneath the newer template header… and you didn’t actually convert it to the new format.
take a look at the doc that tom gave and follow the new format:
@armedad ok response i get from the template is unavaliable.
as for legacy… from my orginal post i been using the legacy as you call it… and i been spending last couple days trying to convert it… but it doesnt make sense… and since the weather.peterborough_forecast is now a Sensor not a weather for the 4 sensors i needed… the examples dont show it… the weather page for home assistant doesnt show it… as… as its removed from the weather.peterborough_forecast attributes states whatever you call it… so i been frustrated there
i’m having a bit of a hard time understanding your english, so apologies if i’m not getting what you’re saying…
this:
is incorrect. it is not following the format above.
the right way of doing this is to use the weather.get_forecasts, that will put the results in the response_variable, and then pull the information out of that response variable with this format:
let’s just get the first one working. once we have that working, we can have confidence that the data is being fetched right, then it’s just a matter of getting the info out of the data.
to verify what you said, if you just do the one block of code
if so, let’s fix that. first, where did you put this code?
and also after you made your edits, did you hit the “check confugation” button to make sure it’s all good? then restart home assistant. it won’t load this code automatically…
you’re welcome to try random things as much as you want… eventually a million monkeys in a million years may write shakespear. but i’d suggest that you’ll get a faster result if you don’t try random things and really try to understand the proper format that i’m trying to walk you through…
well they dont give you enough examples. and they only show example to the forecast but like i mentioned 4 sensors have been removed from the forecast and independent sensors… but
forecast next hour is unavaliable it doesnt exist in the list of attributes
sorry i have disxlexia so what i type sound good to me not always to someone else
and what i was trying to say is
Low temperature
High Temperature
Condition
precitpition_probably
are no longer weather sensors
there are plain sensors
they been removed from the Weather sensor and put in there own sensor