Reset Data of a node

Started by rocsta, May 06, 2016, 03:31:48 PM

rocsta

Hi all,

I'm working on a little project (not TrapControl, this is no "Little Project"):
I measure and display the temperature of a refrigerator . Everything works fine, but I have one problem:
The Refrigerator is off for some days/weeks/months for some reasons.
In some cases I switch it on, put something in and I would like to monitor the temperature for around 6 days.

But the graph shows all values. So, as an example, today we had 20° C, when I Switch on the refrigerator, it falls to 2-3° C. Now the graph shows all values from 20 to 2-3° C. I can not really see the calues of the last 2-3 hours, I would like to check, if they are between 1 ans 6 °C.

So, one possibility could be, just to "reset" with a button the Node and delete the values, when switching it on.

Do you have some hints, how to handle this?

Kind regards,
rocsta

Felix

Another user requested this feature (in addition to export of data).
It's something I'd like to implement but I haven't had the time to put into this.
The easy way to reset the data is just delete the binary file that stores that data from the disk. That means you have to log into your Pi or use a FTP client, find the binary file in the DB folder (by the ID and name of the metric) and delete it. You should not need to restart the gateway.js application.

rocsta

Thanks Felix,

just an idea / a question:
would it be possible, to add an action starting a shell command
"rm blabla/db/id_blabla.db
pkill node" ?



Felix

Sure you can always do something like that. You'd need a parameter to pass to the script if you want to delete a variable file, otherwise it would always be the same file.