AutoVera Notification for Door Lock

Discussion in 'AutoApps' started by TomTcom, Apr 9, 2015.

  1. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Hello, I'm using AV and AN. Much like a previous post I wanted to combine the door lock and door unlock values and %TIME into a single notification.

    Perhaps I'm not going about this correctly. It seems as though no matter the time in between me unlocking and then locking, the profile only triggers when it's locked again. So my time unlocked and locked is always the same.

    I can't seem to use %avlocked() in this task at all, only when I use AV Device Info can I use that variable. So I'm forced to use %avoldstatus and %avnewstatus. Should I trigger this profile differently?

    Profile: Front Door Lock (31)
    Event: AutoVera Status Update [ Configuration:Vera: My Vera
    Device: Front Door Lock
    Service: Door Lock
    Variable: Status
    New Value: 1 ]
    Enter: Front Door Notification (32)
    A1: Variable Search Replace [ Variable:%avnewstatus Search:1 Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With:Locked ] If [ %avnewstatus eq 1 ]
    A2: Variable Search Replace [ Variable:%avoldstatus Search:0 Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With:Un-Locked ] If [ %avoldstatus eq 0 ]
    A3: AutoNotification [ Configuration:Title: Front Door Lock Status
    Text: %avnewstatus at %TIME
    Icon: android.resource://net.dinglisch.android.ipack.crystalhd/folder_home
    Status Bar Icon: ic_action_lock_open
    Id: FrontDoor
    SubText: %avoldstatus at %TIME Package:com.joaomgcd.autonotification Name:AutoNotification Timeout (Seconds):0 ]

    Screenshot_2015-04-08-20-29-59.png
     
    Last edited: Apr 9, 2015
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You have set the filter "New Value: 1".
    That will make it only trigger if the status update value is 1 which is probably when your door is locked :)
    Try removing that filter and see if it works.
     
    TomTcom likes this.
  3. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Lol..that worked. Thank you. Do you know how to get the time a variable populated? I want the time the lock opened and closed. They aren't always the same so I can determine if the door never was relocked as an example.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You can for example get %TIMES both times and then compare. The difference will be in seconds
     
    usrmr and TomTcom like this.
  5. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Ok, and then I could probably do maths on it. Ok, I'll take a look on it. Thanks!
     

Share This Page