However the wind chill temperature is defined only for temperatures at or below 10 °C and wind speeds above 1.34 m/s.
Is it somehow possible to integrate this into the template, so when these conditions are not fulfilled the wind chill temperature shows “NA”?
When I try this out within the template tool I get a wind chill value that is higher than the current temp. At the time of testing this my ‘Sensor.dark_sky_temperature’ was 49.4 and the sensor.dark_sky_wind_speed was 11.25. The Wind chill value provided from this template gave me 59.3 (these are all Fahrenheit). I wasn’t expecting a higher value than the current temp. Something I am doing wrong or does the calculation change for Fahrenheit?
{% if states('sensor.dark_sky_temperature') | float < 50 and states('sensor.dark_sky_wind_speed') | float > 1.34 %}
{{(13.12 +0.6215*float(states.sensor.dark_sky_temperature.state) -11.37*(float(states.sensor.dark_sky_wind_speed.state)*3.6)**0.16 +0.3965*float(states.sensor.dark_sky_temperature.state)*(float(states.sensor.dark_sky_wind_speed.state)*3.6)**0.16) | round(1) }}
{% else %}
NA
{% endif %}
**Edit - the formula does need to change for Fahrenheit. Everything in bold & italic I updated in the formula but what I am not sure about is the (states.sensor.dark_sky_wind_speed.state) *3.6)*0.16
Does this value need to change?
Please read tinkerer’s sticky at the top of the forum and post code in the proper format (use the </> button)
Looking at your profile I’m willing to bet that this was just a mistake though
I rarely have access to the entities to be used in other people’s instances.
So I use the template editor where I can.
I still post the code so that others can read it.
(eg where are the line breaks, spacing (mono space font used), quotation usage etc. - but… whatever you are happy with)
Good luck.
What error.? You don’t specify ?
Though looking at the template and you specifying that it only happens at restart would lead me to think that it’s the use of " states. " rather than " states ()" the former can give errors if the sensor is unavailable.
I’m not sure, will have to try this in my template editor, but I’d be willing to bet this is a result of (‘unavailable’ * 9 / 5) | float or some such.
Try reconfiguring the template to use states()
Use finity’s example given above, it uses the correct syntax to avoid these errors, just convert it to the entities you use.