Zone Motion Manager

@mike.maxwell

Mike I just tried to use you zone motion manager app from ST
Seemed to import the code for the driver and app ok
When I try to create a new zone I get a server error "Error 500"

EDIT:
I had forgotten to add the child app!
But.. now when I try to add a new zone the app is blank

Any Ideas?

Andy

The built-in Motion Lighting app doesn’t work for you? Just curious why you needed the zone motion manager instead.

I use it to aggregate motion between a number of motion sensors.
It creates a virtual sensor that I can use in my other apps

Does your real-time log give you any further details? Open a new tab on your log page and leave it open. It’s probably a code change from Smartthings to Hubitat that’s missing.

Nothing that actually helps

“2018-03-04 18:33:38.002:errorCannot get property ‘device’ on null object on line 46”

There is nothing on line 46 in the child or parent or Driver which relates to ‘device’

It’s probably the call that line feeds back to that is missing a designation. Can you post the source, or link to it?

Mike has it on his GitHub here:

https://github.com/MikeMaxwell/zmm

You’ve changed all instances of physicalgraph to hubitat already?

Nope… 1st try at importing something…

How do I do that?
Is there a link to some info somewhere?

Yeah. Open your code, search for “physicalgraph” and replace every instance with “hubitat” instead. :wink:

There was only one instance on line 47
But still no go.

Still getting the same error message, or something different?

Almost identical
it just says line 47 now not 46

This is the section of code it relates to:

def getHubID(){
    def hubID
    if (myHub){
        hubID = myHub.id
    } else {
        def hubs = location.hubs.findAll{ it.type == hubitat.device.HubType.PHYSICAL } 
        // log.debug "hub count: ${hubs.size()}"
        if (hubs.size() == 1) hubID = hubs[0].id 
    }
    //log.debug "hubID: ${hubID}"
    return hubID
}

Line 47 is the 1st line after the else statement

Yep, you’ll have to wait for one of the resident experts to get back to you then. I’m good for basic find and replace to get the process started.

I’m not sure what the getHubID method is for
It’s not called from anything that I can see

Thanks for the tips anyway

It’s called at line 69 and line 218. It’s how the child device communicates with the parent app, as far as I can tell.

Don’t know how I missed that!

Perhaps a different method of sending variables to the parent is used with hubitat?

Here's what Mike said below and I am patiently waiting. I don't think I can tolerate my ST motion sensors without this app.