nlAlert for HA

I don’t know if this is really a show off,
As I have created this with the help of AI.
I’m not a python dev and didn’t have the time the learn the language.

You need to have pyscript running in HA

then you can run this script. and the total amount of nlAlerts of your specified location will be written back in
input_number.nlalerttotalamount
you can provide nothing, then it uses zone.home,
you can provide lat/lan,
or specify a zone.

If there is a TEST message, the input_number will get raised.
stop_at is not taken into a count because the filling is unreliable. The value is always one hour after the start, so you still don’t know if the alert is really gone.

I use this to stop my ventilation system in of an alert, because that could mean toxic air.

Edit: I excluded the testmessage so at least only my ventilations stops when something real is going on