Navigation

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

    Ticupolu

    @Ticupolu

    8
    Reputation
    16
    Posts
    631
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Ticupolu Follow

    Best posts made by Ticupolu

    • Openhab 2 Mysensors smart chicken coop

      I would like to share with you my smart chicken coop project. I have started the project mid summer by building a chicken coop for my wife. The idea came up of making it smart with IOT gaining in popularity i look up the internet on ways to achieve my goals which are to make it easier to take care of our flock and be able to leave the house for few a days. A cheap and effective way to do so was to use the raspberry 3 with openhab2 has controller and mysensors with arduino parts.
      I also wanted to have access everywhere so i am using myopenhab as android app and it works very well so far.
      Mysensors binding makes it a lot easier for a guy like me that had no experience in programming before this project it is a great satisfaction when building the gateway and auto discovering my sensors in openhab. Even if mysensors binding is not ready yet it's very stable and haven't had any problems with it lately.
      HABMIN graphic rule designer is very nice way to implement rules in my project the only thing is i haven't found a way to make them work yet but get back to that has soon as i am done testing mysensors sketch and installing everything in the chicken coop. I hope you enjoy my project has much as i do and i will keep it up to date.
      Please comment if you have new ideas or ways to make it better and thanks for all the help!

      0_1488390357512_poulaller.jpg

      0_1488390402700_poulaller night.jpg

      Ford taurus window motor mechanism and switch
      0_1488391540755_rsz_dscn1139.jpg

      0_1488391888112_rsz_dscn1143.jpg

      0_1488391933990_rsz_1dscn1147.jpg

      0_1488392087210_rsz_dscn1144.jpg

      And these are the parts that are used in my project:

      • RPI3

      • Arduino MEGA2560

      • 8 Channels relay

      • PIR motion sensor (For sensing if chicken are not outside when closing the door also for predator alarm at night)

      • DHT22 (for inside temp and humidity)

      • Ds18b20 (outside temp)

      • Heat lamp (yes i live in north canada and ladies need a little heat to lay eggs)

      • 12volts ventillation (when humidity is to high)

      • LED strip (for inside light)

      • LED (for outside light)

      • Automotive window motor mechanism and switch (to close and open chicken door remotely)

      • 2x Limit switch

        Here is a fritzing diagram it needs work:
        0_1488333376994_Poulailler_bb.jpg

      Mysensors sketch is progressing and doing pretty much what it suppose to do.

      // MySensor Debug
      #define MY_DEBUG
      
      // Enables repeater functionality (relays messages from other nodes)
      //#define MY_REPEATER_FEATURE
      
      
      #define MY_NODE_ID 50
      
      #define MY_RF24_CE_PIN 40
      #define MY_RF24_CS_PIN 53
      #define MY_RF24_MOSI_PIN 51
      #define MY_RF24_MISO_PIN 50
      #define MY_RF24_SCK_PIN 52
      
      #define MY_RADIO_NRF24
      #include <MySensors.h>
      #include <SPI.h>
      #include <Bounce2.h>
      #include <DHT.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define RELAY_PIN    22  // Arduino Digital I/O pin number for relay 
      #define RELAY_PIN_2  23
      #define RELAY_PIN_3  24
      #define RELAY_PIN_4  25
      #define RELAY_PIN_5  26
      #define RELAY_PIN_6  27
      #define BUTTON_PIN   9  // Arduino Digital I/O pin number for button 
      #define BUTTON_PIN_2 10
      #define BUTTON_PIN_3 11
      #define BUTTON_PIN_4 12
      #define BUTTON_PIN_5 17
      #define BUTTON_PIN_6 18
      #define CHILD_ID 11 // Id of the sensor child for 1st relay
      #define CHILD_ID_2 12 // Id of the sensor child for 2nd relay
      #define CHILD_ID_3 13
      #define CHILD_ID_4 14
      #define CHILD_ID_5 15
      #define CHILD_ID_6 16
      #define CHILD_ID_HUM1 7
      #define CHILD_ID_TEMP1 8
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 1
      #define MOTION_DATA_PIN 5
      #define CHILD_ID_MOTION 5
      // Relay status
      #define RELAY_ON 1
      #define RELAY_OFF 0
      
      // Source of state change (used when printing debug information)
      #define CHANGE_STATE_SOURCE_RADIO 0
      #define CHANGE_STATE_SOURCE_SWITCH 1
      // Set this to the pin you connected the DHT's data pin to
      #define DHT1_DATA_PIN 2
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      #define SENSOR_TEMP_OFFSET 0
      
      
      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 2100;
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      float lastTemp1;
      float lastHum1;
      bool lastMotion = false;
      
      uint8_t nNoUpdatesTemp1;
      uint8_t nNoUpdatesHum1;
      uint8_t nNoUpdatesMotion;
      bool metric = true;
      
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = false;
      
      
      Bounce debouncer = Bounce();
      int oldValue;
      bool state;
      Bounce debouncer2 = Bounce();
      int oldValue2;
      bool state2;
      Bounce debouncer3 = Bounce();
      int oldValue3;
      bool state3;
      Bounce debouncer4 = Bounce();
      int oldValue4;
      bool state4;
      Bounce debouncer5 = Bounce();
      int oldValue5;
      bool state5;
      Bounce debouncer6 = Bounce();
      int oldValue6;
      bool state6;
      
      MyMessage msgDallas(0,V_TEMP);
      MyMessage msg(CHILD_ID, V_LIGHT);
      MyMessage msg2(CHILD_ID_2, V_LIGHT);
      MyMessage msg3(CHILD_ID_3, V_LIGHT);
      MyMessage msg4(CHILD_ID_4, V_LIGHT);
      MyMessage msg5(CHILD_ID_5, V_LIGHT);
      MyMessage msg6(CHILD_ID_6, V_LIGHT);
      MyMessage msgHum1(CHILD_ID_HUM1, V_HUM);
      MyMessage msgTemp1(CHILD_ID_TEMP1, V_TEMP);
      MyMessage msgMotion(CHILD_ID_MOTION, V_TRIPPED);
      DHT dht;
      
      void before()
      {
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("6xrelay-button-pir-dht22-ds-", "1.0");
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_LIGHT);
        present(CHILD_ID_2, S_LIGHT);
        present(CHILD_ID_3, S_LIGHT);
        present(CHILD_ID_4, S_LIGHT);
        present(CHILD_ID_5, S_LIGHT);
        present(CHILD_ID_6, S_LIGHT);
        present(CHILD_ID_MOTION, S_MOTION);
        present(CHILD_ID_HUM1, S_HUM);
        present(CHILD_ID_TEMP1, S_TEMP);
        
        metric = getControllerConfig().isMetric;
      }
      
      void setup()
      {
        pinMode(MOTION_DATA_PIN, INPUT); 
         
         // Fetch the number of attached temperature sensors  
        numSensors = sensors.getDeviceCount();
      //numSensors = 1;
        // Present all sensors to controller
        for (int i =0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
      }
        
        // Setup the button
        pinMode(BUTTON_PIN, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN, HIGH);
      
        // Setup the button
        pinMode(BUTTON_PIN_2, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_2, HIGH);
      
         // Setup the button
        pinMode(BUTTON_PIN_3, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_3, HIGH);
      
         // Setup the button
        pinMode(BUTTON_PIN_4, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_4, HIGH);
      
        // After setting up the button, setup debouncer
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
        debouncer2.attach(BUTTON_PIN_2);
        debouncer2.interval(5);
      
        debouncer3.attach(BUTTON_PIN_3);
        debouncer3.interval(5);
      
        debouncer4.attach(BUTTON_PIN_4);
        debouncer4.interval(5);
      
        debouncer5.attach(BUTTON_PIN_5);
        debouncer5.interval(5);
      
        debouncer6.attach(BUTTON_PIN_6);
        debouncer6.interval(5);
      
        // Set the initial values of oldValue/oldValue2 variables from status of physical switches
        //  if this is not done the loop() will detect status change and switch the relays on or off
        debouncer.update();
        debouncer2.update();
        debouncer3.update();
        debouncer4.update();
        debouncer5.update();
        debouncer6.update();
        oldValue = debouncer.read();
        oldValue2 = debouncer2.read();
        oldValue3 = debouncer3.read();
        oldValue4 = debouncer4.read();
        oldValue5 = debouncer5.read();
        oldValue6 = debouncer6.read();
      
        // Make sure relays are off when starting up
        setRelayState(RELAY_PIN, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN, OUTPUT);
      
        digitalWrite(RELAY_PIN_2, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_2, OUTPUT);
        
         digitalWrite(RELAY_PIN_3, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_3, OUTPUT);
      
         digitalWrite(RELAY_PIN_4, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_4, OUTPUT);
      
        digitalWrite(RELAY_PIN_5, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_5, OUTPUT);
      
        digitalWrite(RELAY_PIN_6, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_6, OUTPUT);
      
        // Set relay to last known state (using eeprom storage)
        state = loadState(CHILD_ID);
        setRelayState(RELAY_PIN, state);
        state2 = loadState(CHILD_ID_2);
        setRelayState(RELAY_PIN_2, state2);
        state3 = loadState(CHILD_ID_3);
        setRelayState(RELAY_PIN_3, state3);
        state4 = loadState(CHILD_ID_4);
        setRelayState(RELAY_PIN_4, state4);
        state5 = loadState(CHILD_ID_5);
        setRelayState(RELAY_PIN_5, state5);
        state6 = loadState(CHILD_ID_6);
        setRelayState(RELAY_PIN_6, state6);
        
      }
      
      void loop()
      {
        bool tripped = digitalRead(MOTION_DATA_PIN) == HIGH;
      if (tripped || nNoUpdatesMotion == FORCE_UPDATE_N_READS) {
          lastMotion = tripped;
          Serial.println(tripped);
          send(msgMotion.set(tripped?"1":"0"));  // Send tripped value to gw
          nNoUpdatesMotion = 0;
        }
        else if (lastMotion) {
          Serial.println(tripped);
          send(msgMotion.set(tripped?"1":"0"));  // Send tripped value to gw
          nNoUpdatesMotion = 0;
        }
        else {
          nNoUpdatesMotion++;
        }
        
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        wait(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i = 0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
       
          // Fetch and round temperature to one decimal
          float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
       
           //Only send data if temperature has changed and no error
          //#if COMPARE_TEMP == 1
         // if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
         // #else
         // if (temperature != -127.00 && temperature != 85.00) {
          //#endif
       
            // Send in the new temperature
            send(msgDallas.setSensor(i).set(temperature,1));
            Serial.print("Dallas");
            Serial.println(i);
            Serial.println(" :");
          Serial.println(temperature);
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          //}
        }
      
      // Sleep for a while to save energy
        wait(UPDATE_INTERVAL);
      
         
        dht.setup(DHT1_DATA_PIN); // set data pin of DHT1 sensor
        if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
          Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
        }
        // Sleep for the time of the minimum sampling period to give the sensor time to power up
        // (otherwise, timeout errors might occure for the first reading)
        wait(dht.getMinimumSamplingPeriod());
        
        // Force reading sensor, so it works also after sleep()
        dht.readSensor(true);
        
        // Get temperature from DHT library
        float temperature1 = dht.getTemperature();
        if (isnan(temperature1)) {
          Serial.println("Failed reading temperature from DHT!");
        } else if (temperature1 != lastTemp1 || nNoUpdatesTemp1 == FORCE_UPDATE_N_READS) {
          // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
          lastTemp1 = temperature1;
          if (!metric) {
            temperature1 = dht.toFahrenheit(temperature1);
          }
          // Reset no updates counter
          nNoUpdatesTemp1 = 0;
          temperature1 += SENSOR_TEMP_OFFSET;
          send(msgTemp1.set(temperature1, 1));
      
          //#ifdef MY_DEBUG
          //Serial.print("T1: ");
          //Serial.println(temperature1);
          //#endif
        } else {
          // Increase no update counter if the temperature stayed the same
          nNoUpdatesTemp1++;
        }
      
        // Get humidity from DHT library
        float humidity1 = dht.getHumidity();
        if (isnan(humidity1)) {
          Serial.println("Failed reading humidity from DHT");
        } else if (humidity1 != lastHum1 || nNoUpdatesHum1 == FORCE_UPDATE_N_READS) {
          // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
          lastHum1 = humidity1;
          // Reset no updates counter
          nNoUpdatesHum1 = 0;
          send(msgHum1.set(humidity1, 1));
          
          #ifdef MY_DEBUG
          Serial.print("H1: ");
          Serial.println(humidity1);
          #endif
        } else {
          // Increase no update counter if the humidity stayed the same
          nNoUpdatesHum1++;
        }
      
        // Sleep for a while to save energy
        wait(UPDATE_INTERVAL); 
      
      
        debouncer.update();
        debouncer2.update();
        debouncer3.update();
        debouncer4.update();
        debouncer4.update();
        debouncer4.update();
        // Get the update value
        int value = debouncer.read();
        int value2 = debouncer2.read();
        int value3 = debouncer3.read();
        int value4 = debouncer4.read();
        int value5 = debouncer5.read(); 
        int value6 = debouncer6.read(); 
      
      
        if (value != oldValue && value == 0) {
          send(msg.set(state ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID, value);
        }
        oldValue = value;
      
        if (value2 != oldValue2 && value2 == 0) {
          send(msg2.set(state2 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_2, value2);
        }
        oldValue2 = value2;
      
       if (value3 != oldValue3) {
          send(msg3.set(state3 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_3, value3);
        }
        oldValue3 = value3;
      
        if (value4 != oldValue4) {
          send(msg4.set(state4 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_4, value4);
        }
        oldValue4 = value4;
      
        if (value5 != oldValue5) {
          send(msg5.set(state5 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_5, value5);
        }
        oldValue5 = value5;
      
        if (value6 != oldValue6) {
          send(msg6.set(state6 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_6, value6);
        }
        oldValue6 = value6;
      
       }
      
      void receive(const MyMessage &message) {
        if (message.type == V_STATUS) {  
          switch (message.sensor) {
              case CHILD_ID:                                                    
                state = message.getBool();    
                setRelayState(RELAY_PIN, state); // Change relay state
                saveState(CHILD_ID, state);      // Store state in eeprom
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID, state);
               break;
              case CHILD_ID_2:                                                     
                state2 = message.getBool();
                setRelayState(RELAY_PIN_2, state2);
                saveState(CHILD_ID_2, state2);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_2, state2);
               break;
              case CHILD_ID_3:                                                     
                state3 = message.getBool();
                setRelayState(RELAY_PIN_3, state3);
                saveState(CHILD_ID_3, state3);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_3, state3);
             break;
              case CHILD_ID_4:                                                    
                state4 = message.getBool();
                setRelayState(RELAY_PIN_4, state4);
                saveState(CHILD_ID_4, state4);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_4, state4);
               break;
              case CHILD_ID_5:                                           
                state5 = message.getBool();
                setRelayState(RELAY_PIN_5, state5);
                saveState(CHILD_ID_5, state5);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_5, state5); 
               break;
            case CHILD_ID_6:                                                    
                state6 = message.getBool();
                setRelayState(RELAY_PIN_6, state6);
                saveState(CHILD_ID_6, state6);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_6, state6);  
               break;
              
          }
        }   
      }
      
      // Set status of a relay pin
      void setRelayState(byte relayPin, bool value) {
        digitalWrite(relayPin, value ? RELAY_ON : RELAY_OFF);
      }
      
      // Print debug info, centralized in one place to minimize memory usage and have only one #ifdef MY_DEBUG for all state change messages
      void printStateChangedDebug(int source, int sensorID, bool value) {
      #ifdef MY_DEBUG
        Serial.print(F("Sensor value changed, source="));
        Serial.print(source == CHANGE_STATE_SOURCE_RADIO ? F("Radio") : F("Physical switch"));
        Serial.print(F(", Sensor="));
        Serial.print(sensorID);
        Serial.print(F(", New status: "));
        Serial.println(value);
      #endif
      } ```
      posted in My Project
      Ticupolu
      Ticupolu
    • RE: relay not changing state when compiling two working sketchs

      Thank you for quick response works perfect 👍

      posted in Troubleshooting
      Ticupolu
      Ticupolu

    Latest posts made by Ticupolu

    • RE: Openhab 2 Mysensors smart chicken coop

      Anybody had any luck using habmin rules designer in openhab2 with mysensors binding? I've lost a lot of time and just about to give up on oh2...is there a better controller more user frendly to use with mysensors?

      posted in My Project
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      @Boots33 Yess! we got it this time the door relays and limit switch are acting just like i wanted...i will be testing the other 4 relays in the after noon... i wish i could be better at programming without your help i would be stuck thank you!

      posted in Troubleshooting
      Ticupolu
      Ticupolu
    • RE: Openhab 2 Mysensors smart chicken coop

      @sundberg84 Thank you i will work on my project later on today and put some images.

      posted in My Project
      Ticupolu
      Ticupolu
    • Openhab 2 Mysensors smart chicken coop

      I would like to share with you my smart chicken coop project. I have started the project mid summer by building a chicken coop for my wife. The idea came up of making it smart with IOT gaining in popularity i look up the internet on ways to achieve my goals which are to make it easier to take care of our flock and be able to leave the house for few a days. A cheap and effective way to do so was to use the raspberry 3 with openhab2 has controller and mysensors with arduino parts.
      I also wanted to have access everywhere so i am using myopenhab as android app and it works very well so far.
      Mysensors binding makes it a lot easier for a guy like me that had no experience in programming before this project it is a great satisfaction when building the gateway and auto discovering my sensors in openhab. Even if mysensors binding is not ready yet it's very stable and haven't had any problems with it lately.
      HABMIN graphic rule designer is very nice way to implement rules in my project the only thing is i haven't found a way to make them work yet but get back to that has soon as i am done testing mysensors sketch and installing everything in the chicken coop. I hope you enjoy my project has much as i do and i will keep it up to date.
      Please comment if you have new ideas or ways to make it better and thanks for all the help!

      0_1488390357512_poulaller.jpg

      0_1488390402700_poulaller night.jpg

      Ford taurus window motor mechanism and switch
      0_1488391540755_rsz_dscn1139.jpg

      0_1488391888112_rsz_dscn1143.jpg

      0_1488391933990_rsz_1dscn1147.jpg

      0_1488392087210_rsz_dscn1144.jpg

      And these are the parts that are used in my project:

      • RPI3

      • Arduino MEGA2560

      • 8 Channels relay

      • PIR motion sensor (For sensing if chicken are not outside when closing the door also for predator alarm at night)

      • DHT22 (for inside temp and humidity)

      • Ds18b20 (outside temp)

      • Heat lamp (yes i live in north canada and ladies need a little heat to lay eggs)

      • 12volts ventillation (when humidity is to high)

      • LED strip (for inside light)

      • LED (for outside light)

      • Automotive window motor mechanism and switch (to close and open chicken door remotely)

      • 2x Limit switch

        Here is a fritzing diagram it needs work:
        0_1488333376994_Poulailler_bb.jpg

      Mysensors sketch is progressing and doing pretty much what it suppose to do.

      // MySensor Debug
      #define MY_DEBUG
      
      // Enables repeater functionality (relays messages from other nodes)
      //#define MY_REPEATER_FEATURE
      
      
      #define MY_NODE_ID 50
      
      #define MY_RF24_CE_PIN 40
      #define MY_RF24_CS_PIN 53
      #define MY_RF24_MOSI_PIN 51
      #define MY_RF24_MISO_PIN 50
      #define MY_RF24_SCK_PIN 52
      
      #define MY_RADIO_NRF24
      #include <MySensors.h>
      #include <SPI.h>
      #include <Bounce2.h>
      #include <DHT.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define RELAY_PIN    22  // Arduino Digital I/O pin number for relay 
      #define RELAY_PIN_2  23
      #define RELAY_PIN_3  24
      #define RELAY_PIN_4  25
      #define RELAY_PIN_5  26
      #define RELAY_PIN_6  27
      #define BUTTON_PIN   9  // Arduino Digital I/O pin number for button 
      #define BUTTON_PIN_2 10
      #define BUTTON_PIN_3 11
      #define BUTTON_PIN_4 12
      #define BUTTON_PIN_5 17
      #define BUTTON_PIN_6 18
      #define CHILD_ID 11 // Id of the sensor child for 1st relay
      #define CHILD_ID_2 12 // Id of the sensor child for 2nd relay
      #define CHILD_ID_3 13
      #define CHILD_ID_4 14
      #define CHILD_ID_5 15
      #define CHILD_ID_6 16
      #define CHILD_ID_HUM1 7
      #define CHILD_ID_TEMP1 8
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 1
      #define MOTION_DATA_PIN 5
      #define CHILD_ID_MOTION 5
      // Relay status
      #define RELAY_ON 1
      #define RELAY_OFF 0
      
      // Source of state change (used when printing debug information)
      #define CHANGE_STATE_SOURCE_RADIO 0
      #define CHANGE_STATE_SOURCE_SWITCH 1
      // Set this to the pin you connected the DHT's data pin to
      #define DHT1_DATA_PIN 2
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      #define SENSOR_TEMP_OFFSET 0
      
      
      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 2100;
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      float lastTemp1;
      float lastHum1;
      bool lastMotion = false;
      
      uint8_t nNoUpdatesTemp1;
      uint8_t nNoUpdatesHum1;
      uint8_t nNoUpdatesMotion;
      bool metric = true;
      
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = false;
      
      
      Bounce debouncer = Bounce();
      int oldValue;
      bool state;
      Bounce debouncer2 = Bounce();
      int oldValue2;
      bool state2;
      Bounce debouncer3 = Bounce();
      int oldValue3;
      bool state3;
      Bounce debouncer4 = Bounce();
      int oldValue4;
      bool state4;
      Bounce debouncer5 = Bounce();
      int oldValue5;
      bool state5;
      Bounce debouncer6 = Bounce();
      int oldValue6;
      bool state6;
      
      MyMessage msgDallas(0,V_TEMP);
      MyMessage msg(CHILD_ID, V_LIGHT);
      MyMessage msg2(CHILD_ID_2, V_LIGHT);
      MyMessage msg3(CHILD_ID_3, V_LIGHT);
      MyMessage msg4(CHILD_ID_4, V_LIGHT);
      MyMessage msg5(CHILD_ID_5, V_LIGHT);
      MyMessage msg6(CHILD_ID_6, V_LIGHT);
      MyMessage msgHum1(CHILD_ID_HUM1, V_HUM);
      MyMessage msgTemp1(CHILD_ID_TEMP1, V_TEMP);
      MyMessage msgMotion(CHILD_ID_MOTION, V_TRIPPED);
      DHT dht;
      
      void before()
      {
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("6xrelay-button-pir-dht22-ds-", "1.0");
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_LIGHT);
        present(CHILD_ID_2, S_LIGHT);
        present(CHILD_ID_3, S_LIGHT);
        present(CHILD_ID_4, S_LIGHT);
        present(CHILD_ID_5, S_LIGHT);
        present(CHILD_ID_6, S_LIGHT);
        present(CHILD_ID_MOTION, S_MOTION);
        present(CHILD_ID_HUM1, S_HUM);
        present(CHILD_ID_TEMP1, S_TEMP);
        
        metric = getControllerConfig().isMetric;
      }
      
      void setup()
      {
        pinMode(MOTION_DATA_PIN, INPUT); 
         
         // Fetch the number of attached temperature sensors  
        numSensors = sensors.getDeviceCount();
      //numSensors = 1;
        // Present all sensors to controller
        for (int i =0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
      }
        
        // Setup the button
        pinMode(BUTTON_PIN, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN, HIGH);
      
        // Setup the button
        pinMode(BUTTON_PIN_2, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_2, HIGH);
      
         // Setup the button
        pinMode(BUTTON_PIN_3, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_3, HIGH);
      
         // Setup the button
        pinMode(BUTTON_PIN_4, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN_4, HIGH);
      
        // After setting up the button, setup debouncer
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
        debouncer2.attach(BUTTON_PIN_2);
        debouncer2.interval(5);
      
        debouncer3.attach(BUTTON_PIN_3);
        debouncer3.interval(5);
      
        debouncer4.attach(BUTTON_PIN_4);
        debouncer4.interval(5);
      
        debouncer5.attach(BUTTON_PIN_5);
        debouncer5.interval(5);
      
        debouncer6.attach(BUTTON_PIN_6);
        debouncer6.interval(5);
      
        // Set the initial values of oldValue/oldValue2 variables from status of physical switches
        //  if this is not done the loop() will detect status change and switch the relays on or off
        debouncer.update();
        debouncer2.update();
        debouncer3.update();
        debouncer4.update();
        debouncer5.update();
        debouncer6.update();
        oldValue = debouncer.read();
        oldValue2 = debouncer2.read();
        oldValue3 = debouncer3.read();
        oldValue4 = debouncer4.read();
        oldValue5 = debouncer5.read();
        oldValue6 = debouncer6.read();
      
        // Make sure relays are off when starting up
        setRelayState(RELAY_PIN, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN, OUTPUT);
      
        digitalWrite(RELAY_PIN_2, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_2, OUTPUT);
        
         digitalWrite(RELAY_PIN_3, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_3, OUTPUT);
      
         digitalWrite(RELAY_PIN_4, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_4, OUTPUT);
      
        digitalWrite(RELAY_PIN_5, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_5, OUTPUT);
      
        digitalWrite(RELAY_PIN_6, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN_6, OUTPUT);
      
        // Set relay to last known state (using eeprom storage)
        state = loadState(CHILD_ID);
        setRelayState(RELAY_PIN, state);
        state2 = loadState(CHILD_ID_2);
        setRelayState(RELAY_PIN_2, state2);
        state3 = loadState(CHILD_ID_3);
        setRelayState(RELAY_PIN_3, state3);
        state4 = loadState(CHILD_ID_4);
        setRelayState(RELAY_PIN_4, state4);
        state5 = loadState(CHILD_ID_5);
        setRelayState(RELAY_PIN_5, state5);
        state6 = loadState(CHILD_ID_6);
        setRelayState(RELAY_PIN_6, state6);
        
      }
      
      void loop()
      {
        bool tripped = digitalRead(MOTION_DATA_PIN) == HIGH;
      if (tripped || nNoUpdatesMotion == FORCE_UPDATE_N_READS) {
          lastMotion = tripped;
          Serial.println(tripped);
          send(msgMotion.set(tripped?"1":"0"));  // Send tripped value to gw
          nNoUpdatesMotion = 0;
        }
        else if (lastMotion) {
          Serial.println(tripped);
          send(msgMotion.set(tripped?"1":"0"));  // Send tripped value to gw
          nNoUpdatesMotion = 0;
        }
        else {
          nNoUpdatesMotion++;
        }
        
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        wait(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i = 0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
       
          // Fetch and round temperature to one decimal
          float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
       
           //Only send data if temperature has changed and no error
          //#if COMPARE_TEMP == 1
         // if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
         // #else
         // if (temperature != -127.00 && temperature != 85.00) {
          //#endif
       
            // Send in the new temperature
            send(msgDallas.setSensor(i).set(temperature,1));
            Serial.print("Dallas");
            Serial.println(i);
            Serial.println(" :");
          Serial.println(temperature);
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          //}
        }
      
      // Sleep for a while to save energy
        wait(UPDATE_INTERVAL);
      
         
        dht.setup(DHT1_DATA_PIN); // set data pin of DHT1 sensor
        if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
          Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
        }
        // Sleep for the time of the minimum sampling period to give the sensor time to power up
        // (otherwise, timeout errors might occure for the first reading)
        wait(dht.getMinimumSamplingPeriod());
        
        // Force reading sensor, so it works also after sleep()
        dht.readSensor(true);
        
        // Get temperature from DHT library
        float temperature1 = dht.getTemperature();
        if (isnan(temperature1)) {
          Serial.println("Failed reading temperature from DHT!");
        } else if (temperature1 != lastTemp1 || nNoUpdatesTemp1 == FORCE_UPDATE_N_READS) {
          // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
          lastTemp1 = temperature1;
          if (!metric) {
            temperature1 = dht.toFahrenheit(temperature1);
          }
          // Reset no updates counter
          nNoUpdatesTemp1 = 0;
          temperature1 += SENSOR_TEMP_OFFSET;
          send(msgTemp1.set(temperature1, 1));
      
          //#ifdef MY_DEBUG
          //Serial.print("T1: ");
          //Serial.println(temperature1);
          //#endif
        } else {
          // Increase no update counter if the temperature stayed the same
          nNoUpdatesTemp1++;
        }
      
        // Get humidity from DHT library
        float humidity1 = dht.getHumidity();
        if (isnan(humidity1)) {
          Serial.println("Failed reading humidity from DHT");
        } else if (humidity1 != lastHum1 || nNoUpdatesHum1 == FORCE_UPDATE_N_READS) {
          // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
          lastHum1 = humidity1;
          // Reset no updates counter
          nNoUpdatesHum1 = 0;
          send(msgHum1.set(humidity1, 1));
          
          #ifdef MY_DEBUG
          Serial.print("H1: ");
          Serial.println(humidity1);
          #endif
        } else {
          // Increase no update counter if the humidity stayed the same
          nNoUpdatesHum1++;
        }
      
        // Sleep for a while to save energy
        wait(UPDATE_INTERVAL); 
      
      
        debouncer.update();
        debouncer2.update();
        debouncer3.update();
        debouncer4.update();
        debouncer4.update();
        debouncer4.update();
        // Get the update value
        int value = debouncer.read();
        int value2 = debouncer2.read();
        int value3 = debouncer3.read();
        int value4 = debouncer4.read();
        int value5 = debouncer5.read(); 
        int value6 = debouncer6.read(); 
      
      
        if (value != oldValue && value == 0) {
          send(msg.set(state ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID, value);
        }
        oldValue = value;
      
        if (value2 != oldValue2 && value2 == 0) {
          send(msg2.set(state2 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_2, value2);
        }
        oldValue2 = value2;
      
       if (value3 != oldValue3) {
          send(msg3.set(state3 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_3, value3);
        }
        oldValue3 = value3;
      
        if (value4 != oldValue4) {
          send(msg4.set(state4 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_4, value4);
        }
        oldValue4 = value4;
      
        if (value5 != oldValue5) {
          send(msg5.set(state5 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_5, value5);
        }
        oldValue5 = value5;
      
        if (value6 != oldValue6) {
          send(msg6.set(state6 ? false : true), true); // Send new state and request ack back
          // Write some debug info
          printStateChangedDebug(CHANGE_STATE_SOURCE_SWITCH, CHILD_ID_6, value6);
        }
        oldValue6 = value6;
      
       }
      
      void receive(const MyMessage &message) {
        if (message.type == V_STATUS) {  
          switch (message.sensor) {
              case CHILD_ID:                                                    
                state = message.getBool();    
                setRelayState(RELAY_PIN, state); // Change relay state
                saveState(CHILD_ID, state);      // Store state in eeprom
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID, state);
               break;
              case CHILD_ID_2:                                                     
                state2 = message.getBool();
                setRelayState(RELAY_PIN_2, state2);
                saveState(CHILD_ID_2, state2);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_2, state2);
               break;
              case CHILD_ID_3:                                                     
                state3 = message.getBool();
                setRelayState(RELAY_PIN_3, state3);
                saveState(CHILD_ID_3, state3);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_3, state3);
             break;
              case CHILD_ID_4:                                                    
                state4 = message.getBool();
                setRelayState(RELAY_PIN_4, state4);
                saveState(CHILD_ID_4, state4);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_4, state4);
               break;
              case CHILD_ID_5:                                           
                state5 = message.getBool();
                setRelayState(RELAY_PIN_5, state5);
                saveState(CHILD_ID_5, state5);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_5, state5); 
               break;
            case CHILD_ID_6:                                                    
                state6 = message.getBool();
                setRelayState(RELAY_PIN_6, state6);
                saveState(CHILD_ID_6, state6);
             // Write some debug info
                printStateChangedDebug(CHANGE_STATE_SOURCE_RADIO, CHILD_ID_6, state6);  
               break;
              
          }
        }   
      }
      
      // Set status of a relay pin
      void setRelayState(byte relayPin, bool value) {
        digitalWrite(relayPin, value ? RELAY_ON : RELAY_OFF);
      }
      
      // Print debug info, centralized in one place to minimize memory usage and have only one #ifdef MY_DEBUG for all state change messages
      void printStateChangedDebug(int source, int sensorID, bool value) {
      #ifdef MY_DEBUG
        Serial.print(F("Sensor value changed, source="));
        Serial.print(source == CHANGE_STATE_SOURCE_RADIO ? F("Radio") : F("Physical switch"));
        Serial.print(F(", Sensor="));
        Serial.print(sensorID);
        Serial.print(F(", New status: "));
        Serial.println(value);
      #endif
      } ```
      posted in My Project
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      @Boots33 thank you for your explanation and time on this ...i have tried your sketch and it works the relay are now changing state....the only thing that i forgot to mention is that my door open or closes right back after it leaves the limit switch. The relay needs to change state only when the limit switch gets hit not when it leaves lol i dont know if you understand, english is not my first language but i made some sort of wiring diagram like you mention i'm also opening a my project subject for Mysensors Smart chicken coop....new ideas are welcome

      0_1488324476029_Poulailler_bb.jpg

      [0_1488324612760_Poulailler.fzz](Envoi en cours 100%)

      posted in Troubleshooting
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      43024 TSF:MSG:SEND,50-50-0-0,s=12,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:1
      Sensor value changed, source=Physical switch, Sensor=12, New status: 1

      is there anyway i can make it read and send instead of only send

      posted in Troubleshooting
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      @FotoFieber from openhab2 controller on rpi3 it is for chicken coop door and use myopenhab app to open and close remotly

      posted in Troubleshooting
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      limit switch

      posted in Troubleshooting
      Ticupolu
      Ticupolu
    • RE: relay with button...relay not physically changing state

      @FotoFieber here is my serial monitor...i first close relay with oh2(it works my relay closes physically) then with physical switch (it shows relay is changing state in oh2 and serial monitor but not physically on relay)

      1
      70185 TSF:MSG:SEND,1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      71721 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.6
      Dallas0
      :
      18.60
      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.2.0-beta
      4 MCO:BGN:BFR
      64 TSM:INIT
      65 TSF:WUR:MS=0
      72 TSM:INIT:TSP OK
      74 TSM:INIT:STATID=50
      76 TSF:SID:OK,ID=50
      77 TSM:FPAR
      114 TSF:MSG:SEND,50-50-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      586 TSF:MSG:READ,0-0-50,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      591 TSF:MSG:FPAR OK,ID=0,D=1
      2121 TSM:FPAR:OK
      2122 TSM:ID
      2123 TSM:ID:OK
      2125 TSM:UPL
      2128 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      2139 TSF:MSG:READ,0-0-50,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      2144 TSF:MSG:PONG RECV,HP=1
      2147 TSM:UPL:OK
      2148 TSM:READY:ID=50,PAR=0,DIS=1
      2153 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      2161 TSF:MSG:READ,0-0-50,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      2168 TSF:MSG:SEND,50-50-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.2.0-beta
      2178 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2197 TSF:MSG:READ,0-0-50,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      2204 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=11,pt=0,l=21,sg=0,ft=0,st=OK:Double Relay & Button
      2214 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:0.2
      2223 TSF:MSG:SEND,50-50-0-0,s=11,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2231 TSF:MSG:SEND,50-50-0-0,s=12,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2239 TSF:MSG:SEND,50-50-0-0,s=13,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2247 TSF:MSG:SEND,50-50-0-0,s=14,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2254 TSF:MSG:SEND,50-50-0-0,s=15,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2263 TSF:MSG:SEND,50-50-0-0,s=16,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      2271 TSF:MSG:SEND,50-50-0-0,s=5,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      2279 TSF:MSG:SEND,50-50-0-0,s=7,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2286 TSF:MSG:SEND,50-50-0-0,s=8,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2292 MCO:REG:REQ
      2296 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2302 TSF:MSG:READ,0-0-50,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2308 MCO:PIM:NODE REG=1
      2310 MCO:BGN:STP
      2314 TSF:MSG:SEND,50-50-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2320 MCO:BGN:INIT OK,TSP=1
      1
      2324 TSF:MSG:SEND,50-50-0-0,s=5,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      3862 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.6
      Dallas0
      :
      18.60
      10467 TSF:MSG:READ,0-0-50,s=12,c=1,t=2,pt=0,l=1,sg=0:0
      Sensor value changed, source=Radio, Sensor=12, New status: 0
      10880 TSF:MSG:SEND,50-50-0-0,s=8,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.6
      10889 TSF:MSG:SEND,50-50-0-0,s=7,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:41.1
      H1: 41.10
      1
      15897 TSF:MSG:SEND,50-50-0-0,s=5,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      17434 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.6
      Dallas0
      :
      18.60
      1
      29453 TSF:MSG:SEND,50-50-0-0,s=5,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      30990 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.6
      Dallas0
      :
      18.60
      38007 TSF:MSG:SEND,50-50-0-0,s=8,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.7
      38017 TSF:MSG:SEND,50-50-0-0,s=7,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:41.0
      H1: 41.00
      43024 TSF:MSG:SEND,50-50-0-0,s=12,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:1
      Sensor value changed, source=Physical switch, Sensor=12, New status: 1
      1
      43033 TSF:MSG:SEND,50-50-0-0,s=5,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      43795 TSF:MSG:READ,0-0-50,s=12,c=1,t=2,pt=1,l=1,sg=0:1
      43800 TSF:MSG:ACK
      This is an ack from gateway
      44573 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.7
      Dallas0
      :
      18.70
      1
      56590 TSF:MSG:SEND,50-50-0-0,s=5,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      58127 TSF:MSG:SEND,50-50-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.7
      Dallas0
      :
      18.70

      posted in Troubleshooting
      Ticupolu
      Ticupolu