This blog is to detail the changes made to my external sensor. (Hot Water)
I've had a few days to apply some thought and to review what information was relevant.
In my post here eLDERmon Graphs I made this comment
It has highlighted that the Hot Water temperature sketch needs adjusting.
Currently it will send if the temperature varies by 0.1 deg, and for this purpose that is too fine.
I really need to apply some logarithmic scaling, or incorporate time into the decision to send or not to send.
At the moment the RF isn't causing any issues, but it is consuming lots of RPi time.
Currently the sensor sends when the temperature changes by 0.1 deg.
if (t > (tempValue_previous + 0.1)|| (t < (tempValue_previous - 0.1))) // only send if not the same { //send data theData.deviceID = 6; theData.var1_usl = millis(); //theData.var2_float = f; // Fahrenheit theData.var2_float = t; theData.var3_float = 0; radio.sendWithRetry(GATEWAYID, (const void*)(&theData), sizeof(theData)); tempValue_previous = t;
This produces a very nice graph, but it also contributes lots of RF 'noise' and gives little additional information.
It is was solar or battery powered the consumption would be a problem.
I want to know when the Hot Water was being used and for how long.
slightly modified graph with the relevant points of interest.
The graph above does not show an extended use (shower), but if the top was flat I'd expect to know when it started dropping as well.
Modified sketch
I have modified the transmitter sketch, to only look for a 0.5 degree change, and to report the first increase, keep track of the climb, and report the top.
Once there it looks for a drop and reports, then tracks the drop and reports at the bottom OR if it climbs again.
edit 04/04/18
It appears that this sat in draft form until I discovered it today.
I had asummed that there was some glitch with a red banner of death, and the content was copied into another blog post.
Seems that was wrong ... it also explains why I thought I had posted the modified code and couldn't find it
Mark