Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Chakkie
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by Chakkie

    • Chakkie

      Adjust / change total energy (kwh) and water (liter) value of the controller or GW
      General Discussion • • Chakkie  

      3
      0
      Votes
      3
      Posts
      1853
      Views

      Chakkie

      @mfalkvidd Thanks The idea of changing the pulseCount is correct. However I had set the value at the wrong place without realizing the pulseCount is reset at the Void setup() section. // Water Reset pulsecount pulseCountW = oldPulseCountW = 0; // Zonnepanelen Reset pulsecount pulseCountZ = oldPulseCountZ = 0; The solution is Change the 0 to : Value (meter) - Value (Controller) Upload the sketch. wait until the first pulse is sent to the gateway. If successed the controller (domoticz in my case) will show the total value matching the value on the physical meter. Now change the value in the sketch back to 0. (Otherwise each time you reset the sensor or the gateway the value wil be added to the total value.) Upload the sketch to the sensor. You are done. There is no need to Modify the Domoticz database with SQL tool. You will get the value you've just added to the total value in the day value log. If you find this ignoring you can delete this value the next day. This only applies to Energy meter. Do not apply this to the water meter as the result the total value of the water meter will be gone too.
    • Chakkie

      Buzzer when door opened longer than X seconds
      General Discussion • • Chakkie  

      3
      0
      Votes
      3
      Posts
      1628
      Views

      Chakkie

      @Boots33 Thanks for the help. The main problem was how to set the time when the doors are opened. I have tried several attempts and everytime the timer is reset. Therefore the buzzer will never be triggered because the timer and the current time is always the same. I have solved this problem. The working script is here below: #include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define CHILD_ID_Koel 31 #define CHILD_ID_Vries 32 #define BUTTON_PIN_Koel 7 // Arduino Digital I/O pin for button/reed switch #define BUTTON_PIN_Vries 8 // Arduino Digital I/O pin for button/reed switch #define INTERRUPT BUTTON_PIN_Koel -2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define INTERRUPT BUTTON_PIN_Vries -2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define buzzPin 2 // I/O-pin from buzzer connects here unsigned long currentMillisKoel; unsigned long currentMillisVries; MySensor gw; Bounce debouncerKoel = Bounce(); Bounce debouncerVries = Bounce(); int oldValueKoel = -1; int oldValueVries = -1; int KoelBuzz = 0; int VriesBuzz = 0; unsigned long DoorDelay = 5000UL; unsigned long KoelTimer = 0UL; unsigned long VriesTimer = 0UL; MyMessage msgKoel(CHILD_ID_Koel, V_TRIPPED); MyMessage msgVries(CHILD_ID_Vries, V_TRIPPED); void setup() { gw.begin(NULL, 204, false, 0); // Setup the button pinMode(BUTTON_PIN_Koel, INPUT); pinMode(BUTTON_PIN_Vries, INPUT); //Buzz pin pinMode(buzzPin, OUTPUT); digitalWrite(buzzPin, HIGH); // Activate internal pull-up digitalWrite(BUTTON_PIN_Koel, HIGH); digitalWrite(BUTTON_PIN_Vries, HIGH); // After setting up the button, setup debouncer debouncerKoel.attach(BUTTON_PIN_Koel); debouncerVries.attach(BUTTON_PIN_Vries); debouncerKoel.interval(5); debouncerVries.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. gw.present(CHILD_ID_Koel, S_DOOR); gw.present(CHILD_ID_Vries, S_DOOR); } // Check if digital input has changed and send in new value void loop() { // Fridge door script debouncerKoel.update(); // Get the update value int valueKoel = debouncerKoel.read(); if (valueKoel != oldValueKoel) { // Send in the new value gw.send(msgKoel.set(valueKoel == HIGH ? 0 : 1)); // change this value to if NC then 0 : 1; if NO then 1 : 0 oldValueKoel = valueKoel; KoelBuzz = digitalRead(BUTTON_PIN_Koel); Serial.println(KoelBuzz); if (KoelBuzz == LOW) { //Door is open. KoelTimer = millis(); // Set the time. Serial.println(KoelTimer); } } // check how long the doors are opened unsigned long currentMillisKoel = millis(); if ((currentMillisKoel - KoelTimer) >= DoorDelay && KoelBuzz == LOW) { // Serial.println("Counter start"); // Serial.println(KoelTimer); // Serial.println(currentMillisKoel); digitalWrite(buzzPin, KoelBuzz); // Tone ON // Serial.println("Buzzer triggerd"); } // Freezer door script debouncerVries.update(); // Get the update value int valueVries = debouncerVries.read(); if (valueVries != oldValueVries) { // Send in the new value gw.send(msgVries.set(valueVries == HIGH ? 0 : 1)); // change this value to if NC then 0 : 1; if NO then 1 : 0 oldValueVries = valueVries; VriesBuzz = digitalRead(BUTTON_PIN_Vries); Serial.println(VriesBuzz); if (VriesBuzz == LOW) { //Door is open. VriesTimer = millis(); // Set the time. Serial.println(VriesTimer); } } if (VriesBuzz && KoelBuzz == HIGH) { digitalWrite(buzzPin, VriesBuzz); // Tone OFF } // check how long the doors are opened unsigned long currentMillisVries = millis(); if ((currentMillisVries - VriesTimer) >= DoorDelay && VriesBuzz == LOW) { // Serial.println("Counter start"); // Serial.println(VriesTimer); // Serial.println(currentMillisVries); digitalWrite(buzzPin, VriesBuzz); // Tone ON // Serial.println("Buzzer triggerd"); } // Sleep until interrupt comes in on motion sensor. Send update every two minute. // gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME); // Serial.println("sleep"); }
    • Chakkie

      gw.sleep on battery powered magnet door switch
      My Project • • Chakkie  

      42
      0
      Votes
      42
      Posts
      13137
      Views

      sling

      @siod new observation: I have two temp nodes with red Htu21d in them. One keeps locking up randomly. Have to go outside and reset the arduino. I'll try another sensor today and see if it fixes things. Have completely rebuild the node twice now with new parts except the sensor.
    • Chakkie

      RGB LED strip amplifier gives inverted RGB value
      Domoticz • • Chakkie  

      6
      0
      Votes
      6
      Posts
      3938
      Views

      Chakkie

      Hi TheoL, I have changed the value from 0 to 255 as shown below and now the LED strip turn off when I click the off button in domoticz. Now the dimming part has yet to be solved ![alt text]( image url) Was if (message.type == V_LIGHT) { if (message.getInt() == 0) { digitalWrite(RED_PIN, 255); digitalWrite(GREEN_PIN, 255); digitalWrite(BLUE_PIN, 255);```
    • Chakkie

      District Heating / City Heating (Stadsverwarming) Mysensor IR sender/Receiver
      Domoticz • • Chakkie  

      8
      0
      Votes
      8
      Posts
      4200
      Views

      Chakkie

      @tbowmo Wowww I did not know that this is a very nice info. I will definitely tried using a couple of magnets. Thank you so much for this info. Any the website you provides is pretty solide too. I've been looking on the internet for while and did not come across a hack like this one before. I am a step further thanks
    • Chakkie

      How does serial gateway include nodes????
      General Discussion • • Chakkie  

      8
      0
      Votes
      8
      Posts
      3024
      Views

      tbowmo

      @Chakkie If you are concerned about security, and the neighbor being able to control your lights / locks, then you should look into the security thread located here