I’m trying to find a solution which will allow me to shut down systems (located in a house in Brisbane) is a thunderstorm is headed towards the area based on warning data online. The process would be running RaspberryPi-OS on a Pi-3b+ as the primary controlling machine (it will remain on) and I’d like to run a script to check a source for alerts and warnings in the Brisbane area; presuming I’d source this from either the BOM or perhaps one of the state power authorities. I was hoping to run a BASH script in the cron scheduler (say, every 5 minutes) to check for elevated risk or a warning and then issue shutdowns accordingly. I can handle the shutdowns and so forth; it’s the data source I’m not as sure about. The systems are running on surge/spike protected boards (nothing too elaborate, it’s just a domestic setup) but I’d ideally like to shut down the systems in a civilised fashion if it’s getting rumbly outside. I’m not in the area myself (I’m in the UK so 10 hours behind), hence the desire for some automation. Has anyone seen a method for this that’s already been built for such a purpose? I was assuming I’d end up curling a site and looking for set keywords but I was wondering if there was a more precise method that someone could suggest. Thanks!
Hmm... could you consume BOM_Qld twitter feed and scan for "thunderstorm warning" and then maybe your local area? See an example tweet below... https://twitter.com/BOM_Qld/status/1338287881769652226 Not sure what area's they have, or even if the tweets are automated and if so have a mostly standard format.
I'd personally just grab a UPS if it's nothing too intensive. Pretty easy to gracefully shutdown IF you lose power, rather than jumping on "weather warnings" - Just read you're in the UK, anyone that can plug it in for you?
Sounds to me from the description that he wants to protect his gear from electrical strikes rather than power loss.
Possibly, he said he's running surge/spike protection though - my interpretation was he wanted to be able to shut things down properly to prevent data loss
Woah thanks guys - appreciate the responses so quickly. Yep he's got a basic surge protection layer but nothing terribly fancy. I'm a little iffy on the protection value the lower end UPS's offer this type of setup, I've had mixed experience with them; the cost of a "proper" one would outweigh the value of the systems generally speaking. The guy who owns the kit works shifts and I'm trying to cater for running conversion jobs when he's at work (it's converting video with FFMPEG, converting a collection of videos to a more practical format but we have to use software for quality reasons so conversions take horrendous amounts of time). My thinking was to either stop the job or issue a hibernation order to the compressing machine (it's just running Debian 10.7 on an i7-4770). I was even thinking of a way of having a relay physically disconnecting a power chain (physical disconnection of the power boards), I think there's a device out there that could do this with a couple of wires from the Pi's GPIO pins. I've been curious about this method for some time actually, for example an automated method to "batten down the hatches" ahead of an incoming storm (doing things like retracting shade cloth sails, raising roller-shields on vulnerable windows, etc.). I heard of one which was set up to adjust the configuration of a greenhouse based on sun levels and storms, etc. which was quite clever; methods to do this are becoming cheaper now with ESP32 chipsets and off-the-shelf IoT devices becoming a little more mainstream. I'll look at that BOM feed and the Twitter feed too - I wondered if there was an IFTTT trigger or something out there, I think this would be quite a valuable service to provide for homes and industrial applications potentially. I've heard there are some here in Blighty which can do that for coastal areas but I've never looked into it.
I'll be interested in what you develop as I'd like much the same capability to automatically close a skylight rather than relying on a rain sensor.
Brisbane council runs a free service - https://www.brisbane.qld.gov.au/com...r-alerts/brisbane-early-warning-alert-service
That website mentions "push notifications", but doesn't say how to use them. That is the tech you want, see Server-sent events
Their notifications are mobile app notifications as they mention via the Weatherzone app. Email notifications could be useful from a serverside point of view. A bit more mucking about than just polling an api endpoint though.
Nah. If they had an SSE enabled endpoint, it's like 4 lines of code in python. I found an undocumented api being used by some apps on github. Code: # You can do a search for a location with; https://api.weather.bom.gov.au/v1/locations?search=Per # Then say I want Perth Airport ID=qd66qf4, see it's info with ; https://api.weather.bom.gov.au/v1/locations/qd66qf4 # And it's current "observations" with; https://api.weather.bom.gov.au/v1/locations/qd66qf4/observations # And warnings probably come through; https://api.weather.bom.gov.au/v1/locations/qd66qf4/warnings Alternatively, they do have warnings RSS feed on the BOM that might be helpful: http://www.bom.gov.au/rss/?ref=ftr But looking at weatherzone, they do have a business orientated feature called Total Lightning Network that might be above and beyond any basic/free resources.
Wow thanks everyone (sorry have been ill the past few days, my health is shocking). I'm going to look at those APIs and the feed, I'm not yet skilled in python (usually try to mush things together in BASH scripting but it's probably out of scope for that).