I’d like to know how many hours over the last year my room temperature was above my room setpoint (or I guess a temperature I specify, and over any time range). Is there a way to get that data from emonCMS? I’m not running a version locally (that I remember
maybe I am), I have an emoncms.org account.
If you have an emonPi, then the betting is; you are. A fundamental question: is it a standard emonPi or one customised as a Heatpump Monitor? If it’s a Heatpump monitor, on-line support is included in the price you paid.
Bear in mind that your local emonCMS and the emoncms.org versions are completely separate (different APIkeys & passwords), the only link is the data from your sensors is first received by your local emonCMS and then forwarded to emoncms.org; therefore any data storage and processing you’ve set up on emoncms.org won’t exist in your local version. All that you will have is that which is necessary to send the data. Also, the local version tends to be ahead of emoncms.org when new features are added - which should work in your favour, if you have been recording all the basic data.
Two of the input processes available locally (not available in emoncms.org) are
Input on-time
Counts the amount of time that an input is high in each day and logs the result to a feed. Created for counting the number of hours a solar hot water pump is on each day.
and
If >, skip next
If value from last process is greater than the specified value, process execution will skip execution of next process in list. (Note: this one of a family, each offering a different condition.)
so I think combining these in your (local) temperature input processing would provide you with the data you request ongoing. If you can download the data from emoncms.org with sufficient granularity, you might be able to post-process it for the past year.
Some experimentation is needed as that is the only documentation that exists, and I haven’t played with those functions to determine exactly how they work.
You can also do some clever things with the graphs, but you’ll have to search the forum for this - there’s no consolidated documentation that I know of.
Yeah I’ve remembered now – no local emonCMS, I have a python script that sends ebusd data to emoncms.org.
So should I be able to download say room temperature data from emoncms.org?
I believe you can, but although I have an account, I don’t actually use it - except for answering forum questions, I have no data there.
The Emoncms Sync Module is a way to download data from emonms.org to your local emonCMS.
Or, if you want just CSV data to analyse some other way, then Exporting CSV is an alternative.
As you appear to be familiar with python, then another script to read the CSV file line by line is what you want.
You’ll need an accumulator to store the hours above temperature, a couple of temporary variables to store start & stop times, and a flag to know when you’re above the setpoint.
Set the flag to say above temperature
Check the time and the temperature: if above, set the flag and store the start time.
Then repeat:
read the next line.
If temp is above the setpoint and the flag is set, do nothing;
else if temp is below the setpoint and the flag is set, store the stop time
and calculate the time run, add it to the accumulator, unset the flag;
else if temp is below the setpoint and the flag is not set, do nothing;
else set the flag and store the start time;
to the end of the data.
store the stop time and calculate the time run, add it to the accumulator.
When you get to the end, the accumulator should have the answer you want. You’ll need to convert time in seconds to something more meaningful, like hours.
I can read Python but I don’t know it; even so I’d say this will be easier than trying to get emonCMS to do it.