So basically I’ve started using the SSE endpoint https://lyn.met.no/events which sends events which I consume with Node-Red and pass to HA via MQTT. They arrive on the form:
{
"timestamp": 1686923705,
"longitude": 9.658,
"latitude": 61.9885
}
Currently I’m using this template to figure out how far the lightning strike is from my home:
{{ distance(trigger.payload_json["latitude"], trigger.payload_json["longitude"], 'zone.home') }}
Then I alert if a lightning strikes less than 500m from my home. But I’m not storing this data any way.
What I would like is to be able to store the events from the last say 30 minutes, and display them in a map. Maybe with different color depending on how recent they are. But how can I store this data in a useful way and how do I keep it updated?
Would a python script be the only approach or is there some time of sensor that supports this? I “could” do more filtering in node red on location etc, but that means I need to pass location data to Node-red first, and it just seems a bit fiddly to me.