Skip to main content

Power Move - niche way to show how much energy used between 4 and 7

  • February 22, 2024
  • 5 replies
  • 310 views

Tron Burgundy
Carbon Cutter*****

This is going to be used by absolutely nobody but just in case…

I’ve found I’m outside the target to get any power move credit this month and I wondered how far off I was after getting the mid-month email.  I went to each daily page and was totting up the kwh used between 4 and 6.30.  What a nightmare.  So I wrote a tiny bit of javascript that’ll do it automatically.

If you press F12 while viewing your daily usage in a browser you can put this into the console bar:

(() => { let spans = document.querySelectorAll("span[data-testid='usage-table-data']"); let totalP = 0;for (let i = 32; i <= 37; i++) totalP += parseFloat(spans[i].innerText.match(/\d+\.\d+/)[0]); return totalP.toFixed(2); })()

It’ll show something like ‘0.46’  you can also save it as a watch expression to make stuff easier.

You still have to paste the result and total day’s usage into a spreadsheet.  Like I said.  Niche.

“Yeahhhh, riiiight” is definitely a valid response to this.

5 replies

  • Carbon Catcher*
  • 38 replies
  • February 22, 2024

This really is an innovative piece of work. Like most people I’ll stick to the easy solution of just keeping the energy usage down between 4-7pm. Maybe its just easier for me as the storage heating and hot water heating overnight ensure a lot of my energy is used at this time.


Firedog
Plan Zero Hero
Forum|alt.badge.img
  • Plan Zero Hero
  • 2006 replies
  • February 22, 2024

Mine’s nicher than yours …

Sign in to your account*, then in a new tab visit https://smartpaymapi.ovoenergy.com/usage/api/half-hourly/nnnnnnn?date=yyyy-mm-dd

having substituted your own account no. for nnnnnnn and putting the date you’re interested in at the end.  

With any luck, this will reveal a page of JSON data with all the half-hourly quantities to the nearest Wh, which I’m sure you’ll be able to manipulate. Since this is the basis for the webpage as displayed, you won’t get any more data from it than you can see in the browser: you just get more precise data.

 

 

*   The access token currently only lasts for 30 minutes; if you get an error message, return to the account tab and refresh it to trigger a new sign-in. Then refresh the API page.

And if this does happen to you, please consider upvoting this idea 🙂

 

PS Check your PMs: Inbox overview
You’ll find lots of other API goodies by checking where the site gets its data from in the network tab.


Forum|alt.badge.img
  • Carbon Cutter****
  • 18 replies
  • February 22, 2024

👍


Tron Burgundy
Carbon Cutter*****
  • Author
  • Carbon Cutter*****
  • 43 replies
  • February 22, 2024

Or create a bookmark, edit it and change the url to 

javascript:(()=>{let e=document.querySelectorAll("[data-testid='usage-table-data']"),t=0;for(let a=32;a<=37;a++)t+=parseFloat(e[a].innerText);alert(t.toFixed(2))})()

Then click that on the usage page for electricity only.

Now I know you can get all the data from the API I’ll knock up a page to do the whole lot and calculate the percentage for the whole month.  I’ll either post it in here or do a new thread.  It’ll be a few days as I’ve got things to do.

 

 


  • Carbon Cutter****
  • 65 replies
  • February 22, 2024

Did something similar in MS Excel by a simple formula. However didn't have the in depth knowledge to get around any anomalies such as missed readings.

Won't be trying Tron's method as I don't know Klingon!

However this is highly imaginative and entertaining stuff from the contributors. So keep it coming.

Regards to all.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings