tomvanswam / compass-card

A Lovelace card that shows a directional indicator on a compass for Home Assistant
MIT License
172 stars 19 forks source link

Fallback when atimuth entity has state "unknown" #176

Open andilge opened 3 years ago

andilge commented 3 years ago

Hi there,

I’m using the compass card for lightnings, add-on blitzortung.org and it works flawlessly. I have one little problem though, when there is no lightning activity (95% of the time) the add-on brings back “unknown” in the azimuth entity and compass card falls back to default azimuth 0°, north. Please find cause and effect in the picture attached. I've also attached my lovelace card if it's necessary to reproduce the case.

Since “unknown” is not an integer or float value, the band filter doesn’t show any effect. As a result many times I have zero lightning in north which is a bit annoying., but not really a problem => low prio enhancement.

I'd like if there was either a filter for "unknown" or a transformation into a negative number like -361 (one more degree than a full circle).

All the best, Andi

azimuth entity + lovelace card lovelace card.txt

tomvanswam commented 1 year ago

All degrees outside of 0-359 get recalculated to be between 0 and 359. So having a value of -361 would get recalculated to 359 and show there.

I'll look into having a separate filter for non numeric values as this could help out with issue #778