Water levels and flows are regularly monitored, usually every 15 minutes. However, data is transferred back to the Environment Agency at various frequencies, usually depending on the site and level of flood risk. Transfer of data is typically once or twice per day, but usually increases during times of heightened flood risk.
I use requests to test parsing of JSON, this may help you out…
Your findings are correct, the fact that the response if different for some stations, would make it harder to create a sensor. Even harder if the response would change depending on the data (let’s hope that’s not the case )
as far as I can see, the code you posted should indeed work for that station
I have no idea. I’ve been playing with this for a couple of hours now and I’m getting the same results as you. Templates are why I started using appdaemon. It may take a dozen lines of code, but at least I don’t have a headache at the end of the day.
I’ve given up with this. I think I am going to write a bit of middleware that spits out single value for the template to read.
Or read about about appdaemon. (Still learning how HASS works)
Appdaemon is an addon to HA that allows you to write python apps that let you write automations in python for HA. It has a very full featured and easy to use API. If you are even marginally comfortable with coding I highly recommend it.
Ok I got bored today and played some more. With just a little additional coding, I added support for US rivers.
I can add other attributes to show up in the card that pops up when you click on the sensor too. So I could theoretically add the flow rate, and any other information included in the json file too.