Announcement

Collapse
No announcement yet.

Fridge Monitoring

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Fridge Monitoring

    Hi all,

    After recently hooking up zwave devices to monitor power consumption on my appliances and monitor on/off status, I thought I could do more than that, especially with our fridges. I had thought about hooking up door sensors to them and temperature sensors inside so that I could be alerted if there were problems. However, I realized that the power usage patterns are also good indicators of how the fridge is doing. I started with one fridge and determined it had the following power usage:

    idle: 0-15 Watt
    door open: 60 Watt (due to light bulb being on)
    compressor running during cooling cycle: 140-160 Watt
    defrost cycle: 360-400 Watt

    If one or both of the doors are open during the cooling or defrost cycles, then the power draw increases by an equivalent amount. Our other fridge has a similar pattern, but with different values.

    Common problems with fridges are doors being left open, being stuck in the defrost cycle, the defrost cycle not coming on at all, the compressor running continuously due to a refrigerant leak, or the compressor not running at all. All these can be detected by monitoring the power usage and then triggering alerts if the power usage becomes abnormal.

    I created 3 virtual devices for each fridge, one called Status (on/off), one called Mode (idle/cooling/defrost), and one called Door (closed/open) along with a parent device which I used to group them:

    Click image for larger version

Name:	fridge1.jpg
Views:	1
Size:	25.9 KB
ID:	1209095
    Click image for larger version

Name:	fridge4.jpg
Views:	1
Size:	25.8 KB
ID:	1209098
    Click image for larger version

Name:	fridge2.jpg
Views:	1
Size:	22.2 KB
ID:	1209096
    Click image for larger version

Name:	fridge3.jpg
Views:	1
Size:	22.7 KB
ID:	1209097

    I then used a script that was called when the fridge's power consumption changed. Three parameters, separated by commas, need to be passed to it: the Door Device, the Mode Device and the device with the power usage. The script updates the virtual devices as needed. The Status device is directly updated by events. I used a similar script for the other fridge because the ranges were different.

    Code:
    Sub Main(ByVal Parms As String)
    
    	Dim logName As String = "Fridge Status"		'set log type for HS log
    	Dim Debug As Boolean = False				'set to True if the script give you errors and it will provide additional info in the HS3 log to help troubleshoot
    	Dim ParmArray() as String
    	ParmArray = Parms.tostring.split(",")
    	dim DoorDev as Double = CDbl(ParmArray(0))		'reference ID of the Door device
    	dim ModeDev as Double = CDbl(ParmArray(1))		'reference ID of the Mode device
    	dim PowerDev as Double = CDbl(ParmArray(2))		'reference ID of the Power device
    	Dim Power As Double = hs.DeviceValueEx(PowerDev)
    	If Debug Then hs.writelog(logName,CStr(Power))
    	Select Case Power
    		Case 0 To 49.9999999
    			If hs.DeviceValue(DoorDev) = 100 Then hs.SetDeviceValueByRef(DoorDev,0,True)
    			If hs.DeviceValue(ModeDev) <> 1 Then hs.SetDeviceValueByRef(ModeDev,1,True)
    		Case 50 To 124.9999999
    			If hs.DeviceValue(DoorDev) = 0 Then hs.SetDeviceValueByRef(DoorDev,100,True)
    			If hs.DeviceValue(ModeDev) <> 1 Then hs.SetDeviceValueByRef(ModeDev,1,True)
    		Case 125 To 189.999999
    			If hs.DeviceValue(DoorDev) = 100 Then hs.SetDeviceValueByRef(DoorDev,0,True)
    			If hs.DeviceValue(ModeDev) <> 2 Then hs.SetDeviceValueByRef(ModeDev,2,True)
    		Case 190 To 274.999999
    			If hs.DeviceValue(DoorDev) = 0 Then hs.SetDeviceValueByRef(DoorDev,100,True)
    			If hs.DeviceValue(ModeDev) <> 2 Then hs.SetDeviceValueByRef(ModeDev,2,True)
    		Case 275 To 424.999999
    			If hs.DeviceValue(DoorDev) = 100 Then hs.SetDeviceValueByRef(DoorDev,0,True)
    			If hs.DeviceValue(ModeDev) <> 3 Then hs.SetDeviceValueByRef(ModeDev,3,True)
    		Case 425 To 599.999999
    			If hs.DeviceValue(DoorDev) = 0 Then hs.SetDeviceValueByRef(DoorDev,100,True)
    			If hs.DeviceValue(ModeDev) <> 3 Then hs.SetDeviceValueByRef(ModeDev,3,True)
    	End Select
    
    End Sub
    Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	29.3 KB
ID:	1209099

    Other events are used to monitor the devices and will send alerts as needed. See the next post for details.

    Cheers
    Al
    Last edited by sparkman; February 29, 2016, 08:47 PM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    #2
    Here are the events that maintain the Status device. A timer is used to keep track of the run time:

    Click image for larger version

Name:	fridge7.jpg
Views:	1
Size:	92.9 KB
ID:	1183574
    Click image for larger version

Name:	fridge8.jpg
Views:	1
Size:	32.3 KB
ID:	1183575

    Here are events that maintain a counter to determine if the defrost cycle is coming on:

    Click image for larger version

