Community
OpenEnergyMonitor

Community

Graph not rendering as I'd expect

Hi All,

Please forgive my hand drawn artwork :smiley:

I am pushing data from a Samsung smart plug into EmonCMS. The plug operates over Zigbee so its very frugal with its data use as many devices on the network are battery powered.

This means that it only sends power level updates when the level actually changes. I push this into a PHPTimeSeries feed.

Unfortunately the graphs are terrible though. EmonCMS is drawing a straight line from the last sample at 0 the day before to the next sample at 1100W when the pump turns back on.

Is there any way to have the graph render properly, with a horizontal line to the next sample is taken, like my hand drawn graph, which is what is actually going on?

The graph isn’t ‘terrible’ it is doing what you ask of it based on the data you are storing.

Timeseries feeds expect a value for every slot, if nothing is received, by default, it records NULL. This can be what is required.

You could play with the input processes available to record Zero if the input is NULL. It isn’t a built in process - @TrystanLea, perhaps it could be added?

Isn’t that what the emonCMS datatype PHPTIMESERIES is for?
e.g. record data that’s coming in at variable intervals.

Ref: Data types - which one should I use?

Thankyou @borpin

The data is coming in only when the power level changes - this is how the data is collected - Push data from SmartThings via WebCoRE into EmonCMS

The way SmartThings reports power is exceptionally efficient - I would have to do something ugly like write the previous value to the emoncms database every 5 minutes to get a graph that renders accurately, and that seems like a waste.

@Bill.Thomson - exactly - I’d broadly expect TIMESERIES to render per my hand-drawn graph given the descriptions you linked to.

Data1, Time1
Data2, Time2

if data1 is 0 at time1, and data2 is 100 at time2 then a graph will draw a straight line between data1 and data2.

It doesn’t know that the instant before Data2 it was still 0.

Sorry, I don’t know how to display what you want, I just know the graph is drawing what you are asking of it.

How would it be a waste? You’d just get a graph with 5 minute resolution. If you can live with that, it should be OK. The problem comes when the data arrives at intervals greater than emonCMS expects.
If the interval is fixed at, or very close to, 5 minutes, you should be able to set the interval to 5 minutes and get the graph you’re looking for. (The PHPFINA drop-down-menu interval choices are 5, 10, 15, 20 and 30 minutes, as well as 1 hour, and 1 day) Otherwise, use PHPTIMESERIES.