Thunder and lightning, very very frightening…
Summer in Norway means lightning and thunder. And as most people know, there is some equipment in the home that is not too fond of lightning. But how can a smart house then help you take precautions when it starts lightning?
With the help of a plug-in for Home Assistant that retrieves data from Blitzortung.org, it is possible to get a little extra help from the automation in one smart home
Blitzortung.org is a service that tracks lightning strikes in real-time. By connecting this service with a smart house, it is possible, among other things, to get a notice in time before the lightning strikes come close to your house.
The first thing you have to get in place is the integration. This can be downloaded from https://github.com/mrk-its/homeassistant-blitzortung
Follow the instructions here on how to install the integration.
After the integration is in place, you must add the sensors in the Home Assistant. This is done under “Integration”, search for Blitzortung. When this is set up, it is standard that the sensor follows lightning strikes that are 100 km from your home. The GPS information about where your home is, the system automatically retrieves from Home Assistant, and what you have selected under “General configuration” when Home Assistant was installed.
You now have 3 entities in Home Assistant:
- Lightning Aziumth
- Lightning Counter
- Lightning Distance
For the automation, we will use Lightning Distance
The trigger will be the number of kilometers from home. In the example here, we have set this to 10 km. That is when the automation kicks in if there is a lightning strike that is closer than 10 km
The execution is relatively simple here. All we want is to get a push notification on the mobile. But to get a little more info than a simple message, we will set the distance to the last lightning strike in the message as well. We do this by entering {{states.sensor.blitzortung_lightning_distance.state}} in the message.
You will now receive a message on your mobile phone when there is a lightning strike less than 10 km away from the house, and the distance to the lightning strike is in the message.
The rest is now up to you …