Fortrezz Mimo2 DH

I have a Fortrezz Mimo2 that I would like to use on Hubitat. Anyone out there that I can pay to modify the ST DH to work with Hubitat?

/**
 *  MIMOlite device type for garage door button, including power failure indicator.  Be sure mimolite has jumper removed before
 *  including the device to your hub, and tap Config to ensure power alarm is subscribed.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Updates:
 *  -------
 *  02-18-2016 : Initial commit
 *  03-05-2016 : Changed date format to MM-dd-yyyy h:mm a
 *  03-11-2016 : Due to ST's v2.1.0 app totally hosing up SECONDARY_CONTROL, implemented a workaround to display that info in a separate tile.
 *  08-27-2016 : Modified the device handler for my liking, primarly for looks and feel.
 *  01-08/2017 : Added code for Health Check capabilities/functions.
 *  02-11-2017 : Cleaned up code, and used secondary_control again for messages.
 *  03-11-2017 : Cleaned up code.
 *  03-24-2017 : Changed color schema to match ST's new format.
 *  04-08-2017 : Updated the updated() section to call configuration().
 *  05-19-2017 : Added additional attributeStates to match ST's DTH which should make this work with ActionTiles, and to use contact as the main tile instead of switch due to personal preference.
 *  05-20-2017 : Redefined tiles/names to be similar to the Linear-type opener DTH's, which should make this work with ActionTiles.
 *  05-23-2017 : Made the delay longer for retreiving device info (gets) after the main tile or the refresh tile is tapped.
 *  09-22-2019 : converted DH to Hubitat and added refresh before each action
 *  09_24-2019 : Added a refresh to the open/close
 */
metadata {
	// Automatically generated. Make future change here.
	definition (name: "MIMOlite Garage Door Controller 9/24/2019", namespace: "Hubitat", author: "scgs350") {
        capability "Momentary"
        capability "Relay Switch"
	    capability "Polling"
        capability "Refresh"
        capability "Switch"
        capability "Sensor"
        capability "Contact Sensor"
        capability "Configuration"
	    capability "Actuator"
	    capability "Door Control"
	    capability "Garage Door Control"
        capability "Health Check"
        
	    attribute "powered", "string"
        attribute "contactState", "string"       
        
		command "on"
		command "off"
        command "open"
        command "close"
	}
}

def updated(){
	// Device-Watch simply pings if no device events received for 32min(checkInterval)
	sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
    response(configure())
}

def parse(String description) {
	// log.debug "description is: ${description}"
	def result = null
    def cmd = zwave.parse(description, [0x72: 1, 0x86: 1, 0x71: 1, 0x30: 1, 0x31: 3, 0x35: 1, 0x70: 1, 0x85: 1, 0x25: 1, 0x03: 1, 0x20: 1, 0x84: 1])
    //log.debug "command value is: $cmd.CMD"
    if (cmd.CMD == "7105") {				//Mimo sent a power loss report
    	log.debug "Device lost power"
    	sendEvent(name: "powered", value: "powerOff", descriptionText: "$device.displayName lost power")
    } else {
    	sendEvent(name: "powered", value: "powerOn", descriptionText: "$device.displayName regained power")
    }
	if (cmd) {
		result = createEvent(zwaveEvent(cmd))
	}
	// log.debug "Parse returned ${result?.descriptionText}"
    def statusTextmsg = ""
    def timeString = new Date().format("MM-dd-yy h:mm a", location.timeZone)
    statusTextmsg = "Last updated: "+timeString
    sendEvent("name":"statusText", "value":statusTextmsg)
	return result
}

def sensorValueEvent(Short value) {
	if (value) {
        sendEvent(name: "contact", value: "open")
        sendEvent(name: "door", value: "open")
        sendEvent(name: "switch", value: "on")
        sendEvent(name: "contactState", value: "Door is open, close/off to close")
	} else {
        sendEvent(name: "contact", value: "closed")
        sendEvent(name: "door", value: "closed")
        sendEvent(name: "switch", value: "off")
        sendEvent(name: "contactState", value: "Door is closed, open/on to open")
	}
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicReport cmd) {
	[name: "switch", value: cmd.value ? "on" : "off", type: "physical"]
}

