Comments (2)
Yeah I have been seeing this for a while and have been ignoring it. Feel free to make a PR or suggest code to change it
from bom-weather-card.
I was finding it difficult to see the wood for the trees in the error log so I went looking for solutions and have managed to cull them back a bit!
It seems a recent HA update has caused a number of template sensor issues and this you-tuber provided a couple of solutions.
https://www.youtube.com/watch?v=7349L0CFi-M&t=713s
My crude way is to set a dummy numeric value of 0. This seems to work to get rid of the error but leaves the heat index as =0 when it would have been 'n/a'.
Also, doing this I don't think it would ever hit the 'Normal' tag... but then whats the difference between Normal and n/a!
# Heatindex
# https://en.wikipedia.org/wiki/Heat_index
heatindex:
unit_of_measurement: °C
device_class: temperature
value_template: >
{%- if states('sensor.nowra_temp') | float(default=0) > 27 and states('sensor.nowra_humidity') | float(default=0) > 40 -%}
{% set T = states('sensor.nowra_temp') | float(default='n/a') %}
{% set R = states('sensor.nowra_humidity') | float(default='n/a') %}
{% set c1 = -8.78469475556 %}
{% set c2 = 1.61139411 %}
{% set c3 = 2.33854883889 %}
{% set c4 = -0.14611605 %}
{% set c5 = -0.012308094 %}
{% set c6 = -0.0164248277778 %}
{% set c7 = 0.002211732 %}
{% set c8 = 0.00072546 %}
{% set c9 = -0.000003582 %}
{% set HI = c1 + (c2 * T ) + (c3 * R) + ( c4 * T * R ) + ( c5 * T**2 ) + ( c6 * R**2 ) + ( c7 * T**2 * R ) + ( c8 * T * R**2 ) + ( c9 * T**2 * R**2 ) %}
{{ HI | round }}
{%- else -%}
0
{%- endif -%}
heatindexrating:
value_template: >
{%- if states('sensor.heatindex') == '0' -%}
Out of range
{%- elif states('sensor.heatindex') | float(default='n/a') >= 54 -%}
Extreme danger: heat stroke imminent
{%- elif states('sensor.heatindex') | float(default='n/a') >= 41 -%}
Danger: cramps, exhaustion heat stroke probable
{%- elif states('sensor.heatindex') | float(default='n/a') >= 32 -%}
Extreme caution: cramps and exhaustion possible
{%- elif states('sensor.heatindex') | float(default='n/a') >= 26 -%}
Caution: fatigue possible
{%- else -%}
Normal
{%- endif -%}
from bom-weather-card.
Related Issues (20)
- Ability to make certain sensors come from different providers? HOT 2
- when unpkg.com is misbehaving, the bom card won't render. HOT 4
- Daytime_high and daytime_low display values differently HOT 10
- Increase overall scaling HOT 1
- Authenticated depreciated HOT 1
- Installation procedure problem HOT 3
- BOM Integration HOT 3
- How do i configure another weather provider than BOM? HOT 1
- Display Location Title HOT 1
- Clarification of directory structures for manual install in readme HOT 3
- Custom element doesn't exist: bom-weather-card. HOT 2
- BOM Radar Card HOT 1
- After latest update, card shows up minimized on dashboard
- BOM forecast weird indentation HOT 4
- Commit #85 does not allow UoM from entity HOT 14
- Layout Broken and/or new version not detected? HOT 22
- Average calculation failing for today_temp_bom HOT 3
- Card doesn't work well with HA 2022.6.x HOT 9
- bom_today_max and bom_today_min template sensors HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bom-weather-card.