Name:	fridge13.jpg
Views:	1
Size:	59.0 KB
ID:	1183628

    Here are the events that generate the alerts (using the Pushover plugin):

    Click image for larger version

Name:	fridge5.jpg
Views:	1
Size:	70.0 KB
ID:	1183576
    Click image for larger version

Name:	fridge6.jpg
Views:	1
Size:	70.5 KB
ID:	1183577
    Click image for larger version

Name:	fridge14.jpg
Views:	1
Size:	43.0 KB
ID:	1183627
    Last edited by sparkman; February 29, 2016, 08:46 PM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Here are the screenshots of the devices' status-graphics tabs:

      Door Device
      Click image for larger version

Name:	fridge10.jpg
Views:	1
Size:	65.9 KB
ID:	1183580

      Mode Device
      Click image for larger version

Name:	fridge11.jpg
Views:	1
Size:	75.4 KB
ID:	1183581

      Status Device
      Click image for larger version

Name:	fridge12.jpg
Views:	1
Size:	68.7 KB
ID:	1183582

      zip file with the icons is attached.
      Last edited by sparkman; February 28, 2016, 11:08 AM.
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment


        #4
        Wow! Nice Al. This is very useful. I like how you approached this problem, and your solution to this. I'm saving this page. Someday I'll get to this [emoji849]


        Sent from my iPhone
        Tom
        baby steps...starting again with HS3
        HS3Pro: Z-NET & 80 Z wave Devices,
        HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
        Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
        In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
        System: XP on Fanless Mini-ITX w/ SSD

        Comment


          #5
          Excellent work! The script is very nice. I never knew the Case function could encompass a range of results. This is really helpful! Your approach would also work on lots of appliances that use multiple power levels. Things like washing machine, dryer, air conditioner, etc.

          Thanks for sharing.
          Steve Q


          Sent from my iPad using Tapatalk
          HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
          2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

          Comment


            #6
            Thank you for sharing all of this. I have been recently started thinking about monitoring usage in my house and this will be a big help.

            Comment


              #7
              Thanks for the kind words everyone. I've updated the third post to show how the 3 devices are configured and have attached a zip with the icons.

              Here's a screen shot of all of the appliances I'm monitoring so far:

              Click image for larger version

Name:	applianes.jpg
Views:	1
Size:	110.7 KB
ID:	1183584

              Cheers
              Al
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                Perhaps you mentioned it, I did not see it, how are you measuring the power? Is it being polled continuously? Perhaps it's not important, but can you actually detect opening and closing the refrigerator door to remove a milk carton? It takes 3-5 seconds?

                Steve Q


                Sent from my iPad using Tapatalk
                HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                Comment


                  #9
                  Originally posted by Steve Q View Post
                  Perhaps you mentioned it, I did not see it, how are you measuring the power? Is it being polled continuously? Perhaps it's not important, but can you actually detect opening and closing the refrigerator door to remove a milk carton? It takes 3-5 seconds?

                  Steve Q
                  Hi Steve, for the fridges, I'm using a HEM with current clamps on the wires to them. I send data about once every 60 seconds, but they do send faster with changes in wattage. My intent is not to know every time a fridge is opened, only if a door is accidentally left open too long. You could have them send the data more often if you wanted to track it to that level.

                  For the other appliances that I'm monitoring, I used a mixture of devices, including EnerWave ZW15RM, Aeotec HEM, Aeotec ZW096 Smart Switch, Aeotec DSC06106 and Aeotec ZW078.

                  Cheers
                  Al
                  HS 4.2.8.0: 2134 Devices 1252 Events
                  Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                  Comment


                    #10
                    Thanks Al, I was thinking about an event to sound a very loud siren when the fridge door is opened after 9:00 PM! [emoji32][emoji12]

                    Steve Q


                    Sent from my iPad using Tapatalk
                    HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                    2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                    Comment


                      #11
                      Originally posted by Steve Q View Post
                      Thanks Al, I was thinking about an event to sound a very loud siren when the fridge door is opened after 9:00 PM! [emoji32][emoji12]

                      Steve Q
                      Lol, I might have to do something like that for the beer fridge when the boys get older.

                      Cheers
                      Al
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #12
                        Nice! Can your script determine:

                        Compressor is running, and the door is then opened?
                        RJ_Make On YouTube

                        Comment


                          #13
                          Originally posted by ServiceXp View Post
                          Nice! Can your script determine:

                          Compressor is running, and the door is then opened?
                          Thanks and yes, that works too:

                          Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	23.1 KB
ID:	1183599

                          Cheers
                          Al
                          HS 4.2.8.0: 2134 Devices 1252 Events
                          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                          Comment


                            #14
                            I set up a chart of the fridges' power usage using the jon00's database charting tool to validate some of my assumptions:

                            Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	41.1 KB
ID:	1183612

                            Everything looks ok, although sometimes the script may assume a door is opened due to the initial in-rush when the compressor starts up dpeending on how large the "surge" is. Typically these are detected as small spikes, but occasionally a larger spike is detected.

                            Cheers
                            Al
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #15
                              Updated the original posts with additional events that monitor for the defrost cycle not working at all.
                              HS 4.2.8.0: 2134 Devices 1252 Events
                              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                              Comment

                              Working...
                              X