API query result format changed? 9:45am 17/3/22

Hi all,

I’ve got a script that has been running for years that pulls my usage every 5 mins from emoncms.

Has been working flawlessly until 9:45 today.

Uses a simple call to get data points.

Pre 9:45am

Post 9:45am

What where integer/whole values are now not.
Has something changed behind the scenes?

My code doesn’t like this change… :joy:

1 Like

Possibly related to EmonCMS.org being updated to version 11 this morning.


That’s strange, will see if I can make sense of why this is

1 Like

Thanks @TrystanLea
I’ve just wrapped a bunch of my code with int() so I’m hopefully back up and running for a bit!! :joy:

1 Like

It’s quite bizzare as I cant see anything that would affect rounding like this, as far as I was aware it was always returning data with lots of decimal places, but there must be something subtle that Im missing. Will keep looking, good to hear that you have sorted it on your end in the meantime.

A bit of an update @TrystanLea A bit of my mistake.

You’re right, the API call has been supplying float numbers in the past.
It just seems some of my feeds come back as either integer or float, hence I got confused whilst troubleshooting.

So as you were there, no problem.

BUT, I have found something else that does seem new. I’m getting some null results returned.


It’s this that is causing my script the problems and this looks new behaviour since around 9:45.
I can’t find any reference to ‘null’ results in the last 3 days leading up to 9:45.

I’m happy to send the API calls via DM if they would help?

Cheers, Mick

Aha, ok, if you enter add &skipmissing=1 to the URL it will get rid of that. I realise now that I’ve changed the default behaviour to including missing values for the timestamps range that is requested. I will look at that a bit closer to see if the old default can be reinstated.

1 Like

Thanks @TrystanLea
Will make that change. :+1:

1 Like

My PV output upload (pulls data from emoncms, post to PVOutput) stopped working for the same reason.

Adding skipmissing to the headers resolved it.

Just need to work out how I go back and fetch 18 days of missing data.

Sorry about that @greentangerine how did it end up being 18 days missing?

I only noticed today that the cronjob that runs every five minutes on the emonpi stopped working on the 4th March.

The data should still be there on emoncms, just hasn’t been uploaded to PVOutput. I’ve also learnt how to code Python to be more resilient to NoneType exceptions (you wouldn’t think that coding has been my paid job for 34 years!)

I guess I just need to copy my script and modify it to query emoncms for the missing interval as a one-off. Will get around to that over the weekend.

1 Like