Hi,
First time poster. I’m trying to get a GeoNetNZ Quake alert setup so that when an earthquake happens in a certain part of NZ, I get a notification to my mobile phone. I’ve got GeoNet setup as follows in my configuration.yaml:
geonetnz_quakes:
radius: 100.0
minimum_magnitude: 4.5
latitude: -41.1249
longitude: 175.0656
This is setting up a sensor correctly. However, I’m unsure how to configure an automation to send an alert when a quake goes off from the sensor. If I try using a state trigger, it gets triggered each time a scan is done (I think) as I get numerous alerts every few minutes.
trigger:
- platform: state
entity_id: sensor.geonet_nz_quakes
condition: []
action:
- service: notify.persistent_notification
data:
message: Earthquake of 5.0 or more has hit NZ
I can’t tell how to hook up the trigger to some form of “number of quakes changed” state change either, as I can’t seem to find any references to an attribute of that sort.
I’m probably missing something obvious, is anyone able to point me in the right direction?
Thanks,
GMG.