Blitz-LightningTracker
A Home Assistant blueprint that sends rich notifications with maps when lightning strikes nearby. Designed specifically for the Blitzortung Lightning Detector integration.
Features
Real-time lightning detection - Get notified when strikes occur within your specified distance
Interactive maps - Static map images in notifications with yellow lightning-themed pins
Mobile notifications - Works with Home Assistant mobile app
Highly configurable - Customize distance, cooldown, and notification content
Google Maps integration - Optional static map images (requires API key)
Prerequisites
Required:
- Home Assistant with mobile app installed
- Blitzortung Lightning Detector integration configured
- The following Blitzortung sensors:
- Distance sensor (e.g.,
sensor.home_lightning_distance)
- Distance sensor (e.g.,
- The following Helper Sensors (see install instructions for a template):
- Latest Lightning Entity ID sensor(e.g.,
latest_lightning_strike_entity_id) - Area sensor (e.g.,
sensor.latest_lightning_strike_area) - Last Strike Distance helper (e.g.,
input_number.lightning_last_distance)
- Latest Lightning Entity ID sensor(e.g.,
Optional:
- Google Maps Static API key - For map images in notifications
- Get one at: https://console.cloud.google.com/apis/credentials
- Enable “Maps Static API”
- Free tier should be more than enough
Installation
Method 1: Direct Import (Easiest)
-
Add Required Sensors (choose your method):
If you have a separate sensors.yamlfile:- Download
sensors.yaml - Copy the contents and add them to your existing
sensors.yamlfile - Download
input_number.yaml - Copy the contents and add it to your existing
input_number.yamlfile
If you use configuration.yamlwith existing yaml sensors:- Download
sensors.yaml - Copy the contents and add them under your existing
sensor:section inconfiguration.yaml - Download
input_number.yaml - Copy the contents and add them under your existing
input_number:section inconfiguration.yaml
If you’ve never added YAML sensors before:- Download
configuration.yaml - Copy the contents and add them to the end of your existing
configuration.yaml
- Download
-
Restart Home Assistant to load the new sensors
-
Configure the blueprint with your Blitzortung sensors and mobile device
Method 2: Manual Installation
- Download
lightning_tracker.yaml - Copy to
/config/blueprints/automation/lightning_notification.yaml - Proceed to follow steps 2 - 4 above.
Method 3: Beta Installation
!! ONLY USE THE BETA IF YOU’VE ALSO UPDATED TO MY INTEGRATION !!
I'm aware this is a beta build and I've updated
Configuration
Required Settings:
- Lightning Distance Sensor - Your Blitzortung distance sensor
- Lightning Area Sensor - Sensor showing strike location name (Provided in sensors.yaml)
- Mobile Device - Select from dropdown of mobile app devices
- Maximum Distance - Distance in km to trigger notifications (default: 7.5km)
Optional Settings:
- Google Maps API Key - For static map images
- Include Map Image - Toggle map images on/off
- Cooldown Period - Minutes between notifications (default: 1.5 min)
Blitzortung Integration Setup
If you haven’t set up Blitzortung yet:
- In Home Assistant: Settings > Devices & Services > Add Integration
- Search for “Blitzortung Lightning Detector”
- Configure with your location coordinates
- Wait for sensors to populate with data
Troubleshooting
REST Sensor Not Working?
- Check that the coordinate sensors have valid data (not 0 or unknown)
- Verify internet connection for OpenStreetMap Nominatim API calls
- The area sensor updates every hour (
scan_interval: 3600) to avoid API rate limits - Change the User-Agent in the REST sensor to your name/project
Missing Sensors Error?
- Most common issue! Make sure you’ve created the additional sensors in
configuration.yaml - Restart Home Assistant after adding sensors
- Check Developer Tools > States to verify sensors exist and have data
Sensors Have Different Names?
- Your Blitzortung sensors might have different names than the examples
- Check Developer Tools > States for entities starting with
sensor.blitzortung_ - Update the template sensors to match your actual entity names
No Map Images?
- Verify your Google Maps API key is correct
- Ensure “Maps Static API” is enabled in Google Cloud Console
- Check that Include Map Image is enabled in blueprint config
Wrong Device Selected?
- The blueprint auto-generates the notification service from your device selection
- Make sure your mobile device has the Home Assistant app installed and configured
Sensors Not Found?
- Ensure Blitzortung integration is working and sensors have states
- Check sensor names match the pattern:
sensor.*_lightning_*
Contributing
Found a bug or want to add features?
- Fork the repository
- Create a feature branch
- Submit a pull request
Made with love for the Home Assistant community