def zwaveEvent(hubitat.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	def doorState = device.currentValue('switch')
    if (doorState == "off")
    	[name: "contactState", value: cmd.value ? "close" : "closing", type: "digital"]
}    
    
def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd)
{
	sensorValueEvent(cmd.value)
}

def zwaveEvent(hubitat.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd)
{
	sensorValueEvent(cmd.sensorValue)
}

def zwaveEvent(hubitat.zwave.commands.alarmv1.AlarmReport cmd)
{
    log.debug "We lost power" //we caught this up in the parse method. This method not used.
}

def zwaveEvent(hubitat.zwave.Command cmd) {
	// Handles all Z-Wave commands we aren't interested in
	[:]
}

def on() {
    log.debug "Sending on event to open door"
	open()
}

def off() {
    log.debug "Sending off event to close door"  
	close()
}

def open() {
        refresh()
    then
	if (device.currentValue("door") != "closed") {
		log.debug "not opening door is already open"
	}
	else {
        log.debug "Sending open event to open door"
		push()
	}
}

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

def push() {
	log.debug "Executing push for garage door"
	delayBetween([
        zwave.basicV1.basicGet().format(),
        zwave.basicV1.basicSet(value: 0xFF).format(),
	],1000)
}

def poll() {
	refresh()
}

// PING is used by Device-Watch in attempt to reach the Device
def ping() {
	refresh()
}

def refresh() {
	log.debug "Refreshing"
	delayBetween([
		zwave.switchBinaryV1.switchBinaryGet().format(),
		zwave.sensorBinaryV1.sensorBinaryGet().format(),
        zwave.basicV1.basicGet().format(),
//		zwave.alarmV1.alarmGet(alarmType: 0x08).format()
	],1000)
}

def configure() {
	log.debug "Configuring...." //setting up to monitor power alarm and actuator duration
	delayBetween([
		zwave.associationV1.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format(),
        zwave.configurationV1.configurationSet(parameterNumber: 11, configurationValue: [25], size: 1).format(),
        zwave.configurationV1.configurationGet(parameterNumber: 11).format()
	],100)
}

Does the MimoLite device handler work OK in Hubitat? I have it working in ST and I am about to buy a Hubitat as a second hub, but my setup will only work well if I can drive the MimoLite from the Hubitat side.

I have a largish distance gap between my entrance door and the first floor of our home - its a two unit condo building and Unit 1 is in between us and our entryway. I can optimize the system for our living space or for entryway, but not both. Either my entry is good or my living spaces are good, but never both no matter where I put repeaters etc. My upstairs switches can be slow to respond especially if multiple Z-wave commands are sent at the same time (scenes) and I have the hub closer to entrywaylock. Or my entry door automation breaks if I put the hub upstairs. So, my plan was to get to a Hubitat for downstairs to control the entry way automation and if it goes well consider a second Hub for upstairs - unless of course the Hubitat covers the whole unit better and I migrate everything to the one hub.

Moral is I really need to MimoLite to work with Hubitat. Please tell me it works OK. Thank you for any insight.

I have 2 mimolites (one on each of my garage door openers) and they work fine.

Thank you. Great news!

Quick question about this set-up:

Do you have yours where it's the only device controlling the garage door? On mine the main button and the Mimolite are wired in parallel: So either can open/close. The probkem is the Mimo doesn't know if the door is already open or closed at any point in time.

I have a Tilt sensor for this purpose, but I don't know if there's a way to utilize that tilt sensor with this driver to know if the door is open or closed?

I just did a quick test for example: if I click "Open" in the driver the door opens and the status changes to "open". If I then go manually close the garage door it's status remains "open" even though the door is closed. Now if I press "Close" in the driver it actually opens the garage door because it was already closed.

