Colorado Springs Utilities (CSU.org) Energy Scraping

I’m working on some python scripts to log into csu.org and pull down energy readings. Currently I have it working for gas.

If anybody else is out in the springs and interested in testing let me know. This is very much currently a WIP.

  • I don’t really care about electric / water cause I get that data from my solar panels and my flume.

(But if somebody does I think I can easily mod stuff)… Again very much a work in progress.

Perfect! I just installed HA last weekend, and I’ve been looking for a way to extract my info from CSU for tracking purposes for all three (gas, water, electric).

Happy to test this! Also have some proficiency in Python so might even be able to help with coding.

1 Like

I’ll push the code to GitHub semi-soon.

I had it downloading last time I looked at it. But then I ran into ssl cert issues on my dev machine.

I’ve been focused lately on my IntelliFire integration.

But I think the code at last look might be pretty close to working. I think where I left off was setting the date range.

Here is what I wrote so far … It makes a BUNCH of calls to login and set cookie tokens and then finally it will make a call to download stuff… possibly hardcoded some account numbers in there now that I think of it.


   # Download commnad
    data['ctl00$ContentPlaceHolder1$UI_ExternalUserControl1$btnCsv'] = 'Download Spreadsheet Data'
    # Gas Meter
    data['ctl00$ContentPlaceHolder1$UI_ExternalUserControl1$dlLocationID'] = 'N:2646052025:NN'
    return data

Like that looks like maybe something hardcoded… but if you are decent with python give it a once/twice/thrice over.

Thanks for posting this. I’ve confirmed your code works great for me, and your intuition is dead on, the ID in the following line will differ based on each person’s account:

data['ctl00$ContentPlaceHolder1$UI_ExternalUserControl1$dlLocationID'] = 'N:2646052025:NN'

Specifically, the ID 2646052025. Probably need to write some logic that parses the descriptions looking for ‘GAS’, ‘ELECTRICITY’, or ‘WATER’ and then programatically getting the ID based on what you find for the value.

Good news is I was able to use your code and simply switch this ID between any three of those choices in my account and it worked great. Nice job!

1 Like

how does the original data look?

Any desire to make a pr to the GitHub repo?

My coding skills are very elementary. But I’ll be following this (if there’s anything still going on) as I just moved to Colorado Springs and would love to pull my energy usage into Home Assistant.

Nice! Thanks for your work here. This helped me work on a similar scraper using Node.js and Puppeteer, which I am more familiar with. The source is here: Download usage information from Colorado Springs Utilities (csu.org) · GitHub.

I’m hoping to create an integration or Add-on in HA to make this automated.

Awesome. I might be able to work with you on this if you have a working scraper. We could prob put something into hacs

I was initially trying to stay away from anything selenium/puppeter but its SOOO MUCH simpler to go this route

I started a new repo. The only thing that’s a bit funky is I have solar so I have a generated/used option which I haven’t figured out for energy yet… so this one right now does gas.

Since you aren’t allowed to scrape stuff any longer I was thinking I could ultimately make an integration that “hits” a local endpoint which is doing the scraping for you

I ended up going with an “extreme” solution for this, but it works.

We finally got solar panels installed, and the integration reports both power produced by the panel and consumed by my house overall. Took me a while to get it working, and it can only update once every 5 seconds (that’s the fastest the solar panel integration is permitted to log in to obtain data), but I now have it fully integrated into my HA Energy dashboard, and can get a pretty decent idea of my home’s power usage, as well as power produced and pushed back up to the grid.

If anyone wants it, I have a complete write-up of how I did it, using the Enphase Envoy integration (the HACS version, as the “official” one doesn’t support my panel). But if I do that, it’ll be a new post, not another reply to this one.