it works
With some other fibaro devices that I have 2 outputs, I used a custom device, then a smart app and 2 virtual switches to make it all work.
so far I have
your code for the device.
I have hacked the on/off tile to make it
/**
-
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.
-
On/Off Button Tile
-
Author: SmartThings
-
Date: 2013-05-01
*/
metadata {
definition (name: “On/Off Sensor Tile”, namespace: “smartthings”, author: “Paul Crookes”) {
capability "Contact Sensor"
capability "Switch"
capability “Sensor”
}// simulator metadata
simulator {
}// UI tile definitions
tiles {
standardTile(“contact”, “device.contact”, width: 2, height: 2) {
state “open”, label: ‘${name}’, icon: “st.contact.contact.open”, backgroundColor: "#ffa81e"
state “closed”, label: ‘${name}’, icon: “st.contact.contact.closed”, backgroundColor: “#79b821”
}main "contact" details "contact"
}
}
def parse(String description) {
}
def on() {
sendEvent(name: “switch”, value: “on”)
}
def off() {
sendEvent(name: “switch”, value: “off”)
}
and then the custom app
/**
- Dual Relay Adapter (i.e. Enerwave ZWN-RSM2 Adapter, Monoprice Dual Relay, Philio PAN04)
- Copyright 2014 Joel Tamkin
- 2015-10-29: erocm123 - I removed the scheduled refreshes for my Philio PAN04 as it supports instant
- status updates with my custom device type
- 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.
*/
definition(
name: “Fibaro Universal Sensor App”,
namespace: “”,
author: “Paul Crookes”,
description: “Associates Dual Relay Switch Modules with one or two standard SmartThings ‘switch’ devices for compatibility with standard control and automation techniques”,
category: “My Apps”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)
preferences {
section(“ZWN-RSM2 Module:”) {
input “rsm”, “capability.contactSensor”, title: “Which FUS Module?”, multiple: false, required: true
input “switch1”, “capability.contactSensor”, title: “First Switch?”, multiple: false, required: true
input “switch2”, “capability.contactSensor”, title: “Second Switch?”, multiple: false, required: false
}
}
def installed() {
log.debug “Installed!”
//subscribe(rsm, “switch”, rsmHandler)
subscribe(rsm, “switch1”, rsmHandler)
subscribe(rsm, “switch2”, rsmHandler)
subscribe(switch1, “switch”, switchHandler)
subscribe(switch2, “switch”, switchHandler)
initialize()
}
def updated() {
log.debug "Updated!"
unsubscribe()
subscribe(rsm, “switch”, rsmHandler)
subscribe(rsm, “switch1”, rsmHandler)
subscribe(rsm, “switch2”, rsmHandler)
subscribe(switch1, “switch”, switchHandler)
subscribe(switch2, “switch”, switchHandler)
initialize()
}
def switchHandler(evt) {
//log.debug "switchHandler: ${evt.value}, ${evt.deviceId}, ${evt.source}, ${switch2.id}"
switch (evt.deviceId) {
case switch1.id:
switch (evt.value) {
case ‘open’:
log.debug "switch1 open"
rsm.open1()
break
case ‘closed’:
log.debug "switch1 closed"
rsm.closed1()
break
}
break
case switch2.id:
switch (evt.value) {
case ‘open’:
log.debug "switch2 open"
rsm.open2()
break
case ‘closed’:
log.debug "switch2 closed"
rsm.closed2()
break
}
break
default:
pass
}
}
def rsmHandler(evt) {
log.debug "$evt.name $evt.value"
if (evt.name == “switch1”) {
switch (evt.value) {
case ‘open’:
Switch1.open()
break
case ‘closed’:
switch1.closed()
break
}
}
else if (evt.name == “switch2”) {
switch (evt.value) {
case ‘open’:
switch2.open()
break
case ‘closed’:
switch2.closed()
break
}
}
}
def rsmRefresh() {
rsm.refresh()
}
def initialize() {
unschedule()
//def exp = “* * * * * ?”
//log.debug “Scheduling RSM refreshes”
//schedule(exp, rsmRefresh)
// TODO: subscribe to attributes, devices, locations, etc.
}
just need to make it all work…
Paul