Mimolite for garage door and magnetic door contact

thanks @johnconstantelo for the code here, it worked great.

I’ve modified the design to use a potentiometer instead of a contact sensor initially to get rid of the flakey ST event reporting and then the project got completely out of hand.

I’ve described the changes here MIMOlite Garage Door Sensor with Position Indicator

Hi, can anyone guide me on how to add John code as smartapp, so I can use it with my mimolite. I’m new here? Thank you

Hello, can you please help me to setupdate my mimolite using @johnconstantelo code, please?
I’m new here, I have ST v2. Mimolite and magnetic sensor. I understand the hardware part but I’m lost in regards on how to import the code as smartapp? Thanks.

We can help! Let’s start with a couple easy questions.

First, be sure you are creating a device handler (in the IDE), not a smartapp. You know if you don’t do it right because you’ll get an error. Also, please sure you have the latest code. I’m assuming you’re familiar with the IDE as well.

Have you looked at our wiki for help on creating device handlers?


That provides a pretty decent set of steps to start using custom code.

Thank you for your reply, I finally was able to get it work. Thanks for you and your great code of course. Is there any way to make it recognizable by Amazon echo? Well, it shows as it’s switch but I can make echo to Open/close it?
Appreciate your help johnconstantelo

Until very recently, I was able to say “Alexa, open (or close) garage car door”, but now I can’t. There’s a thread on that subject somewhere in the Community. Now I have to say “Alexa, turn on (or off) garage car door”.

Thank you for your reply, Alexa recognize the command but she don’t send it to the actual garage door opener?

Make sure the device is properly set up in the Alexa app. You may need to remove it from the Alexa app, rediscover devices, add it back, and then rediscover once more. I just tested mine, and it worked by saying “Alexa, turn on (or off) garage car door”.

Thank you for your help l, but I still not able to get Alexa to open/turn on my garage door. I have tried to delete it thenow rediscover it more than once, but nothing happening! It shows in both STRONG and Alexa as if it is been recognized by Amazon echo and she says OK when I ask her to open/close it but nothing happening to the actual garage door?

Thank you johnconstantelo, I had to reset my hub in order to get it work. Appreciate your help.

I am using this device handler with a gate instead of a garage door. The functionality is much the same except that I can’t close the gate if it is left open, I can only see that it is open by the open/close state. The gate has an electric lock that is opened by the momentary switch output via an electromagnet that releases the spring loaded dead bolt causing it to withdraw when activated. Once activated the lock is unlocked until the gate is opened and closed again, it does not lock back after a predetermined amount of time like some do. The momentary function for this type of device needs to be very short to prevent damage to the electromagnet. I would like to shorten the duration of the relay closure but I don’t see it in the code (not a programmer unfortunately). It’s currently about four seconds and I only need 0.5 for my purpose. Four seconds is probably not enough to harm the system but why take chances if it is easily changed somewhere in the code.

I’d really appreciate it if someone could point this out to me, I’ve looked twice but it’s not jumping out at me.

Also, and less important, I was wondering if I may be able to change the graphic to a gate rather than a garage door. I also don’t know where the current images are located or accessed in the code.

Found it on the third look. parameter 11. Changed from 25 to 2, which is about right for my use.

Hi @rrmajiros, I’ve been away on vacation until yesterday and didn’t see your post until today. Glad to see you found it.

I have a gate also and am using Skyjunky device handler which is similar to this. I could not find a gate icon to use but settled for this since I have a swinging gate. I used the st.contact.contact.open and st.contact.contact.closed in the attributeState section under tiles:

attributeState “open”, label: “Open”, action: “push”, icon: “st.contact.contact.open”

It is not ideal, but better than a garage door icon.

Thank you Jack. I didn’t find any better icons either. I think I will end up using these as well.

Thank you John. I’m a bit slow with these things but this is a great resource!

Hi, Im new to the smartthings community but would love to look at this code as a reference for a project I am working on. However when I click on the link github returns a 404 not found. Am i missing something simple, or is there another way for me to view the code? Thanks very much!

Sure! I posted an updated link in post #70, but you can also find it here:


Awesome! Thanks so much. Can’t wait to play around with it.

1 Like

Until very recently, I was able to say “Alexa, open (or close) garage car door”, but now I can’t. There’s a thread on that subject somewhere in the Community. Now I have to say “Alexa, turn on (or off) garage car door”.

I’m getting this on Google Home also. Is there any way to fix that?