[RELEASE] Improved Mobile Presence (Android only)

Yep. I went into it and hit save twice just to make sure.

Ya know I don't even recall being asked about those permissions when I installed the patch. They were turned off. I have turned them on, set them to allow all the time, and removed battery optimization. That seemed to fix it, thought it did take a few minutes of Reporting Error # 2 before it all finally synced up. I haven't left the house yet today, but when I go to work in a little bit I will check to see if this is working as I had hoped.

Thanks !

When trying to add lock codes I get UNEXPECTED ERROR.

Here is the log from the link in the error message:

That's strange...

I just tried it on mine and it seemed to work. How are you creating the lock codes so I can try to reproduce the problem? I'm creating mine through the built in "Lock code manager" app.

Does everything display correctly in the configuration screen? Mine looks like this:

I was attempting to use the pre existing lock codes. They were created with lock code manager.

No. I get Unexpected error. I tried rebootung the hub, that didn't help.

That error looks like it may be thrown from the JsonSlurper, and the string looks to be an encrypted value. Maybe turn off encryption for codes in the driver…

It just dawned on me what the issue may be. I use two hubs connected by hub Mesh. the lock and lock code manager live on the devices hub, where all my other apps including presence sensor live on the apps or server hub. So when I try to connect lock codes, there's nothing there for it to see, since the lock code manager doesn't appear to be shareable via hub mesh., unless someone has an idea how to make that work, ill probably have to move PS over to the device hub.

It's definitely possible that would cause an issue.

Depending on how comfortable you are with groovy, you could add a line in there to log the data before it throws the error. Then we could at least see what data it's giving you.

Moving presence sensor to the other hub might solve the problem to lol

My comfort with groovy is thinking I remember Shaggy saying it on Scooby-Doo a lot. Needless to say, I'm clueless about that. Would love to learn, but I have no clue where to begin.

1 Like

Well, since I have no clue about groovy I fell back to plan B. Removed Presence sensor from my apps / rules hub and set it up on my devices hub (the same hub that Lock Code manager is on) . Still getting errors when trying to add lock codes. Th codes were set up in Lock code manager initally about a year ago.

Here is the log:

So at this point I think the best plan is to make it log some extra stuff. I'm not really sure how to solve the problem if I don't know what information it's trying to parse :slight_smile:

You can add log.debug(lock.currentValue('lockCodes')) right after line 121. It should look like this:

def lockPage() {
    dynamicPage(name: "lockPage", install: true) {
    section("Locks"){
      paragraph "Select what lock to listen for events on. This option is used for all devices."
      input "locks", "capability.lockCodes", multiple: true, required: false, submitOnChange: true
    }
    section("Device") {
      def codeNames = []
      if(locks != null)
        for(lock in locks){
          log.debug(lock.currentValue('lockCodes')) // <--- Add this here (line 122)
          def slurper = new JsonSlurper()
          def lockCodes = slurper.parseText(lock.currentValue('lockCodes'))
          for(code in lockCodes.keySet())
            if(lock.getLabel() != null)
                codeNames.push("(${lock.getId()})${lock.getLabel()}: ${lockCodes[code].name}")
        }
      paragraph "Choose a device and select the codes you would like to assign. When any of a device's assigned codes are used, the device will be assumed present for a few minutes. The amount of time can be set in the device preferences."
      input "lockPresenceDevice", "capability.presenceSensor", multiple: false, required: false, submitOnChange: true
      
      if(lockPresenceDevice != null) input "codes-${lockPresenceDevice.getDeviceNetworkId()}", "enum", multiple: true, required: false, submitOnChange: true, options: codeNames, description: "Select lock codes"
    }
  }
}

After you add that that in there it should log some information after you click go to the "assign lock codes" screen.

1 Like

Here's how it looks after I added that, still throwing unexpected errors.

And here is the log that was generated after making that change and trying to add lock codes.

** EDIT **
For background, I was not able to add via HPM, had to import the URLS from Github, used the links in the top post for those. HPM for some reason wont let me down load these. instead of the down load Icon and click ability, this only gives me a check box, and it is not click able.

Ok so the problem is that it's getting whatever "zU0WJAL..." is instead of the actual lock code information.

For reference, it should be getting information like this:


In my screenshot, there is one line for each lock that I have selected.

What lock are you using? Is it using a special driver?

It would be interesting to add a new device using the "virtual lock" driver and see if the information comes through correctly.

I'm off work for the next couple of weeks so if you want to setup a zoom call or something we can try to get it figured out.

P.S. Sorry for the late reply, for some reason Gmail is putting the email notifications somewhere stupid :slight_smile:

It's a Yale Model:YRD256ZW2619

Just using the generic z-wave driver.

I'll send you a DM about doing zoom. That woulds be great. This app finally seems to have my presence headsches under control!

I installed this app, but it does not show up in the apps list. Is it not supported on C7?

My hub is a C7 so that's not the problem :slight_smile:

How did you install the app? All installed apps (regards of if they actually work) should show up. If you installed it manually then I would double check they you installed the app and the driver.

I used the HPM. Gonna use tasker..

Tasker (the autolocation solution in another thread) works, but it drains your battery something awful . I was loosing a full charge in less than 8 hours.

Improved Mobile Presence is much more battery friendly, and has been a bit more accurate than Tasker.

1 Like

Once you install the app code, you still need to go to your apps list and add it from ADD USER APP

1 Like

I finally did get everything setup, but the geofence part, which was the whole point did not work at all