You probably have to wait till a lightning strike occurs in the defined area.
Just enabled this - what new entities should it produce? I don’t see any errors in the log, but can’t find any new entities attributable to this integration.
I understand that but still I should get a new entity to show up in HA no ? Will activate back Map in HA just in case !
Does anyone have an example of setting up an automation with this? Would like to have a notification if a lightning strike occurs
docs are here:
https://www.home-assistant.io/components/wwlln/
Entities are generated, updated and removed automatically with each update from the feed.
This may make it tough to automate however
All, please see the Geolocation docs for how to automate this (and any other geo_location
platform): https://www.home-assistant.io/components/geo_location/
I do it the old fashioned way. You hear thunder, you get out of the pool.
Actually this gives me an idea for a project from my old ham radio days which used an inexpensive AM radio receiver to detect lightning strikes and the static build-up a few seconds before the bolt lets loose.
I like the idea, but I’m wondering whether any “smart” switch would really be sufficient protection against a lightning strike. My understanding (and thankfully I’ve never been hit by one) is that even if an appliance or device is turned off, it can still get “fried” if it’s plugged in.
Trying to get it working. I get this error after a restart of HA:
2019-07-20 08:14:56 ERROR (MainThread) [homeassistant.components.geo_location] Error while setting up platform wwlln
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 122, in _async_setup_platform
task = async_create_setup_task()
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 87, in async_create_setup_task
None, platform.setup_platform, hass, platform_config,
AttributeError: module 'homeassistant.components.wwlln.geo_location' has no attribute 'setup_platform'
Regarding lightningmaps.org, you can download data, however you must be a contributor to that network. I.E. you must have the hardware and be an active participant.
On the wwlln, you can download data easily. The URL previously mentioned by @daveb will give you all the current data. You probably want to filter by radius and time window.
I modified bachya’s test programs to do that… It gives an output that looks like this:
`Radius (miles)= 50
Window (minutes)= 60
Number of records= 37
Closest strike key= 6975997
key = 6975997 distance = 2.8637461086570926
{‘unixTime’: 1563817565.0, ‘lat’: 24.82, ‘long’: 1.67, ‘distance’: 2.8637461086570926}
2019-07-22 17:46:05
h:m:s ago = 0:36:29.516275
minutes ago= 36.5
most recent strike key= 6513357
key = 6513357 distance = 33.00594693510524
{‘unixTime’: 1563817975.4, ‘lat’: 24.53, ‘long’: 2.11, ‘distance’: 33.00594693510524}
2019-07-22 17:52:55
h:m:s ago = 0:29:39.116633
minutes ago= 29.6
`.
I uploaded the program to github:
https://github.com/gds32571/wwlln
Be sure to check the settings - lat, long radius, etc.
I have never seen data newer than 30 minutes, so this may not be useful for protecting hardware.
For that purpose, I use an Acurite thunderstorm sensor (06045M), and an SDR receiver connected to a Raspberry Pi with rtl_433, and some software. You might look at my sdr-bash on github.
Let me also add, you can use double pole relays to disconnect both sides of a power connection to gain some reasonable isolation. Here are some pictures of relays controlled by RPis and Home Assistant.
[https://www.flickr.com/photos/88117211@N00/albums/72157709688832461]
Nothing can protect against lightning. But if you use a double-pole relay to disconnect both sides of the power, and the device has only a power connection to the physical world (network is WiFi), then you could have at least a 1000 volts of isolation. Anything is better than nothing.
Just a thought, wouldn’t it better to leave the entity and then just set it to zero if not lightning strikes, increment it if there is, and then set back to zero when there isn’t any lightning strikes. Of course this would be off the range of time the end user sets. So if one sets it for 30 minutes then until there is no lightning strikes within 30 minutes would reflect how many times there was lightning. After the range of time without any lightning strikes the entity would reset to zero.
I agree that does sound perfect.
I’d like to use this component to trigger an automation. As an example, if lightning strikes within the distance in the config, change the state of something (boolean Lightning mode On?) so I can kick off an automation that runs until 30 minutes after Lightning mode is Off. Is this possible?
FYI - I’ve just created custom component for fetching lightning data from Blitzortung.org: https://github.com/mrk-its/homeassistant-blitzortung I’m using websocket connection, so updates are realtime. I’m also following their data usage policy http://en.blitzortung.org/contact.php (component connects to proxy mqtt server instead of direct connection to their servers)
Great job discovering their MQTT usage! Are you considering making this an official submission?
MQTT proxy thing is my own Blitzortung simply requires that third party applications use own servers to provide data to their user. This proxy also greatly reduces amount of data sent to users (it reduces packet size and mqtt allows for subscribing to geographical region thanks to geohashing).
Regarding official submission - yes, I’m planning that, but first I want to test it as custom component (especially performance of this MQTT proxy - currently it is running on small VPS, I wonder how much concurrent connections it is going to serve). Currently I’m adding it to HACS to find more testers.