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. Troubleshooting
  3. No triggering Door, Window and Push-button Sensor

No triggering Door, Window and Push-button Sensor

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 2 Posters 1.5k Views 2 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.
  • toinobcoolT Offline
    toinobcoolT Offline
    toinobcool
    wrote on last edited by
    #1

    Hello,

    I just build a ESP8266 GW connected to my Vera Ui7 so far so good, made a sensor Relay, perfect it worked well,
    But now when I try to build a Door, Window and Push-button Sensor i don´t get any event triggering in Vera.
    0_1456339201964_upload-35c398f6-c529-47b7-b164-1c20e1276532
    I detect the sensor correct in devices, i can see 2 devices (arduino node 4 and Arduino motion 3 (4) ) i see that arduino node 4 "Last update" changes datetime when i change the sensor pinout (button) but somehow my scene doesn´t work.
    I have a small scene where when Arduino Motion 3(4) detect motion armed or not it should turn on a Lamp but nothing happens, even in the log file from VERA i see that " Evaluate 4 scene Test Sensor is false " i always get false.

    Does nyone understands why?
    Am I missing something.

    Thank you for your help.
    Regards

    Sensor Code:

    #include <MySensor.h>
    #include <SPI.h>
    #include <Bounce2.h>
    
    #define CHILD_ID 3
    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
    
    MySensor gw;
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    
    void setup()  
    {  
      gw.begin();
    
     // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
      
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.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, S_MOTION);  
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
     
      if (value != oldValue) {
         // Send in the new value
         gw.send(msg.set(value==HIGH ? 1 : 0));
         oldValue = value;
      }
    } 
    

    Scene Vera:

    0_1456339302621_upload-645ca57e-7cad-450d-86ef-836122e72f7e
    Log in VERA:

    AlarmManager::AddRelativeAlarm current time 1456336378 delay 0 type 45 <0x7502e520>
    AlarmManager::AddAbsoluteAlarm alarm 0xb36dc8 entry 0xd72f60 id 322 type 45 param=(nil) entry->when: 1456336378 time: 1456336378 bCancelFirst 0=0 <0x7502e520>
    AlarmManager::Run 0xb36dc8 notified of a change entry 0x10200a0 id 312 deleted 0 <0x77a2e520>
    AlarmManager::Run callback for alarm 0xb36dc8 entry 0xd72f60 type 45 id 322 param=(nil) entry->when: 1456336378 time: 1456336378 tnum: 1 slow 0 tardy 0 <0x77a2e520>
    AlarmManager::Run finish callback for alarm 0xb36dc8 entry 0xd72f60 type 45 id 322 param=(nil) entry->when: 1456336378 time: 1456336378 tnum: 1 slow 0 duration 0 <0x77a2e520>
    AlarmManager::Run 0xb36dc8 notified of a change entry 0x110fb78 id 303 deleted 0 <0x7782e520>
    Device_Variable::m_szValue_set device: 88 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 536870913 now: 536870912 #hooks: 1 upnp: 0 skip: 1 v:0xc49ad8/NONE duplicate:0 <0x7502e520>
    UserData::m_iDataVersion_Variables_incr Tripped user data 335633001 variables 335633212 <0x7502e520>
    UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 335633001 variables 335633212 <0x7502e520>
    Device_Variable::m_szValue_set device: 88 VV: 1 <0x7502e520>
    Event::Evaluate 4 scene Test Sensor is false repeat 0/-1 <0x7502e520>

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BartE
      Contest Winner
      wrote on last edited by
      #2

      @toinobcool said: try sending "0" and "1" so strings i.s.o. numbers

      BTW your loop can be optimized to this:

      //  Check if digital input has changed and send in new value
      void loop() 
      {
          if (debouncer.update()) {
             // Send in the new value
             gw.send(msg.set(debouncer.read() ? "1" : "0"));
         } 
      }
      1 Reply Last reply
      0
      • toinobcoolT Offline
        toinobcoolT Offline
        toinobcool
        wrote on last edited by
        #3

        thnaks @BartE .
        I will give a try.

        I found some topic in the forum that there is a problem with the ESP8266 GW code.
        The Development Code fix some bugs in the gateway. Is it something related to this issue ?

        1 Reply Last reply
        0
        • toinobcoolT Offline
          toinobcoolT Offline
          toinobcool
          wrote on last edited by
          #4

          It is working now.

          If I have to send the value as a string and not int will it work if i send string values of temperature where it should be a int ?
          That will be my next test :)

          @BartE thank you very much for the help.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          16

          Online

          12.1k

          Users

          11.2k

          Topics

          113.4k

          Posts


          Copyright 2025 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