Mimolite for garage door and magnetic door contact

In my case the tilt sensor is very accurate in determining if the garage door is open or closed. I do not have a contact switch. My LFM-20 relay just clicks to close the circuit (open/close the door). Like you said its position is irrelevant.

I’m frustrated that ST does not recognize that the door is already open when my wife gets home a few minutes before me and she leaves the door open for me. Then when I arrive the door is closing on me!

It’s like the relay switch, ST, and tilt sensor are not communicating with each other.

@johnconstantelo I think this (your v3 code above) looks great. I’ve been having similar issues as others where my magnetic contact is clearly closed, yet the system things it’s open. It has been working fine for weeks (at least for open/close). The momentary seems to always be off a bit (opening / closing). I was going to use your code, but I get this error. Any thoughts?

Org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]

I wasn’t sure if I needed to, but I went in and removed my current mimolite device and have no garage door listed anywhere. Any thoughts?

Thanks!
chris

I just found this posting, that had the same error I received. I will test it out and report back.

I just tested mine again by making a small change to the code and saving and publishing for myself. All worked perfectly, and I didn’t get the same error you posted above. The “garageDoorControl” capability is still there too

As for the open/close issue, I have had that before, and it turned out to be an issue with the device itself. I would power cycle the MIMOLite every few weeks, and that seemed to also make the problem go away for a while. That got annoying, so I was able to return it for a complete replacement, and all has been well ever since.

Just to be safe, I made sure the GitHub source is the same as what I’m using by refreshing the code on Github.

If you’re lucky enough to have the old Doors & Locks dashboard, this device type will allow you to have the door control enabled in that dashboard:

Thanks @johnconstantelo for the update. I just downloaded your latest version. Sadly, I received the exact same error. So I tried this as someone else mentioned and it worked (commenting out the one capability):

capability “Garage Door Control”
//capability "garageDoorControl"
attribute “power”, “string”

I’m not sure why it fails in the first place though or how you got it to work? I was then able to add a new device and it all now works. I did not yet uncomment the field, as someone else said they did. What will I need it for? If I add a routine (which I plan on doing). Also, I just re-plugged my mimolite in and the open/close is correct. So I will watch for this, maybe I have the same issue you did - if it acts up in a few weeks I’ll know.

Finally, noticing your screenshot, mine does not show the “last refreshed” on the main Garage Door screen as your does. It only shows the current open/close status. Also, I don’t have the Doors & Locks screen, but that’d be nice. :smile:

Thanks!
chris

Hi @sawall, you should be seeing the same thing as me now, as well as have no errors. That’s really odd. Just in case, here’s a plain text link for the code to that nothing weird gets included in your cut/paste:

https://raw.githubusercontent.com/constjs/SmartThings-Devices/master/mimolite_garage_door_v3.device.groovy

The old dashboard I think is something ST needs to bring back, or at least add something into all that empty space left over under Smart Home Monitor. Unfortunately, there’s nothing users can do to get those dashboards installed.

I’ve been experimenting with door capabilities to understand which ones will work via Routines, and this device type should work. I tested with a presence sensor and mobile sensor, but the poor reliability of mobile presence sensing was not worth it. The physical presence tag literally needed to be next to the house to open the door. In that situation, I might as well use the built-in Homelink button on the mirror!

Oh,and per the open/close issue, make sure you are within a year of purchase for your warranty to still cover you for replacements.

Thanks again @johnconstantelo. I actually went directly to your github repository and looked through most of your apps, including the v3 for the garage door. When I grabbed it, it said you had just updated it 21 minutes ago (at the time). So I assume I have the correct version, yes?

I just set up a routine, using SmartRules, so I’ll test it out tonight and reply back. It should turn on some of my interior lights when the garage door opens and it’s after sunset but before 4AM. SmartRules is pretty slick, but I’m open to options if others have them. What I like is the very precise if, and, or statements and the fact you can have several use cases that must be true (or false) for it to happen.

Good note on the warranty time period! I’ll make myself a calendar event to remind myself.

Chris

the hyperlink doesn’t work can you tell where I can get this code from please?

Hi @spikebetrayer,

Sorry about that, I’ve been moving code around. Here it is:

https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-mimolite-garage-door-controller.src/my-mimolite-garage-door-controller.groovy

1 Like

I get this error message when I try to save the code for the smart app

No signature of method: script1459606101721456449000.metadata() is applicable for argument types: (script1459606101721456449000$_run_closure1) values: [script1459606101721456449000$_run_closure1@2612fcac] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

I don’t have the old dashboard,i have Samsung 7 edge ,how can I do this with new phone . I am new

