Combo entry scene trigger?



  • Over on the Vera forum, I asked about a combo keypad that could trigger a scene when the correct combination is entered. This would be handy to have outside your house, to do things like open the garage door, turn on the lights, adjust the thermostat, etc.

    Surprisingly, this apparently doesn't exist. The common work-around is to use a normal combo-pad garage door opener, and then a sensor on the door itself to detect when it's been opened and do stuff. But this can't distinguish between somebody entering and somebody leaving, so it's far from ideal.

    Seems like it would be pretty easy to do it once you have a MySensors setup — you could use something like this Touch Display Scene Controller, but perhaps replacing the touch display with a simple number pad. And then program it to trigger a scene when the combo is entered. You could even have several scenes that are triggered with different combos (one for family, one for guests?), or have it do something else (e.g. notify the owner) after too many failed attempts.

    I don't have the time or ambition to do this at the moment; I have too many irons in the fire already... but I thought I'd throw it out there anyway. It would perhaps make a great project article.



  • I do pretty much this right now with a Yale 'Real Livinig' z-wave keypad lock. It sends an even when a pin code is entered, an 'incorrect pin' code if an invalid one and a 'correct' pin code with the name of the code when a valid one is entered. I can then make as many scenes as I want using the appropriate trigger. Right now I have a couple of lights come on when I enter mine. I have a special one which opens the roll up garage door, and ones for other people send me an alert, etc.

    I think one could do probably craft something cheaper that didn't do the door unlocking, but making it weatherproof and damage resistant like the Yale might be more of a challenge.


  • Contest Winner

    @JoeStrout said:

    I don't have the time or ambition to do this at the moment; I have too many irons in the fire already... but I thought I'd throw it out there anyway. It would perhaps make a great project article.

    maybe look into using the DO Button from IFTTT along with the Maker Channel.

    run a vera scene from your smartphone...



  • @BulldogLowell said:

    maybe look into using the DO Button from IFTTT along with the Maker Channel.

    run a vera scene from your smartphone...

    How does that work? Do you setup commands on IFTTT which send to Vera and how do you expose your Vera to IFTTT?



  • This is an great idea for another home automation. What you have planned?



  • Here is a basic untested code that might do what you're wanting. I combined a my sensors button sketch with the following.
    http://www.instructables.com/id/Arduino-door-lock-with-password/
    I might build one up at some point, but currently I haven't tested it.

    #include <MySensor.h>
    #include <SPI.h>
    #include <Password.h> //http://playground.arduino.cc/uploads/Code/Password.zip //tells to use password library
    #include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip  //tells to use keypad library
    
    
    #define CHILD_ID 3
    
    
    Password password = Password( "0000" ); //password to unlock, can be changed
    
    const byte ROWS = 4; // Four rows
    const byte COLS = 4; // columns
    // Define the Keymap
    char keys[ROWS][COLS] = {
    {'1','2','3'},
    {'4','5','6'},
    {'7','8','9'},
    {'*','0','#'}
    };
    // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
    byte rowPins[ROWS] = { 9, 8, 7, 6 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
    byte colPins[COLS] = { 5, 4, 3 };
    
    MySensor gw;
     
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    // Create the Keypad
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
    void setup()  
    {  
      gw.begin();
      delay(200); 
      pinMode(11, OUTPUT);  //green light
      pinMode(12, OUTPUT);  //red light
     
      keypad.addEventListener(keypadEvent); //add an event listener for this keypad
    
      
      
      // 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_DOOR);  
    }
    
    
    void loop(){
      keypad.getKey();
      }
      //take care of some special events
      void keypadEvent(KeypadEvent eKey){
      switch (keypad.getState()){
      case PRESSED:
      
      Serial.print("Enter:");
      Serial.println(eKey);
      delay(10);
      
      Serial.write(254);
      
      switch (eKey){
        case '*': checkPassword(); delay(1); break;
        
        case '#': password.reset(); delay(1); break;
        
         default: password.append(eKey); delay(1);
    }
    }
    }
    void checkPassword(){
      
    if (password.evaluate()){  //if password is right open
        
        Serial.println("Accepted");
        Serial.write(254);delay(10);
        //Add code to run if it works
        gw.send(msg.set(1));
            digitalWrite(11, HIGH);//turn on
        delay(5000); //wait 5 seconds
        digitalWrite(11, LOW);// turn off
        delay(5000);
        gw.send(msg.set(0));
        
    }else{
        Serial.println("Denied"); //if passwords wrong keep locked
        Serial.write(254);delay(10);
        //add code to run if it did not work
        gw.send(msg.set(0));
        digitalWrite(12, HIGH); //turn on
        delay(5000); //wait 5 seconds
        digitalWrite(12, LOW);//turn off
        
    }
    }```

Log in to reply
 

Suggested Topics

  • 87
  • 5
  • 8
  • 1
  • 7
  • 7

12
Online

11.4k
Users

11.1k
Topics

112.7k
Posts