mrk-its / homeassistant-blitzortung

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

lightning-detector-card support #9

Closed Norien closed 4 years ago

Norien commented 4 years ago

I'm struggling to find a meaningful way to display this in my dashboard. I did come across this in hacs and it looks perfect. Is there any way to get this working together?

https://github.com/ironsheep/lovelace-lightning-detector-card

Thanks for all you do!!

mrk-its commented 4 years ago

This widget looks great, but it is able to only show distance. Blitzortung provides lat/lon coordinates of lightning, it would be great to show it on map, like: https://map.blitzortung.org/#3.76/48.41/15.98 I already did some successful experiments with custom map widget (lovelace card), stay tuned!

sgofferj commented 4 years ago

And there I was just about to open a feature request to display lightnings on the HA map... :smile: The now defunct WWLLN integration displayed the lightnings on the HA map which was kinda nice... There is a canvas-gauge-card for HA with which one could make a relatively nice indicator for the azimuth. That's on my list. @mrk-its Could we have a "detected" entity, which goes from "" to something like "detected" and back to "" whenever a strike within the interest zone was detected

mrk-its commented 4 years ago

@sgofferj I'll check how WWLLN was integrated with HA map, thanks! Regarding this "detected" entity - you can easily achieve such things with template sensor, like:


sensor:
  - platform: template
    sensors:
      is_storm_detected:
        value_template: '{{ states("sensor.blitzortung_lightning_distance") != "unknown" }}'```
sgofferj commented 4 years ago

Successfully made a canvas-gauge-card for the strike direction:

Screenshot_20200804_005621

card_height: 220
entity: sensor.blitzortung_lightning_azimuth
font_size: 1em
gauge:
  borderInnerWidth: 0
  borderMiddleWidth: 0
  borderOuterWidth: 0
  borderShadowWidth: 0
  borders: false
  height: 220
  highlights: []
  majorTicks:
    - 'N'
    - E
    - S
    - W
    - ''
  maxValue: 360
  minValue: 0
  minorTicks: 2
  startAngle: 180
  strokeTicks: true
  ticksAngle: 360
  type: radial-gauge
  valueBox: false
  width: 220
shadow_height: 12%
type: 'custom:canvas-gauge-card'

@mrk-its That works of course. I was more thinking of an entity that triggers for every single lightning to make a sound or flash a light :smiley: But that probably also can be done with some template trickery.

stboch commented 4 years ago

@mrk-its https://github.com/home-assistant/core/tree/5bef1c223d57b8f28d824d0d3c9fd11617c14d91/homeassistant/components/wwlln Here is the link to the historical branch where wwlln was, the code your looking for is geo_location.py this will add the geo event into the map, it will also allow geolocation events to be triggered. I used to have this for an automation if lightning was detected within 20km it would trigger an alert to turn on sensitive devices.

mrk-its commented 4 years ago

@stboch thanks, I've just pushed version with geo_location platform support (ported from wwlln) on dev branch (it would be great if you can test it).

stboch commented 4 years ago

@mrk-its Tested it out, works great... just FYI might want to add a warning to idle timeout if set to 0 it might make the system very unstable over time.

mrk-its commented 4 years ago

@stboch I've introduced separate configuration parameter to configure max number of latest geo_location events to keep in memory (defaults to 100). And there is a warning if set above 500. I'll test it a bit and I'm going to merge it soon to master.

stboch commented 4 years ago

also noticed tick! is set to info level and not filtered by the distance. so kinda filling up the logs.

mrk-its commented 4 years ago

On Wed, Aug 5, 2020 at 7:01 PM stboch notifications@github.com wrote:

also noticed tick! is set to info level and not filtered by the distance. so kinda filling up the logs.

Good catch, I've just cleaned up logging.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mrk-its/homeassistant-blitzortung/issues/9#issuecomment-669312122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAVDCAUHIXHDIRJKL6OLDR7GF5ZANCNFSM4PE2LBCA .

andilge commented 4 years ago

Hi all,

I've just integrated blitzortung with compass card from HACS and it was easy as nothing. compass card

The only drawback i see is that the azimuth sometimes brings back negative degree values 2020-08-11_16-47 which is messing up the calculation for the abbreviations.

Is it possible to only deliver values within 0 to 359.999?

Open issue on compass card is in https://github.com/tomvanswam/compass-card/issues/10

mrk-its commented 4 years ago

@andilge I see it has been fixed on 'compass-card' side, great!

mrk-its commented 4 years ago

Closing, as we have now some great method of visualizing this data. @Norien if you still want support on lovelace-lightning-detector-card please fill issue on their side (it seems to be better place for that)