Remotec zwave dry contact

Hi members,
I’m new to this world of Home Automation.
I just bought a Remotec zwave dry contact switch, i connect it, after allot of tries, i figured out how to switch it to momentary switch.

My gate door is very simple, only 2 wires, when they touch together, both gate doors will open, when you touch them together back they closes.

After I changed the switch to momentary switch, i started working perfectly, but only 1 gate door opens and close.
If both gates are close, when i press the switch, both opens, but after that, the left one stays open, and the right one close and opens perfectly.

I think it has something to do with the script, again if i remove the wires, put them together both gates works, but only with the switch, only 1 opens.
i think this needs to work like a bell switch, when you press it, it needs to open, and release, when you press it back it needs to contact and close the gate.

Here is my script i copied:
I don’t know if i’m missing something.
Many thanks, hope someone can help me out.

Ryan

/**

  • Copyright 2015 SmartThings

  • 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.

  • SmartSense Virtual Momentary Contact Switch

  • Author: SmartThings

  • Date: 2013-03-07
    */
    metadata {
    definition (name: “Z-Wave Virtual Momentary Contact Switch”, namespace: “smartthings”, author: “SmartThings”, ocfDeviceType: “x.com.st.d.sensor.contact”) {
    capability "Actuator"
    capability "Switch"
    capability "Refresh"
    capability "Momentary"
    capability "Sensor"
    capability “Relay Switch”
    }

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

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

    }

    // tile definitions
    tiles {
    standardTile(“switch”, “device.switch”, width: 2, height: 2, canChangeIcon: true) {
    state “off”, label: ‘${name}’, action: “momentary.push”, icon: “st.switches.switch.off”, backgroundColor: "#ffffff"
    state “on”, label: ‘${name}’, action: “switch.off”, icon: “st.switches.switch.on”, backgroundColor: “#00a0dc
    }
    standardTile(“refresh”, “device.switch”, inactiveLabel: false, decoration: “flat”) {
    state “default”, label:’’, action:“refresh.refresh”, icon:“st.secondary.refresh”
    }

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

    }
    }

def parse(String description) {
def result = null
def cmd = zwave.parse(description, [0x20: 1])
if (cmd) {
result = createEvent(zwaveEvent(cmd))
}
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.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
if (state.manufacturer != cmd.manufacturerName) {
updateDataValue(“manufacturer”, cmd.manufacturerName)
}

final relays = [
    [manufacturerId:0x0113, productTypeId: 0x5246, productId: 0x3133, productName: "Evolve LFM-20"],
	[manufacturerId:0x5254, productTypeId: 0x8000, productId: 0x0002, productName: "Remotec ZFM-80"]
]

def productName  = null
for (it in relays) {
	if (it.manufacturerId == cmd.manufacturerId && it.productTypeId == cmd.productTypeId && it.productId == cmd.productId) {
		productName = it.productName
		break
	}
}

if (productName) {
	log.debug "Relay found: $productName"
	updateDataValue("productName", productName)
}
[name: "manufacturer", value: cmd.manufacturerName]

}

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

def push() {
def cmds = [
zwave.basicV1.basicSet(value: 0xFF).format(),
zwave.switchBinaryV1.switchBinaryGet().format(),
“delay 3000”,
zwave.basicV1.basicSet(value: 0x00).format(),
zwave.switchBinaryV1.switchBinaryGet().format()
]
}

def on() {
push()
}

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

def refresh() {
delayBetween([
zwave.switchBinaryV1.switchBinaryGet().format(),
zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
])
}

Does the second gate need a fraction of a second longer connection than the working gate?
Maybe a small delay before off would help?
If you manually connect the wires really quickly can you replicate the problem of only one gate opening?

Many thanks Robin!
Can i copy the script of Max and paste it directly?
Or is there something i need to change in it?

Many thanks for your reply,
No, i didnt noticed that, i just connect the wires, just touch them together for less then 1 sec, both gates open.

I’ll give it a try now!

Robin,
Bad news, still doing the same, only 1 gate is working!
I’ts very strange because when i put those 2 wires together its working perfect.

I just try it, all the 4 options is doing the same.
Just to be sure,
Right now the wires are connected one to each side of the relay load?

YES! Now i know what it is doing, IF you hold the 2 wires more then 2 sec, one of the gate only close, if you touch them and disconnect back right away both will open and close.
Is there a option in the script that i can change so it will connect and disconnect right away?
if it stays longer than 2 or 3 seconds connect, the other gate will stop working!

Robin,
I figured out, that the switch holds it until you press it back,
I placed a lamp and it stays on until you press it back.

It needs to give contact, and release.

I think you can change the device type to:
Z-Wave Virtual Momentary Contact Switch

And then it should work.

This is how I setup a different relay to open and close my garage door.

Robin,

After allot of tries,… i got it to work.

I edit the script from Max, remove some lines and its working, both gates opens and closes perfect.
Now, the next problem is the button in the front of the switch…when i press it, it doesn’t work like in the smart things app. i tried to put it to Momentary NC & NO and also the Toggle options, does not seems to work, i think i’m missing something in the script.

This is what i used:

/* Remotec ZFM-80 specific device V1.3
*

  • Variation of the stock SmartThings Relay Switch
  • –auto re-configure after setting preferences
  • –preference settings for switch type and automatic shutoff features.
  • Mike Maxwell
  • madmax98087@yahoo.com
  • 2015-02-16
  • change log
    2015-02-16 added delay between configuration changes, helps with devices further away from the hub.
    2015-02-21 fixed null error on initial install
    2015-06-22 added momentary on function for garage door controller
    */

metadata {

definition (name: "remotecZFM80", namespace: "MikeMaxwell", author: "mike maxwell") {
	capability "Actuator"
	capability "Switch"
	capability "Polling"
	capability "Refresh"
	capability "Sensor"
	capability "Relay Switch"

	fingerprint deviceId: "0x1003", inClusters: "0x20, 0x25, 0x27, 0x72, 0x86, 0x70, 0x85"
}
preferences {
    input name: "param1", type: "enum", title: "Set external switch mode:", description: "Switch type", required: true, options:["Disabled","Momentary NO","Momentary NC","Toggle NO","Toggle NC"]
   	input name: "param2", type: "enum", title: "Auto shutoff minutes:", description: "Minutes?", required: false, options:["Never","1","5","30","60","90","120","240"]
    input name: "isGD", type: "bool",title: "Enable Momentary on (for garage door controller)", required: true
}

// 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 "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
		state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
	}
	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.hailv1.Hail cmd) {
[name: “hail”, value: “hail”, descriptionText: “Switch button was pressed”, displayed: false]
}

def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
if (state.manufacturer != cmd.manufacturerName) {
updateDataValue(“manufacturer”, cmd.manufacturerName)
}

final relays = [
	[manufacturerId:0x5254, productTypeId: 0x8000, productId: 0x0002, productName: "Remotec ZFM-80"]
]

def productName  = null
for (it in relays) {
	if (it.manufacturerId == cmd.manufacturerId && it.productTypeId == cmd.productTypeId && it.productId == cmd.productId) {
		productName = it.productName
		break
	}
}

if (productName) {
	//log.debug "Relay found: $productName"
	updateDataValue("productName", productName)
}
else {
	//log.debug "Not a relay, retyping to Z-Wave Switch"
	
}
[name: "manufacturer", value: cmd.manufacturerName]

}

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

def on() {
if (settings.isGD) {
//log.info "isGD: true"
delayBetween([zwave.basicV1.basicSet(value: 0xFF).format(),zwave.basicV1.basicSet(value: 0x00).format(),zwave.switchBinaryV1.switchBinaryGet().format()],500)
} else {
//log.info "isGD: false"
delayBetween([zwave.basicV1.basicSet(value: 0xFF).format(),zwave.switchBinaryV1.switchBinaryGet().format()])
}
}

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

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

def refresh() {
delayBetween([
zwave.switchBinaryV1.switchBinaryGet().format(),
zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
])
}
//capture preference changes
def updated() {
//log.debug “before settings: ${settings.inspect()}, state: ${state.inspect()}”
//“Disabled”,“Momentary NO”,“Momentary NC”,“Toggle NO”,“Toggle NC”

//external switch function settings
def Short p1 = 0
switch (settings.param1) {
	case "Disabled":
		p1 = 0
        break
	case "Momentary NO":
		p1 = 1
        break
	case "Momentary NC":
		p1 = 2
        break
	case "Toggle NO":
		p1 = 3
        break
	case "Toggle NC":
		p1 = 4
        break
}    


//auto off
def Short p2 = 0
if ("${settings.param2}" == "Never") {
	p2 = 0
} else {
	p2 = (settings.param2 ?: 0).toInteger()
}

if (p1 != state.param1)	{
    state.param1 = p1 
    return response(zwave.configurationV1.configurationSet(parameterNumber: 1, size: 1, configurationValue: [p1]).format())
}

if (p2 != state.param2)	{
    state.param2 = p2
    if (p2 == 0) {
   		return response (delayBetween([
			zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [0]).format(),
    		zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, configurationValue: [0]).format(),
    		zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, configurationValue: [0]).format()
		]))
    } else {
    	return response (delayBetween([
			zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [p2]).format(),
    		zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, configurationValue: [232]).format(),
    		zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, configurationValue: [0]).format()
		]))
    }
}

//log.debug "after settings: ${settings.inspect()}, state: ${state.inspect()}"

}

def configure() {
delayBetween([
zwave.configurationV1.configurationSet(parameterNumber: 1, size: 1, configurationValue: [3]).format(),
zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [0]).format(),
zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, configurationValue: [0]).format(),
zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, configurationValue: [0]).format()
])

If you are saying that you push the switch on the physical remotec relay and the state doesn’t behave like a toggle, then I think that is how the remotec works. When it is off and you push the button it goes on. When it is on, and you push the button it goes off.

Just curious, what amount of delay makes this work?

I think the default it 2 seconds.

Did you need less or more than 2 seconds?

Is this the ZFM-80US relay.

The manual does mention something about a failsafe mode in which there is a programmatic delay from 1 minute to 240 minutes, in which if no command is received the relay can automatically turn on or off.

Never used it. Has anyone else?

Dave, If i’m not mistake… It should not work like the app?
When you write down the script, this is not for the external button also?
Or the script is only for using with ST app?

If this is the case, i will need to add a separate button to open and close it inside the house.

What you need to do is wired the a momentary switch in parallel with the dry contact. The button on the remotec won’t work since the smallest time delay is one minute. Unless you could change it in the smartapp for the button parameter but with such small time delay. It’s not going to be reliable.

@Rcijntje
You never replied, what was the timing needed to make this work?

Was it to make the on/off quicker or slower?

Was it more or less than 2 seconds?

@anon36505037, he got it working with the apps but not the physical button infront of the z-wave relay. I did something similar before. Needed 3 presses within 2 secs and I ended up with an Aeotec micro but I think your suggestion with the fibaro should be able to do the same since they both have strobe parameter?

Hi professor,
I changed the 1000 to 500

I removed line 123 that change the momentary option each time back to zwave.

line 33 input name: “isGD”, type: “bool”,title: “Enable Momentary on (for garage door controller)”, required: true

line 116 (deleted so it doesn’t change the device type)
line 129 delayBetween([zwave.basicV1.basicSet(value: 0xFF).format(),zwave.basicV1.basicSet(value:0x00).format(),zwave.switchBinaryV1.switchBinaryGet().format()],500)

Alright I hate to hijack an old thread but may help others. I just installed the ZFM 80 for my fireplace, works great but i want a better device handler then a Universal relay one, the one @Mike_Maxwell made seems to be the one that works the best and is the one to go to, except every line i click on to get it, shows the page is no longer avaiable, does anyone have this device handler they would be willing to post up in full? id really love to use it…or if Mike sees this?