Before I started trying to re-code this myself I figured I would check to see if I'm missing something obvious.

-Jeremy

Hello all. I am looking for this functionality as well. I just moved over (literally spent the past few hours configuring) to Hubitat from Vera. So far, I love it. It has replaced PLEG quite well with its built in logic.

I used/tested the code from NoWon and it works great for one door, but Hubitat doesn't see the "B-side". In reviewing the SmartThings forums, it appears that it requires a "B-side" app from their store. Here is the link that I was viewing: Mimo2+ Full Functionality. I hope no one minds me linking to their site, if so, I can remove it.

Any help would be appreciated since I am new to this subject!

@jeremy.akers
my mimolite is connected in parallel to the garage door switch as well. I use a magnetic switch hard wired to the mimolite to indicated open/closed.

@taylotr
I do not have a mimo2 and can not access smartthings website from work but you can try to copy the mimo2 device handler from smartThings and paste it into notepad and then at the top select replace and select replace all and change physicalgraph in the DH to hubitat
then copy all of the code and create a device handler
should work

I had tried to do just a copy/paste of the code and the physicalgraph is definitely the problem. I just wasn't certain what to change it with.

I will give it a shot and report back my findings!

Well. I got both of the drivers imported, after changing physicalgraph to hubitat. I also installed the Groovy app, as if I didn't, the "B-side" wouldn't be seen. Right now, neither side works. In the logs, I do see that the power is recognized as when I pull the plug it understands, so there is communication. Just not with the relay(s).

Thought I'd check, did you ever get this working? I looked at the link on ST and the code on GitHub, but I'm not sure I'm competent enough to make a child side as it mentions. I will say the driver for mimolite works fine, but I'd really like to get the b side working. If it helps I can paste the driver code in here if someone will help me figure out how to fold it into the Mimolite driver. I think that's all it takes.

Does the input for sensing the garage door status work for you? I copied your driver, but the contact always shows open, even though I have a closed contact connected to the Mimolite input. The Mimolite input LED comes on, so it senses it correctly, but Hubitat does not.

yes reports door: open close fine.
I actually have to adjust the magnetic sensors they are a little to sensitive sometimes report
switch: opening state but door: state correctly remains closed (doesn't really affect anything just annoying)
last winter I got a small drift of snow against the garage door and it kept the garage door up very slightly and triggered a door: open state. Only noticed because a small sliver of light was coming along the bottom of the door.
Created a rule to send a push notification if the door was open more than 10 minutes every hour and another rule to close the door if open more than 10 minutes and repeat until closed.

have you tried selecting refresh and configure or a zwave repair?
I have no idea why they have a switch state vs door state. door state is all that is required
only helps setting door switch sensitivity.

1 Like

Just did a refresh-configure as well as two Z-wave repairs, it still shows the door as open. I also tried another driver, which I found here in the forum somewhere and it has the same problem. Switch is always open, even though I have the input jumpered straight to the +18V or whatever the voltage of the power supply is. Maybe my Mimolite is broken.
Well, got a Samsung universal sensor now checking the door status, so at least I know if the garage is closed or not. Unfortunately the whole "Door opening/closing" functionality does not work this way.
Thanks for your help.

you hooked the magnetic sensor to voltage?
it shouldn't be
make sure it is wire like this

1 Like

You have wired the sensor to the dry contact terminals, correct?

That was the problem - its working fine with a dry contact. I only found their regular manual and them talking about analog voltages made me think it needs an external voltage... Feel like an idiot now :wink:
Thanks for the diagram!

1 Like

no problem it is hard find this diagram and the manual is not very clear.
I will upload the picture in case aartech decides to not carry that product in the future.

I ported the Mimo2 DH and then finished their incomplete "b-side" driver by making it a child device. More details over in this thread...

deleted line 208 in the DH
zwave.alarmV1.alarmGet().format()
saved it and the DH is working again.
with the latest hub update 2.1.1.122