Post device statistics to Open Energy Monitor or EmonPi


This Piston will trigger when any device reports a statistic that you’d like pushed into EmonCMS, either on an EmonPi or

Just select all the devices you’d like to log temperature from in the devTemperature variable, for example.

If you want to log any other property you can DIY quite easily.

I’ve posted an anonymised version of the Piston here however an important part of it is the URL and the anonymised version wipes it out, so here it is:

Confirm the URL for your installation on the Input API help page (link in the top right of the Inputs page).

The remaining issue is that the data is only posted when something changes - this is fine for temperature and energy but EmonCMS assumes that you can draw a straight line from one sample to the next. This results in power graphs that don’t make much sense, as below:

A power graph from a similar load taken from an EmonTX looks like this:

But event driven Temperature logging makes much more sense:

Issues with web GET truncation

I haven’t examined your code yet, but a quicknote about green vs red snapshot

IF there is nothing private, then posting a red snapshot is sometimes useful, but please do not include the red import code. That is private (and will only work for you anyways) I edited your pic above for your safety.

Long story short, if you must post a red snapshot (for a visual aid), it helps to also manually post a GREEN import code to go along with it. (so others won’t have to type it all out)


Thanks @wmcore I’ve posted an anonymised version now and revised my post to include the URL… Do I need to keep the copy I published in my dashboard for people to use it, or can I delete it now?

I had to make a copy that didn’t include my personal EmonCMS API key.


It can be deleted… but good practice would be to test importing it first.

I have seen a good number of corrupted import codes in the past, and this at least makes sure that it will work for others before you delete it.

Pro Tip:

If you think you may improve upon this piston in the future, you may want to consider just PAUSING the piston. (it will not function until it is resumed)

That way, if you get creative ideas, it’ll be easy to add them to the current piston, and re-upload a fresh green snapshot for others.

(I tend to rename these pistons slightly so they stay grouped together in my paused pistons down below)


I’ve revised the post with a completely new piston with a much shorter URL. In certain circumstances the old complex URL was getting truncated.