Anyone got Aurorawatch UK integrated with home assistant? I know there are other aurora integrations but I live in Shetland and specifically want data from their Shetland project.
I was hoping I could work out how to fetch status and activity from here but I’m not a developer and cant even work out how to view the xml for the Shetland site let alone extract the relevant data from it.
I also found this Python project from one of the Aurorawatch team which feels like it could be modified into a HA custom component but I dont have the skills! https://github.com/stevemarple/python-aurorawatchuk
I’m totally open to workarounds too. Anyone got any ideas or advice??
This part of the api is no use. It’s literally just a list of the descriptions of what each alert level means. Nothing to do with live data.
Restful approach is what I had in mind, but the problem is I can’t work out what the relevant URL would be for the XML. It’s the ‘Site activity’ section from the docs that’s of interest, but docs give no example url for this.
Drill down on the right hand side to the data you want.
The path to the json data is at the top of the right hand coloumn. Replace x with value_json and you have the value template information for the restful sensor state.
This definitely put me on the right track. Still took a fair bit of time for me to suss out the rest of it, but learning stuff along the way is part of the joy.
Not bad for a first effort. However there is a better way that does not require the use of template sensors. You can create all the sensors in the rest integration:
The example for the rest sensor documentation really needs updating. This is at least the third time I’ve seen someone do this. I’ll create a PR to add some better examples later.
Thanks @tom_l - i did see this in the docs and tried it. I was constantly switching between the RESTful doc pages to try and work it out but couldn’t get the right syntax. I think some more XML examples in the docs would help too so folk like me can more easily work out the right code for their situation.
I’m struggling to get this to work. The data shown is always midnight and the new values later on in the day are not picked up. Any idea how to make the request take the newest data and not always midnight from the xml?
The value i keep getting with both versions of the code above is 919.2 :
I have set this up, super easy with your instructions thanks! However I can see that you are using sum-activity.xml this is the data from the Shetland site. From browsing here Index of /0.2.5/project/awn/ (lancs.ac.uk) I can see there is a cwx.xml which is from a Cumbernauld station which is closer to where I live than Shetland. If I try to replace sum-activity.xml with cwx-activity.xml I get a 404 error. Do you know how I can switch from the Shetland site to the Cumbernauld one?
I don’t think there is actually any activity data in the Cumberbauld xml file - just details on the available graphics. I think the only available data (activity) feeds are here: Index of /0.2.5/status/project/awn/
You would add this to your configuration.yaml file, but if you are unsure I would suggest making sure you thoroughly read the documentation on manually adding sensors - in this case the RESTful sensor integration: RESTful Sensor - Home Assistant