mrk-its / homeassistant-blitzortung

Custom Component for fetching lightning data from blitzortung.org
MIT License
212 stars 41 forks source link

Lightning Azimuth Device forces Map to Amsterdam #5

Closed mdframe closed 4 years ago

mdframe commented 4 years ago

I recently identified that my Map in Home Assistant was no longer showing my home location except when lightning was detected in my area and within the 100km radius set in Blitzortung. If a storm is not active my Map moves to Amsterdam. It took me a while to identify why then I zoomed out the map while in Amsterdam and found a LA, Lightning Azimuth, device in northern UK. Once I found this I removed the Blitzortung component and my Map began working as expected again. I can repeat the issue by adding the component back while no storms are in the area. I did not review the code but it seems the component is overriding the home location when no storms are found in the defined radius.

mrk-its commented 4 years ago

Ha - interesting, this is unintended integration with Map widget :), I was able to reproduce it on my HA instance too. Fortunately it doesn't override home location. It seems that home assistant shows on a map any entity with latitude and longitude properties (these properties are defined in home assistant and are used by some entities, HA can use it for presence detection). It looks like a bug in Home Assistant (it definitely should not recenter map to last location reported by any entity as it does now). I can also easily block this behavior on my side - by renaming latitude / longitude attributes to something different, like lat/lon or so.

mrk-its commented 4 years ago

Fixed, by renaming attributes to lat / lon.

mdframe commented 4 years ago

Updated and works perfectly! Thanks for the quick response. Let me know anytime you need help testing.

sgofferj commented 4 years ago

The old WWLLN integration created one entity with lat/lon for each lightning within the configured area of interest. Advantage was that it was not only then displayed on the map but could also very easily be used in automations and with HA zones.