That’s because this is code for a device handler, not a smart app.

The old dashboards aren’t available anymore. It doesn’t matter what kind of phone you have. Unfortunately, nobody knows if the old dashboard will ever return.

Hi there, I just tried your code this morning. The new tile on my phone seems to work very reliably. I thought all was great and started adding some smartapps stuff to make my garage door automatically close if i left home without pressing closed and gave it a try. Nothing. I looked at the live logs on the developer section and noticed that when i press the button on the phone, the command shows command sent is “ACTUATE” whereas when i select the upon entering this phase, close xyz garage door, the command

settings: [garageDoors:[Garage Door],
garageAction:Open, lockDoors:[Front Door], onSwitches:[Driveway, Front
Porch, Table, Back Porch, Away via Garage]]

or when turning off

settings: [disabledAutomationApps:[Someone Arrives,
At Sunrise or Sunset, Things Start Happening, Things Quiet Down],
salutation:Goodbye., garageDoors:[Garage Door], garageAction:Close,
pushNotification:true, securitySystem:away, lockDoors:[Front Door],
disabledModes:[Away, Guest], offSwitches:[Back Left, Back Right, Front
Left, Front Right, Entrance Hall, Hall Light, Kitchen Counter, Table,
Overhead Inside Row, Overhead Outside Row], newMode:Away]

From the logs, i see this for the automated one… I’ll post the output from pressing the button via your code after that

2:32:17 PM:
debug
Parse returned null


2:32:17 PM:
debug
command value is: 2003


2:32:17 PM:
debug
description is: zw device: 20, command: 2003, payload: 00 


2:32:17 PM:
debug
Parse returned null



2:32:17 PM:
debug
command value is: 3003


2:32:17 PM:
debug
description is: zw device: 20, command: 3003, payload: 00 



2:32:17 PM:
debug
Parse returned null


2:32:17 PM:
debug
command value is: 2503


2:32:17 PM:
debug
description is: zw device: 20, command: 2503, payload: 00 


2:32:17 PM:
debug
Executing Refresh/Poll for garage car door per user request

Here is via the app… i did an open then a close

2:36:37 PM:
trace
ambientLightOK = true 


2:36:37 PM:
trace
timeOk = true


2:36:37 PM:
trace
timeWindowStop = null

2:36:37 PM:
trace
timeWindowStart = null


2:36:37 PM:
trace
daysOk = true


2:36:37 PM:
trace
modeOk = true


2:36:37 PM:
trace
triggerHandler(contact: closed)


2:36:37 PM:
debug
Parse returned null


2:36:37 PM:
debug
command value is: 2001


2:36:37 PM:
debug
description is: zw device: 20, command: 2001, payload: 00 


2:36:37 PM:
debug
onContactChange


2:36:37 PM:
debug
state: already on


2:36:37 PM:
debug
contactHandler: contact: closed


2:36:27 PM:
debug
Parse returned null


2:36:27 PM:
debug
command value is: 2503


2:36:27 PM:
debug
description is: zw device: 20, command: 2503, payload: 00 


2:36:25 PM:
debug
Parse returned null


2:36:25 PM:
debug
command value is: 2003


2:36:25 PM:
debug
description is: zw device: 20, command: 2003, payload: FF 


2:36:25 PM:
debug
Parse returned null


2:36:25 PM:
debug
command value is: 3003


2:36:25 PM:
debug
description is: zw device: 20, command: 3003, payload: FF 


2:36:25 PM:
debug
Parse returned null


2:36:25 PM:
debug
command value is: 2503


2:36:25 PM:
debug
description is: zw device: 20, command: 2503, payload: FF 


2:36:25 PM:
debug
Executing ACTUATE for garage car door per user request


2:36:02 PM:
debug
Parse returned null


2:36:02 PM:
debug
command value is: 2503


2:36:02 PM:
debug
description is: zw device: 20, command: 2503, payload: 00 


2:36:01 PM:
debug
off()


2:36:01 PM:
trace
stopAction()


2:36:01 PM:
trace
ambientLightOK = true 


2:36:01 PM:
trace
timeOk = true


2:36:01 PM:
trace
timeWindowStop = null


2:36:01 PM:
trace
timeWindowStart = null


2:36:01 PM:
trace
daysOk = true


2:36:01 PM:
trace
modeOk = true


2:36:01 PM:
trace
stopHandler(contact: open)


2:36:01 PM:
debug
Parse returned null


2:36:01 PM:
debug
command value is: 2001


