Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Video How To - Monitor your Refrigerator

Video How To - Monitor your Refrigerator

Scheduled Pinned Locked Moved My Project
37 Posts 16 Posters 39.8k Views 14 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R robosensor

    @petewill every 425 seconds your door sensors will be blind up to 750 ms because of you using blocking call to dallasTemp.requestTemperatures(). It is very unlikely that this will happen, but it can be :) Safer way is to use non-blocking access to dallas sensors: https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino

    petewillP Offline
    petewillP Offline
    petewill
    Admin
    wrote on last edited by
    #4

    @robosensor Cool, thanks for pointing that out. I'll check it out!

    My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lagore
      wrote on last edited by
      #5

      Another nice project, you to also put in a check for millis() rolling over to zero otherwise in about 50 days the temperature will no longer be updated as the current millis() will be less then your temp stored last time check.

      1 Reply Last reply
      0
      • YveauxY Offline
        YveauxY Offline
        Yveaux
        Mod
        wrote on last edited by
        #6

        @lagore said:

        put in a check for millis() rolling over to zero

        Wrong, not required. Pete's code is essentially:

          unsigned long tempMillis;
          unsigned long currentMillis = millis();
        
          if (currentMillis - tempMillis > tempDelay) {
            // .. do something..
            tempMillis = currentMillis;
          }
        

        Substracting two unsigned type values will return the modulo of the maximum value of that type, e.g.:

        #include <iostream>
        using namespace std;
        
        int main() {
        	unsigned long a = 0xFFFFFF10;
        	unsigned long b = 0x00000010;
        	cout << b - a << endl;
        	return 0;
        }
        

        Will print 256. Pete will be safe when the millis() counter wraps.

        Try it here if you don't believe it :smile:

        http://yveaux.blogspot.nl

        1 Reply Last reply
        1
        • B Offline
          B Offline
          bruster999
          wrote on last edited by
          #7

          Nice project! I particularly like the switch you designed. Very simple and yet functional.
          Do you have a video/instruction on how to set up the phone app part of this project. I'm new to MySensors but have been looking for a way to monitor/control sensors from my iPhone for quite some time without success.
          Thanks.
          B

          petewillP 1 Reply Last reply
          0
          • B bruster999

            Nice project! I particularly like the switch you designed. Very simple and yet functional.
            Do you have a video/instruction on how to set up the phone app part of this project. I'm new to MySensors but have been looking for a way to monitor/control sensors from my iPhone for quite some time without success.
            Thanks.
            B

            petewillP Offline
            petewillP Offline
            petewill
            Admin
            wrote on last edited by
            #8

            @bruster999 said:

            Do you have a video/instruction on how to set up the phone app part of this project. I'm new to MySensors but have been looking for a way to monitor/control sensors from my iPhone for quite some time without success.

            The app is actually part of Vera (my home automation controller). What controller are you using?

            My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hyla
              wrote on last edited by
              #9

              Well done, thanks Pete!

              The freezer actually was one of my reasons for starting with the homeautomation stuff: Left the door open twice and was literally "fed up" with having to eat all the stuff :)

              But guess which project I haven't finished yet. Yeah, You've got it ...

              One thing I realized with the tests I've done so far: even the small wires I've used for
              the internal temperature sensors will keep the silicone isolation in the door frame from sealing off the freezer. So after some time there's always some condensation around the entry point of the wires which can't be good. Something I'll have to look into yet. And I still haven't quite reached the cellar with my MySensors network (maximum distance, 2 and a half floors below) :)

              Christoph

              petewillP 1 Reply Last reply
              0
              • H hyla

                Well done, thanks Pete!

                The freezer actually was one of my reasons for starting with the homeautomation stuff: Left the door open twice and was literally "fed up" with having to eat all the stuff :)

                But guess which project I haven't finished yet. Yeah, You've got it ...

                One thing I realized with the tests I've done so far: even the small wires I've used for
                the internal temperature sensors will keep the silicone isolation in the door frame from sealing off the freezer. So after some time there's always some condensation around the entry point of the wires which can't be good. Something I'll have to look into yet. And I still haven't quite reached the cellar with my MySensors network (maximum distance, 2 and a half floors below) :)

                Christoph

                petewillP Offline
                petewillP Offline
                petewill
                Admin
                wrote on last edited by
                #10

                @hyla Thankfully our freezer wasn't left open that long but it was long enough to warrant a sensor :)

                I have had my internal temp sensors installed for over a month and haven't had any condensation yet. Maybe I just had lucky placement of the wires? I used the wires from a usb cable (I actually cut it off a broken computer mouse). They are incredibly thin. Maybe you can try that?

                As for the distance, can you place a relay (repeater) node somewhere in the middle? http://www.mysensors.org/download/sensor_api_15#create-repeating-nodes

                My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sneaksneak
                  wrote on last edited by
                  #11

                  Thanks for a nice project.
                  I am trying this but I always get Fahrenheit temperatuers in Domoticz.
                  I have change this line in the code.

                  From
                  boolean metric = false;

                  To
                  boolean metric = true;

                  Something else I should do?

                  1 Reply Last reply
                  0
                  • mfalkviddM Offline
                    mfalkviddM Offline
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #12

                    That should be enough. What value does the gatway log say it received from the sensor?

                    1 Reply Last reply
                    0
                    • IgorI Offline
                      IgorI Offline
                      Igor
                      wrote on last edited by
                      #13

                      Thank you for one more interesting solution. Just want to suggest useful thing which might be more simple and durable as contact pair. I mean "Switch Reed" http://www.ebay.com/itm/1PC-Recessed-Magnetic-Window-Door-Contact-Security-Safety-Alarm-Switch-Reed-/310770552546?hash=item485b5e4ee2:g:eGcAAOSwNSxU2BfU

                      Best regards!

                      petewillP 1 Reply Last reply
                      0
                      • IgorI Igor

                        Thank you for one more interesting solution. Just want to suggest useful thing which might be more simple and durable as contact pair. I mean "Switch Reed" http://www.ebay.com/itm/1PC-Recessed-Magnetic-Window-Door-Contact-Security-Safety-Alarm-Switch-Reed-/310770552546?hash=item485b5e4ee2:g:eGcAAOSwNSxU2BfU

                        Best regards!

                        petewillP Offline
                        petewillP Offline
                        petewill
                        Admin
                        wrote on last edited by
                        #14

                        @Igor The reason I didn't use these is because most of the time my fridge door would stay open just slightly but enough that a reed switch would still register it as closed. Normally I like to use reed switches though.

                        My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mbj
                          wrote on last edited by
                          #15

                          A nice project.

                          I had a similar problem with a freezer located in the garage.

                          As I already had other temperature sensors and an energy meter running there (based on MySensors stuff) I just added one of these waterproof DS18B to the setup, drilled a hole through the fridge wall and stuck it in.

                          I use OpenHab and can see the temperature on any browser or at the cell phone client. OpenHab also emails me when temperature raises above a certain temperature.

                          Not as sophisticated as your solution but it works :-)

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            sneaksneak
                            wrote on last edited by
                            #16

                            I have now solved this problem with Fahrenheit instead of Celcius.

                            I had to change to this --->
                            float temperature = static_cast<float>(static_cast<int>((dallasTemp.getTempCByIndex(i)) * 10.)) / 10.;

                            From this --->
                            float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric ? dallasTemp.getTempC(dallasAddresses[i]) : dallasTemp.getTempF(dallasAddresses[i])) * 10.)) / 10.;

                            Now it gives me celcius.
                            Thanks for nice example.

                            1 Reply Last reply
                            0
                            • petewillP Offline
                              petewillP Offline
                              petewill
                              Admin
                              wrote on last edited by
                              #17

                              @mbj Cool, thanks for sharing. I'd love to check out OpenHAB some day.

                              @sneaksneak Interesting. I wonder why you had to do that...? Oh well, glad it's working for you now!

                              My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Stric
                                wrote on last edited by
                                #18

                                When I arrived at work today and started checking mails, I had received a bunch of them saying that the temperature in the fridge was too high, so I had to drive home and close the door. I would have gotten a notification earlier through jabber if the server software we use for jabber wasn't acting up :(.
                                MySensors stuff was not involved in that particular sensor (esic sensor + tellstick + perl + perl), but the need to monitor this stuff was definitely there.

                                petewillP 1 Reply Last reply
                                0
                                • S Stric

                                  When I arrived at work today and started checking mails, I had received a bunch of them saying that the temperature in the fridge was too high, so I had to drive home and close the door. I would have gotten a notification earlier through jabber if the server software we use for jabber wasn't acting up :(.
                                  MySensors stuff was not involved in that particular sensor (esic sensor + tellstick + perl + perl), but the need to monitor this stuff was definitely there.

                                  petewillP Offline
                                  petewillP Offline
                                  petewill
                                  Admin
                                  wrote on last edited by
                                  #19

                                  @Stric Dang. Glad you caught it in time! The need to monitor is definitely real. I also want to get my house outfitted with leak detectors at some point...

                                  My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                                  1 Reply Last reply
                                  0
                                  • KrieghundK Offline
                                    KrieghundK Offline
                                    Krieghund
                                    wrote on last edited by
                                    #20

                                    I'm sorry to ask a seemingly dumb question, but what do I need to do to get a third Dallas sensor to work? (I have a top/bottom fridge and a deep freezer).
                                    I edited the following lines:
                                    DeviceAddress dallasAddresses[] = {
                                    {0x28, 0x29, 0x4F, 0x1, 0x0, 0x0, 0x80, 0xBB}, //Freezer Address -- Modify for your sensors
                                    {0x28, 0x22, 0x53, 0x1, 0x0, 0x0, 0x80, 0x1E}, //Fridge Address -- Modify for your sensors
                                    ** {0x28, 0xA6, 0x58, 0x1, 0x0, 0x0, 0x80, 0x58} //Deep Freezer I added**

                                    // set the temp resolution
                                    for (uint8_t i = 0; i < 3; i++) { //i changed from 2

                                    // Present temp sensors to controller
                                    ** for (int i = 0; i < 3; i++) { // i changed from 2**
                                    gw.present(i, S_TEMP);

                                    // Read temperatures and send them to controller
                                    ** for (int i = 0; i < 3; i++) { //i changed from 2**

                                    I'm not sure what I'm missing. Thank you in advance for your help and great project!!!

                                    KrieghundK 1 Reply Last reply
                                    0
                                    • KrieghundK Krieghund

                                      I'm sorry to ask a seemingly dumb question, but what do I need to do to get a third Dallas sensor to work? (I have a top/bottom fridge and a deep freezer).
                                      I edited the following lines:
                                      DeviceAddress dallasAddresses[] = {
                                      {0x28, 0x29, 0x4F, 0x1, 0x0, 0x0, 0x80, 0xBB}, //Freezer Address -- Modify for your sensors
                                      {0x28, 0x22, 0x53, 0x1, 0x0, 0x0, 0x80, 0x1E}, //Fridge Address -- Modify for your sensors
                                      ** {0x28, 0xA6, 0x58, 0x1, 0x0, 0x0, 0x80, 0x58} //Deep Freezer I added**

                                      // set the temp resolution
                                      for (uint8_t i = 0; i < 3; i++) { //i changed from 2

                                      // Present temp sensors to controller
                                      ** for (int i = 0; i < 3; i++) { // i changed from 2**
                                      gw.present(i, S_TEMP);

                                      // Read temperatures and send them to controller
                                      ** for (int i = 0; i < 3; i++) { //i changed from 2**

                                      I'm not sure what I'm missing. Thank you in advance for your help and great project!!!

                                      KrieghundK Offline
                                      KrieghundK Offline
                                      Krieghund
                                      wrote on last edited by
                                      #21

                                      @Krieghund
                                      Ok, I think I found it. I needed to have the door sensors start at a higher ID:

                                      int doorChildren[] = {3, 4}; //i changed from 2,3

                                      Thank you

                                      petewillP 1 Reply Last reply
                                      0
                                      • KrieghundK Krieghund

                                        @Krieghund
                                        Ok, I think I found it. I needed to have the door sensors start at a higher ID:

                                        int doorChildren[] = {3, 4}; //i changed from 2,3

                                        Thank you

                                        petewillP Offline
                                        petewillP Offline
                                        petewill
                                        Admin
                                        wrote on last edited by
                                        #22

                                        @Krieghund Glad you found it! Sorry, I couldn't respond sooner.

                                        My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                                        1 Reply Last reply
                                        0
                                        • CrankyCoderC Offline
                                          CrankyCoderC Offline
                                          CrankyCoder
                                          wrote on last edited by
                                          #23

                                          any chance this has been updated to 2.0? I am having issues getting the internal pull up for the temp sensors working.

                                          Home Automation Tinkerer
                                          www.CrankyCoder.net

                                          Controller: HomeAssistant in Kubernetes
                                          Gateway: MQTTClientGateway
                                          MySensors: 2.3

                                          petewillP 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          12

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular