Garage Door Opener Device Type (Linear FS20Z-1 / Evolve LFM-20)

I spent the evening hacking my relay to work this evening and found that there wasn’t a suitable device type which would work as a momentary switch for my garage door.

Here’s what I came up with in the hour of tinkering (I’m having to ration the time I spend tweaking my SmartThings as of late hah). This is pretty much a straight ripoff of the “Z-Wave Relay” device type but it triggers the “On” for only 30 seconds which is about how long my garage takes to open or close, keeping it on isn’t entirely necessary but it prevents someone else from hitting the button to stop it while its moving.

metadata {

	definition (name: "Z-Wave Relay (momentary)", namespace: "LeBlaaanc", author: "Chris LeBlanc") {
		capability "Actuator"
		capability "Switch"
		capability "Polling"
		capability "Refresh"
		capability "Sensor"
		capability "Relay Switch"

		fingerprint deviceId: "0x1001", inClusters: "0x20,0x25,0x27,0x72,0x86,0x70,0x85"
		fingerprint deviceId: "0x1003", inClusters: "0x25,0x2B,0x2C,0x27,0x75,0x73,0x70,0x86,0x72"
	}

	// simulator metadata
	simulator {
		status "on":  "command: 2003, payload: FF"
		status "off": "command: 2003, payload: 00"

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

	// tile definitions
	tiles {
		standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
			state "off", label: 'Toggle', action: "switch.on", icon: "st.doors.garage.garage-closed", backgroundColor: "#ffffff"
			state "on", label: 'Moving', action: "switch.off", icon: "st.doors.garage.garage-closed", backgroundColor: "#79b821"
		}
		standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
		}

		main "switch"
		details(["switch","refresh"])
	}
}

def installed() {
	zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
}

def parse(String description) {
	def result = null
	def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
	if (cmd) {
		result = createEvent(zwaveEvent(cmd))
	}
	if (result?.name == 'hail' && hubFirmwareLessThan("000.011.00602")) {
		result = [result, response(zwave.basicV1.basicGet())]
		log.debug "Was hailed: requesting state update"
	} else {
		log.debug "Parse returned ${result?.descriptionText}"
	}
	return result
}

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

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	[name: "switch", value: cmd.value ? "on" : "off", type: "digital"]
}

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
	def value = "when off"
	if (cmd.configurationValue[0] == 1) {value = "when on"}
	if (cmd.configurationValue[0] == 2) {value = "never"}
	[name: "indicatorStatus", value: value, display: false]
}

def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
	[name: "hail", value: "hail", descriptionText: "Switch button was pressed", displayed: false]
}

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

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

def off() {
	delayBetween([
		delayBetween([
			zwave.basicV1.basicSet(value: 0xFF).format(),
			zwave.basicV1.basicSet(value: 0x00).format()
		], 1000),
		zwave.switchBinaryV1.switchBinaryGet().format()
	], 10000)
}

def poll() {
	log.debug "poll()"
	zwave.switchBinaryV1.switchBinaryGet().format()
}

def refresh() {
	zwave.switchBinaryV1.switchBinaryGet().format()
}

If there’s a better way to do this it’d be great to know. :slight_smile:

Also, it be great if I could incorporate my tilt sensor with this device. Is it possible to create devices that talk to one another or better yet that are almost combinations of sensors? (I’m thinking how this new “door” feature works, it’s extremely similar).

I updated the code and simplified it a bit because I realized was the code I was ripping off kept switching the device type to “Z-Wave Switch” after it figured out my relay wasn’t one of the two models it could verify.

I am having a problem now though that my “things” tiles don’t get updated after the now 10sec delay. How can I resolve this?

Thanks for posting this. Was the main problem with the existing Z-Wave Relay type just that it doesn’t recognize the Linear FS20Z-1 and changes it to back to Switch? Or did you find other differences in functionality with the Linear vs the Evolve?

I just noticed in the code for “Z-Wave Relay” tries to determine if it’s a “Z-Wave Relay” by the device name and “Linear FS20Z-1” isn’t included so it will switch the device type back to a “Z-Wave Switch”. Other than that it seemed to operate fine.

I do have an update on this though. Instead of writing your own device type you should use the “Z-Wave Virtual Momentary Contact Switch” to operate your relay. This device type does basically what my code does above (switch the relay on for about 2 seconds then switch it off). I did take that code though and “increase” the delay to what it takes for my garage door to open so I don’t accidentally stop it’s motion.

1 Like

I wanted to revive this post just to notify anyone who stumbles upon this thread.

You’ll find information about my current setup here which uses a Linear FS20Z-1 Relay set to Z-Wave Virtual Momentary Contact Switch and a Ecolink Tilt Sensor with a custom device type I wrote:

If you have a SmartSense Multi Sensor you can use the SmartSensor Garage Door Sensor Button device type which is already provided by SmartThings.

Could you explain the procedure for increasing the delay? My device stops garage door from opening at about 3 feet off the ground.

Hi, Chris. I have the Linear FS20Z-1. I don’t have a tilt sensor, so can’t use the code you and some others have developed to cobble those two things together. However, it’s not working for me consistently. I changed the device type to Z-Wave momentary virtual button, but that didn’t help. Looking at the device type code, I noticed as you did that the manufacturer wasn’t listed. Considering that product type and model codes were the same as the Evolve, I copied that line, modified the manufacturer to 014F (shown in the device info) and published as my own device type. Changed the device type to my custom one, and it opened the door, but then wouldn’t close it. Not only that, but I couldn’t close it with the physical doorbell button, making me think it wasn’t turning the device off. I had to press the button on the FS20Z to reset it (physical doorbell button worked), but smartthings switch does not. Do you have device type code that you had working with the FS20Z by itself (i.e., not with the tilt sensor)? Thanks.