2:36:01 PM:
debug
description is: zw device: 20, command: 2001, payload: FF 


2:36:01 PM:
debug
onContactChange


2:36:01 PM:
debug
state: already on


2:36:01 PM:
debug
contactHandler: contact: open


2:36:00 PM:
debug
Parse returned null


2:36:00 PM:
debug
command value is: 2003


2:36:00 PM:
debug
description is: zw device: 20, command: 2003, payload: FF 


2:36:00 PM:
debug
Parse returned null


2:36:00 PM:
debug
command value is: 3003


2:36:00 PM:
debug
description is: zw device: 20, command: 3003, payload: 00 


2:36:00 PM:
debug
Parse returned null


2:36:00 PM:
debug
command value is: 2503


2:36:00 PM:
debug
description is: zw device: 20, command: 2503, payload: FF 


2:36:00 PM:
debug
state: already on


2:36:00 PM:
debug
schedule check, ts = null


2:36:00 PM:
debug
Executing ACTUATE for garage car door per user request


2:36:00 PM:
debug
state: already on


2:36:00 PM:
debug
schedule check, ts = null


2:36:00 PM:
debug
state: ready


2:36:00 PM:
debug
schedule check, ts = null

I’m actually new to this (just finished installing all of the stuff I’ve ordered over the past couple of weeks last night and have not actually written any code, but if i understand what i’m seeing correctly, the command that the “close” and “open” garage door is sending to the unit is garageDoors:[Garage Door], garageAction:Close and garageDoors:[Garage Door], garageAction:Open ? Does that mean just adding something that captures garageAction:Open and garageAction:Closed and map them to switch:On and switch:Off ? … or perhaps replace the “on” and “off” as i don’t think i want to turn my garage door “on” or “off” but might be useful for a smartapp, I’m thinking this is 99% perfect, but just not familiar enough with the capabilities and exact syntax without spending a lot of time researching that you probably already have committed to memory.

My device handler code already accounts for any variation that could be used: on, off, open, close

def on() {
	open()
}

def off() {
	close()
}

def open() {
	if (device.currentValue("contact") != "open") {
		log.debug "Sending ACTUATE event to open door"
		push()
	}
	else {
		log.debug "Not opening door since it is already open"
	}
}

def close() {
	if (device.currentValue("contact") != "closed") {
		log.debug "Sending ACTUATE event to close door"
		push()
	}
	else {
		log.debug "Not closing door since it is already closed"
	}
}

def push() {
	log.debug "Executing ACTUATE for garage car door per user request"
	delayBetween([
		zwave.basicV1.basicSet(value: 0xFF).format(),
		zwave.switchBinaryV1.switchBinaryGet().format(),
		zwave.sensorBinaryV1.sensorBinaryGet().format(),
        zwave.basicV1.basicGet().format(),
		zwave.alarmV1.alarmGet().format() 
	],100)
}

If you’re using a Routine, I’m not sure why it’s not working. I won;t be able to dig into this for a little while due to another ST project I’ve got to get done in short order (another hub migration). I’ll be able to look into this eventually.

Thanks and no problem. Per the debug info i only see the ACTUATE debug, so perhaps it is skipping through it? If i figure out anything in the meantime, i’ll share back anything useful.

The actuate event you have in the event log posted above is coming from the push() section of code. You should also see an actuate event log coming from either open() or close() if a Routine is working as expected. You can also try a Rule Machine rule to see if that behaves differently.

FYI, i gave up for the moment on the routine for “garage door close” and “garage door open” options, and instead simply used the switch “on” and “off” for my arrive and goodbye routine. It seems to work perfectly that way. Anyway, i don’t seem to see a way to really debug the “routine” code, so hopefully whenever you get back around to it, can have a look. The on/off switch does generate 2 debug messages whereas the open/close only generates the one debug message. almost like the open/close commands are getting sent directly to push for some reason… maybe the routine is doing that. I’m not experienced enough to figure it out yet.

Anyway, just wanted to say thanks for writing the updates to all of this as the one published by ST just did a momentary “push” every time ON was signaled, but did nothing when OFF was signaled. Yours has the right and also doesn’t always show status as ‘closing’ or ‘opening’ after a few minutes like the other one did.

1 Like

ok john I finally got the APP installed how do I get the door to show status using the tilt sensor? thanks to your help I have made progress just need a little more help .

Ok, good progress. The Mimolite uses a built in open/close device with a wired external contact sensor, and that’s how the device handler works to show status. It can’t use a separate device like a wireless tilt or open/close sensor. Look up at posts 3 and 4 and you’ll see how it’s set up and configured.