question

svmaya avatar image
svmaya asked

Sliding 24h data for I/O

I would like to see how long the digital IO was activated in the last 24h. This would be usable for example for a freezer. If it goes up, time to defrost. Bilge pump, increase indicates leak is getting worse. The 24h info should be similar to last 24h at any point. Maybe calculated every hour?

I am new to Node Red and just like to know if that can be done or if anyone already did this.

VRMNode-RED
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kevgermany avatar image kevgermany ♦♦ commented ·

Nice idea.

Might be tricky. The data stored in VRM is at your update frequency. So the calculation would need to take into account update frequency and make an assumption of how long the load was there for each period for which a value was recorded. Results would be inaccurate, but might be good enough for what you describe. You'd probably get just as good results by plotting the number of positive values per day.

@svmaya moving to modifications space. Fits better there.




0 Likes 0 ·
1 Answer
iammotorhomeless avatar image
iammotorhomeless answered ·

@svmaya I am new to node red myself

but one solution would be to write to a csv file (use amend to file), everytime the current draw is more than >= a set value or when something is switched on or off

you can make a new file every day, or just amend, and delete entries that are older than 2 days in one file

I use a Shelly Pro 4PM, but there are cheaper options

node-red-contrib-fs is a handy tool to install as you can see files being created, modify or delete files.
also lets you display them as a graph while testing and setting up.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.