Skip to content

ironsheep/lovelace-lightning-detector-card

Repository files navigation

Lovelace Lightning Detector Card

Project Maintenance

hacs_badge

License

GitHub Release

Release

I picked up an inexpensive lightning detector sensor based on the AS3925 integrated circuit on a small circuit board from Sparkfun (where i spend too much money ;-)) and attached it to one of my Raspberry Pi's that I had sitting around. I then installed my software (see my detector project) to talk to the AS3935 on the RPi and forward what it detected to my MQTT broker which was then forwarded on to my Home Assistant installation. This Lovelace Card provides a means to display this lighting detector data in an easily interpreted form.

Where to get the AS3935 sensor board

Please visit my sensor project for detail on how/where to get the sensor and for the software needed to send the data to Home Assistant. [See my lightning-detector-MQTT2HA-Daemon project.]

About this card

This is a Lovelace card showing you lightning in your local area as detected by your own inexpensive sensor. The card has range-rings that when colored indicate that lightning was detected at that range. There are additional details describing when the detections first started (Storm began) how frequent and how stong the detections are (relative power).

Discovered by Home Assistant

With this card you can see a storm approach and how strong it is and when it leaves. You'll also see storm details such as when it started and when it ended.

Here are a couple videos showing the card in action:


If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices!

coffee


Installation

Use HACS (recommended) or download lightning-detector-card.js from our Latest Release and place it in your www directory.

In your ui-lovelace.yaml (or resources.yaml, whichever you use for resources) add this:

- url: /hacsfiles/lovelace-lightning-detector-card/lightning-detector-card.js
  type: module

If you don't use HACS please change the url accordingly.

Card Configuration

Name Type Default Description
type string none 'custom:lightning-detector-card'
entity string none use sensor.current_ringset or sensor.past_ringset (where "sensor" may be different in your installation)
name string none Override name for card
show_name bool false use true/false to show/hide name

Example Lovelace Card Configuration

This following example is from my current test installation.

  - type: 'custom:lightning-detector-card'
    entity: sensor.current_ringset
    name: "Lightning Detector"
    show_name: false

  - type: 'custom:lightning-detector-card'
    entity: sensor.past_ringset
    name: "Lightning Detector (Prior)"
    show_name: false          

Sensor settings affecting this display

The Lightning MQTT Daemon sends some settings to this card. These settings are:

Name Type Default Description
period_in_minutes number 5 display detections during this period.
number_of_rings number 5 number of rings [3-7]
distance_as string km distance units [km, mi]
end_storm_after_minutes number 30 mark storm ended after no further detections during this end period.

To change any of these you'll want to modify the config.ini for your sensor and restart it. This card will then automatically pick up the new values.

Credits

  • iantrich for the card template and cards you've created which made my implementation effort much easier.
  • RomRider for color handling examples as well as other techniques I "borrowed".

License

Copyright © 2020 Iron Sheep Productions, LLC. All rights reserved.
Licensed under the MIT License.

Follow these links for more information: