How to present pump operation?

Post Reply
Joc8
Posts: 4
Joined: Sunday 14 January 2018 22:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

How to present pump operation?

Post by Joc8 » Wednesday 30 May 2018 19:37

Hi guys

I am looking for an advice how to "model" a custom sensor type. I am monitoring a sewer pump where I am interested in 3 parameters:
- average current (when the pump is on); increasing trend means that something funky is going on
- "ON" duration; increasing trend means that something funky is going on
- time from "on" to the next "on" (in a way how frequent the pump operates)

I have implemented the sensor using Particle Photon (current to voltage coil, ADC and some math...) that's spitting results through MQTT. I now log measurement results in the text file that looks like this. Note, that's only spiting new data when there is a pump-cycle completed (from off - to on - back to off):

Code: Select all

I have two years of data and here are only last three measurements:
2018-05-25 22:04:29 I=2.81A, dur=182s
2018-05-27 15:37:20 I=2.80A, dur=164s
2018-05-27 22:05:53 I=2.80A, dur=172s
I don't need anything fancy and I am ok with a pragmatic approach.

Therefore I was thinking to have 3 sensors: Average on current (A), On-duration (secs), Off-duration (days).

Is it possible to make a graph(of a sensor) that is not function of time (when the measurement was received) instead it would plot measures equidistantly (from one measure to the next, no matter the time spent in-between)?

Do you have any better (out of the box) idea how to "visualize" what's going on with the pump?

I'd appreciate any hints how to approach this. Thanks,
Joc.

zicht
Posts: 210
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 3.8xxx
Location: NL
Contact:

Re: How to present pump operation?

Post by zicht » Thursday 31 May 2018 22:24

Hi

My 5 cents (and Just curious why not a function of time ....)
Domoticz makes the values visible over time, meaning in a day month week year you see the function of the pump = valuable for trend recognition

1.
You can make a lua changing an on/off switch on change of values, but that will also be on a time --> Will tell you something
Without time the graph makes no sense ?

So with MQTT create a link to domoticz to change a switch realtime or with fixed interval... the on/of an duration will be visible.
Based on the on/of pulses and length of this you can make you educated guess on something funky is going on.

2.
or Read the only the current realtime or fixed interval where >0A obviously is on, the graph will tell you everything (on/off, duration, power used...)
It depends on you analytic skills to distinguis what is going based on a graph. I would go on only the Current graph (time based !)

Conclusion : time based is you friend not the enemy :)

Still curious what your thoughts are about this ? :) :)
Rpi & Win x64. Using : cam's,Nest,RFXCom,Kaku,LaCrosse,RFY,IsAlive,Dummy,Wether Underground, standard Lua, Curl on windows,Domoticz Android App & Tasker,

"The only source of knowledge is experience (A.Einstein)"

Joc8
Posts: 4
Joined: Sunday 14 January 2018 22:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: How to present pump operation?

Post by Joc8 » Friday 01 June 2018 20:22

Hi Zicht

thanks for taking your time to brainstorm what to do about it ;-)

The challenge I see is here - ON time is typically 170 sec + 10sec. OTH OFF time can be 1 day up to 30 days (depends on the time of the year and whether I am at home or not). So with this huge range of granularity time equidistant representation hides (loses) a lot of information.

However, you sparked an idea. I can modify my sensor in the following way:

1) To monitor how frequently it turns ON - sensor could send Current*Time*Voltage (which is energy) every time when the pumping would stop and I will interpret this (in Domoticz) as Energy (Wh). Since there will be very infrequent measurements I hope to see a monthly (or yearly) graph that will hopefully make sense...
I'll check if there is any kind of energy meter (as sensor type in Domoticz) that will "integrate" these values in a given period of time in the way that I need. I have Aeotec 3phase energy meter that behaves similarly...

2) To monitor duration (secs) and current (A) - sensor will send duration*current and I will interpret this as Power. I'll make sure sensor will not post 0 values. Monthly/yearly graph will give trend that I am after.

Is it possible to inject old data in the Domoticz sqlite database (I have more than a year of the history)?

Now I am intrigued - I will keep you posted how it will go. Thanks.

Joc

Joc8
Posts: 4
Joined: Sunday 14 January 2018 22:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: How to present pump operation?

Post by Joc8 » Saturday 09 June 2018 16:19

Taaaada!

I succeeded integrating Particle Photon (custom sensor) into Domoticz. On the Photon side I used TCPclient GET calls to post to Domoticz API. I had to resolve some quirks, but it is working good now. I am happy to post code if somebody would need it.

In Domoticz I have increment counter (virtual sensor) and I update it with Energy (U*I*time) every time pump stops pumping. This gives me nice overview, what is going on as f(t):
Screenshot_1.png
Weekly view
Screenshot_1.png (32.74 KiB) Viewed 515 times
and I have also managed to inject 2.5 years of data in Domoticz.db and it plots it as its own:
Screenshot_2.png
Yearly view
Screenshot_2.png (51.69 KiB) Viewed 515 times
Since pump runs normally once a day (if at all) trend can be easily observed. Whenever there is the spike approx. twice the height, this mean the pump run twice in that day. You can guess which months I was not at home ;)

As bonus I figured out there is also very handy text sensor that takes whatever string as input and keeps very handy log.
Screenshot_3.png
Text sensor log
Screenshot_3.png (5.83 KiB) Viewed 515 times
Domoticz rulez!
Attachments
Screenshot_3.png
Text sensor log
Screenshot_3.png (5.83 KiB) Viewed 515 times
Screenshot_2.png
Yearly view
Screenshot_2.png (51.69 KiB) Viewed 515 times
Screenshot_3.png
Text log
Screenshot_3.png (5.83 KiB) Viewed 515 times
Screenshot_2.png
Yearly view
Screenshot_2.png (51.69 KiB) Viewed 515 times
Screenshot_1.png
Weekly view
Screenshot_1.png (32.74 KiB) Viewed 515 times

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests