Working MIMOlite Device Type with Sensor

This is my code for MIMOlite as a smoke sensor/alarm trigger. It works in my application. All you would need is to change some wording and icons. Let me know how far you get.

Simulator will be your best friend, the console helps a lot with debugging.

1 Like

this can hopefully serve as a reference implementation for using some of the more advanced (configuration/alarm/association/multireports) of the MIMOlite. as its configured, i’m using it for a doorbell and so the relay isn’t configured as a switch, but is activated by the signal. the idea is that when someone “rings” the doorbell the relay is activated and i am able to turn on a light/siren/etc. its not configured so that i can turn on/off the switch from within smartthings, the switch is only turned on if the signal is activated. at present, i’m actually only using the signal as a contact sensor so that i can use other smartapps to orchestrate various actions when someone rings the doorbell. the configurations are specific to my implementation, but should give you a good idea as to how to use them. checkout the documentation on fortrezz site for more specifics (if the site gives you an error, click on any link on their site, and then hit “back” in your browser). i also left the code (you need to uncomment it) to use the device as a “switch” and you need to change the configuration value for parameter 3.

/**
 *  MIMOLite Doorbell
 *
*/
metadata {
	definition (name: "MIMOLite Doorbell", namespace: "NTDCS", author: "Adam Newcomb") {
    	capability "Contact Sensor"	
	capability "Refresh"
        capability "Configuration"
        //uncomment for switch
        /*
        capability "Polling"
        capability "Switch"
        */
	}

	simulator {
		// reply messages
		reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
		reply "200100,delay 100,2502": "command: 2503, payload: 00"

		// status messages
		status "open":  "command: 2001, payload: FF"
		status "closed": "command: 2001, payload: 00"
        
        //uncomment for switch
        /*
        status "on":  "command: 2003, payload: FF"
		status "off": "command: 2003, payload: 00"
        */
	}

	tiles {
		
        standardTile("contact", "device.contact", inactiveLabel: false) {
			state "open", label: "DingDong!", icon: "st.security.alarm.alarm", backgroundColor: "#ffa81e"
			state "closed", label: " ", icon: "st.security.alarm.clear", backgroundColor: "#79b821"
		}
        
        standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
		}
        
        standardTile("power", "device.power", canChangeIcon: true, canChangeBackground: true)
		{
        	state "off", label: 'OFF', backgroundColor: "#ffa81e", icon:"st.switches.light.off"
        	state "on", label: 'ON', backgroundColor: "#79b821", icon:"st.switches.light.on"
        }

		//uncomment for switch
        /*
		standardTile("switch", "device.switch", canChangeBackground: true, canChangeIcon: true, inactiveLabel: false) {
        	state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
			state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#ffa81e"
        }
        */
        
        valueTile("voltage", "device.voltage") {
			state("voltage", label:'${currentValue}v', unit:"ADC")
		}
        
        
		main (["contact"])
        
        //uncomment for switch
		details(["contact", "voltage", "refresh", "power" /* , "switch" */])
	}
}

def parse(String description) {

    def result = null
    def cmd = zwave.parse(description, [0x20: 1, 0x84: 1, 0x30: 1, 0x70: 1, 0x31: 3, 0x71: 1])
    if (cmd) {
        result = zwaveEvent(cmd)
        log.debug "parse cmd: '${cmd}' to result: '${result.inspect()}'"
    } else {
        log.debug "parse failed for event: '${description}'"
    }
    result
}

def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd)
{
	log.debug "zwaveEvent SensorBinaryReport: '${cmd}'"
	sensorValueEvent(cmd.sensorValue)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd)
{
    //BUGBUG_NOTE: this is the event that gets sent from simluated messages and also if subscribed to association group 1
	log.debug "zwaveEvent BasicSet: '${cmd}'"
    sensorValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv3.SensorMultilevelReport cmd)
{
	log.debug "zwaveEvent SensorMultilevelReport: '${cmd}'"
    
    createEvent( name: "voltage", isStateChange:true, value:cmd.scaledSensorValue,descriptionText: "${device.displayName} measured voltage in ADC Counts")
}

def zwaveEvent(physicalgraph.zwave.commands.alarmv1.AlarmReport cmd)
{
	log.debug "zwaveEvent AlarmReport: '${cmd}'"
    
    switch (cmd.alarmType) {
        case 8:
            def map = [ name: "power", isStateChange:true]
            if (cmd.alarmLevel){
                map.value="off"
                map.descriptionText = "${device.displayName} lost power"
            }
            else {
                map.value="on"
                map.descriptionText = "${device.displayName} has power"
            }
            createEvent(map)
        break;
		default:
        	[:]
        break;
    }
}

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	log.debug "zwaveEvent SwitchBinaryReport: '${cmd}'"
	switchValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
	log.debug "zwaveEvent BasicReport: '${cmd}'"

    switchValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
	log.debug "zwaveEvent ConfigurationReport: '${cmd}'"
    [:]
}

def zwaveEvent(physicalgraph.zwave.commands.associationv2.AssociationReport cmd) {
    cmd.nodeId.each({log.debug "AssociationReport: '${cmd}', hub: '$zwaveHubNodeId' reports nodeId: '$it' is associated in group: '${cmd.groupingIdentifier}'"})
    [:]
}
def zwaveEvent(physicalgraph.zwave.Command cmd) {
	log.debug "zwaveEvent Command not Handled: '${cmd}'"
	// Handles all Z-Wave commands we aren't interested in
	[:]
}

private sensorValueEvent(Short value) {

	def result = []
    
    if (value) {
    	log.debug "Open sensor value event: $value"
        result << createEvent(name: "contact", value: "open", descriptionText: "$device.displayName is open", isStateChange:true )
	} else {
        log.debug "Closed sensor value event: $value"
		result << createEvent(name: "contact", value: "closed", descriptionText: "$device.displayName is closed", isStateChange:true)
	}
    
    result
}

private switchValueEvent(Short value)
{
	createEvent([name: "switch", value: value ? "on" : "off", isStateChange:true ])
}


def refresh() {
	log.debug "executing 'refresh'"

    delayBetween([
		zwave.configurationV1.configurationGet(parameterNumber:3).format(),
		zwave.configurationV1.configurationGet(parameterNumber:4).format(),
		zwave.configurationV1.configurationGet(parameterNumber:5).format(),
		zwave.configurationV1.configurationGet(parameterNumber:6).format(),
		zwave.configurationV1.configurationGet(parameterNumber:7).format(),
        zwave.configurationV1.configurationGet(parameterNumber:8).format(),
        zwave.configurationV1.configurationGet(parameterNumber:9).format(),
        zwave.configurationV1.configurationGet(parameterNumber:11).format(),
        zwave.associationV1.associationGet(groupingIdentifier:1).format(),
        zwave.associationV1.associationGet(groupingIdentifier:2).format(),
        zwave.associationV1.associationGet(groupingIdentifier:3).format(),
        zwave.associationV1.associationGet(groupingIdentifier:4).format(),
        zwave.associationV1.associationGet(groupingIdentifier:5).format(),
        zwave.switchBinaryV1.switchBinaryGet().format(),
        zwave.alarmV1.alarmGet(alarmType:8).format(),
        zwave.sensorMultilevelV3.sensorMultilevelGet().format()
	],100)
}

// handle commands
def configure() {
	log.debug "executing 'configure'"
    
    /*
    8v=11000101 = 197
	7v=11000001 = 193

	4v=2741=10101011 = 171
	5v=2892=10110100 = 180

	.5v=631=00100111=39
	2v=2062=10000000=128

	24v=11101000 = 232
	23v=11100111 = 231

	1.5v=1687=01101001=105
    1.25v=1433=01011001=89
    1.125=1306=01010001=81
	1v=1179=01001001=73
    */
	def cmd = delayBetween([
    	//zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [1]).format(),  // clear pulse meter counts
    	zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, configurationValue: [1]).format(),  // sig 1 triggers relay
        zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, configurationValue: [100]).format(),  // lower threshold, high
        zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, configurationValue: [39]).format(),  // lower threshold, low
        zwave.configurationV1.configurationSet(parameterNumber: 6, size: 1, configurationValue: [232]).format(),  // upper threshold, high
        zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, configurationValue: [231]).format(),  // upper threshold, low
        zwave.configurationV1.configurationSet(parameterNumber: 8, size: 1, configurationValue: [1]).format(),  // set to analog, below bounds
        zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, configurationValue: [255]).format(),  // disable periodic reports
        zwave.configurationV1.configurationSet(parameterNumber: 11, size: 1, configurationValue: [0]).format(),  // momentary relay
        zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId).format(),	//subscribe to basic sets on sig1
        zwave.associationV1.associationSet(groupingIdentifier:2, nodeId:zwaveHubNodeId).format(),	//subscribe to basic multisensorreports
        zwave.associationV1.associationSet(groupingIdentifier:3, nodeId:zwaveHubNodeId).format(),	//subscribe to power alarm
        zwave.associationV1.associationRemove(groupingIdentifier:4, nodeId:zwaveHubNodeId).format(),	//unsubscribe from binary sensor reports
        zwave.associationV1.associationRemove(groupingIdentifier:5, nodeId:zwaveHubNodeId).format()	//unsubscribe from pulse meter events
	],100)
    //associationRemove
}

//uncomment for switch
/*
def poll() {
	// If you add the Polling capability to your device type, this command will be called approximately
	// every 5 minutes to check the device's state
	//zwave.basicV1.basicGet().format()
}

def on() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0xFF).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	],100)
}

def off() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0x00).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	],100)
}
*/

hope this helps someone.

5 Likes

Can someone please recommend how to physically connect my MIMOlite to my existing garage door opener and which device type to use? I am currently using the NC/COM contacts wired directly to the door opener (along with existing door open button) and the momentary device type from above without any luck. I believe that device type doesn’t define its capabilities (such as contact sensor/button/momentary/etc). Any help clarifying this would be a great help (and I wouldn’t mind if you shared your code for the device type if it’s working!) Thanks as usual everybody!

@mbial The MIMO should be wired in parallel with your existing button and connect between NO and COM

1 Like

Here is the official FortrezZ diagram:

2 Likes

Thanks @beckwith and @docwisdom for the wiring diagrams. Should I wire to the existing garage door button wires or can I go directly to the terminals on the garage door opener itself? Which of the device types above should I be using? It appears the momentary version doesn’t have capabilities in the metadata, not sure if that’ll matter. Thanks for clarifying!

Best,
Matt

@mbial

Depends. You can’t go wrong connecting to the opener. In my case, the switch had a lit led with a diode which would not work.

Here I’m going to have to pass because the one I used has not been functioning since May. It was great when it did work but SmartThings made a change and it no longer works. They have said a new device type is pending for months.

i also wired a mimolite to open my garage door (relay) and a smartsense multi to detect open/close (sensor). All i did was remove the jumper 5 from the mimolite (to make it momentary), connected it directly to the terminals on the garage door opener (the same terminals the wired wall mount garage door opener uses) and added the garage door using the smartthings mobile application. there is a doors and locks section from which you can choose the configure function, there is the ability to add a conventional garage door, which will walk you through the setup and identification of the relay and the sensor. fwiw, after the setup/installation the mimolite device type is: Z-Wave Virtual Momentary Contact Switch and the smartsense multi device type is: SmartSense Garage Door Sensor Button

1 Like

@gorf

Thanks. It would make sense because it stopped working about the time SmartThings added this new interface. I’ll try excluding my Mimolite and add it back following your process.

Im going to have to test my MIMO with this garage door code and see whats up with it.

@gorf

That didn’t work for me. I didn’t read your response that carefully. You are using a smartsense multi to determine open/close state. I am using the Mimolite normally open port.

As I said before, this worked until two months ago, and hasn’t since.

Still waiting for the update from SmartThings.

@beckwith i’m not sure there is enough context from your posts in this thread but i’ll throw out a few things that might help you.

  1. you mentioned at some point your mimolite was working and has since stopped. by the fact you mentioned you see it as “opening” and “closing” within the smartthings app, i wonder if the mimo is working but it isn’t wired correctly to your garage door? did you check the physical connections and certain you are using com1/no1?
  2. which code are you using for your device type?
  3. if you walk through setting up a new garage door as i mentioned above, the app will prompt you for what you want to do with your new garage door, the two choices of interest are “know if its open or closed” and “open and close it remotely”. for the former, it appears the the application will let you pick any device configured as a contact sensor. you should see your mimolite device in the list if configured correctly. if not you may need to update your device types capability with “Contact Sensor” . similar feedback for the latter. it will let you pick a device with capability “switch”. if configured correctly, you again should see your mimolite device. if you can and select both, i suspect it will work for you. if not and not a physical connection problem, you might have a bad mimolite device.

hopefully that will get you thinking, if not, provide some specifics and i can probably help you through it.

@gorf

I can either get the button to push or the sensor to indicate the door status but not both. It used to work until the middle of May using JitJack’s code.

By default it comes up as a z-wave switch which allows me to open and close the door (of course changing to momentary switch device type for correct function). When I load JitJacks code the open/close status is properly displayed but I’m unable to use the button to open/close the door.

I’m sure I can get a smartsense multi as a door sensor but I don’t want to use a battery powered device. Managing batteries is becoming a real pain.

Note that with the MiMoLite, if you want to CHANGE the setting of the jumper (momentary/constant), you need to follow these steps

  • Exclude the MiMoLite from your ST network
  • Remove the power to the MiMoLite
  • Change the jumper
  • Power on the MiMoLite
  • Re-associate with your ST network

This because the jumper state is ONLY READ when the device is powered on while NOT associated to a Z-Wave network (I found out the hard way).

1 Like

Thanks all for all your hard work on this device type and support.

The ST team is working on integrating many devices in the upcoming months; unfortunately we have a backlog of devices to certify. In the meantime I encourage the strong community support until we make the device immediately available within the app without creating a device type via the IDE. Hopefully soon enough we’ll have quicker turn-around on projects you’ve put so much effort on.

Thanks again,
Gil

2 Likes

Hello all,

New to ST and the dev side of things. I found this thread when looking for info on how to use my MIMOLite to open and close my garage. I have a few questions, and I am hoping you all can help!

First, some info:

1: I connected the mimolite, and the system sees it as a z-wave switch. I already removed the jumper, and it’s setup as a momentary switch. It’s connected to my garage opener. I can successfully open and close the door with it.

2: I have a wireless/z-wave tilt sensor attached to the door. It also correctly identifies when the door is open and closed.

What I am wanting to do is the following:

When my wife comes homes, leverage the presense of her phone to trigger the garage door to open automatically. But i need the tilt sensor somehow involved, to check the state of the door (open/close), so that it doesn’t close the door if it’s already open.

Also, i noticed the device types some here have created, but I can’t figure out how to modify the mimolite device properties to input any of the device types above. Completely lost on this part.

Can anyone provide any guidance?

Thanks
Shannon

I have been working on using a MIMOlite for a doorbell application. I took the code @gorf posted as my starting point. (thanks!). I connected in the push wiring so that the 16V AC activated a relay which closes the contacts on the MIMOlite input SIG1. That works great. I have bells on all levels of the home and they support 3 buttons. I am using the output relay on the MIMOlite to simulate a third button so that a push of the switch tile in ST will ring the bells with a special chime. I’m hoping eventually to modify the code so that the device publishes an audio/alert capability, but I haven’t got that far yet.

One of the things I really like about the MIMOlite is that it issues a power drop out alarm when it loses the DC input. It occurred to me that this would make a great “is your house power on?” sensor". The code I am using quickly issues the alert when the power goes out, but when it comes back on it doesn’t seem to see that. If you hit refresh on the tile, I see that this is part of the code:

      zwave.alarmV1.alarmGet(alarmType:8).format(),

and after having hit refresh, this snippet seems to make the “MIMOlite has power” message appear. But, I don’t want to have to hit refresh


I noticed that when the power comes on the state of the SIG1 input is reported immediately so I found the bit of code which deals with that and added this:

   if (state.juice == 0) {
 state.juice=1
	result <<     createEvent( name: "power", isStateChange:true, value: "on", descriptionText: "${device.displayName} has power")
   
}

Now I get an immediate interface update when the power is back, so that seems to sort of solve it, but I’m sure it’s not the best or right way to do it.

So finally I’m on to my question: I have noticed that when you hit the tile to switch the relay output on and off, it seems to cause the MIMOlite to issue a power dropout alarm. I don’t want my bell usage to keep firing “your power is out” messages, so it would be nice to solve this. I decided to see if this was a smart things event handling issue or whether this might be a hardware thing by connecting the output relay to the status of the input relay by setting zwave parameterNumber: 3 to 1. This means that the device is performing its relay on/off function indepently of what ST is doing, and sadly triggering SIG1 closed to make the output relay trip DOES also cause a power drop out alarm to appear. Does this mean it’s a hardware thing? Could tripping the output relay be causing the input voltage being monitoring to actually drop? Has anyone else seen this?

CB

Yep. It’s up there and released.

two things:

  1. is the mimolite powered by an external adapter or wired in to the doorbell system?
  2. what are you using for the activated relay? i’m having issues with false positives and wonder if this might be my answer?

@gorf - my doorbell wiring uses 16V AC and the MIMOlite I received can only be powered by DC. The first runs of MIMOlite could be powered by AC or DC but not the newer ones, which I was pretty annoyed about because when I actually placed my order their online spec sheet clearly said “AC or DC” and when it turned up with a manual that said otherwise it was unexpected. Anyway, I have my unit being powered by 13.5V DC. The relay I am using is “HH62P LY2 AC 12V Coil 8-Pin DPDT Red LED Electromagnetic Relay” from amazon. It says 12v on it but it works fine in my setup.