Fibaro - Universal Binary Sensor - Does it work with Smart Things

Here is a photo I found on the Internet:

I don’t think it is available in the states yet.

1 Like

Has someone updated the device type for this to get battery status working properly and any other features this device offers from Fibaro?

This thread is about the binary sensor, not the door/window sensor.
AFAIK, currently there isn’t a device driver for the binary sensor.

I know but since it has an input on the window/openclose sensor I was thinking about using it for something temporary until Fibaro actually starts selling the UBS to it’s distributors.

1 Like

@codytruscott Hey man I saw in one of the thread you pointed out the Fibaro UBS and was wondering if you have a device type for this or have on in your setup? This is the thread where you pointed it out :smile:

can I link to this thread, 1st input is working but could do with some help getting the 2nd input to be seen by smartthings

Ooo. That’s my question.

Since then I’ve figured out how to get the device responding to both inputs. I’m not familiar with the methodology used and so may well be doing it all wrong…
I’ve got my device sending “switch1”, “switch2” plus “open”/“closed” which I can check in my ‘smartapp’.
I haven’t figured out how to make the simulator work (but then it doesn’t work on my computer at all anyway), nor have I figured out how to make it behave like two distinct switches (or even if it’s possible).

I’m still fiddling around, the muddy waters have cleared a little and things are a lot less hit and miss than they were but I think I’ve still got a long way to go before I have it figured out well enough to implement stuff properly.

Hi @SteveWard

Do you fancy sharing your code?

I’m not sure I’ve much worth sharing at the moment. I’ve just got back to it now and am messing around, the trouble is I don’t know how a lot of it works. Documentation seems very poor, there’s no deconstruction of any of the commands sent and so I’m having to experiment to try and figure out what it all does.

At the moment the only things I have that I know work are to send the following in configure:

zwave.associationV2.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()

This appears puts the device into a mode that sends ‘proper’ individual commands for each channel, then I can parse them with the following code which sends commands that I can read in a smart app (or a virtual device - I think, haven’t tried that yet).
Main thing I can’t figure out is whether I can send commands back to the driver from the smart app or how to set up configuration data that can be set by the driver (if it’s even possible).

def zwaveEvent(physicalgraph.zwave.commands.multichannelv3.MultiChannelCmdEncap cmd) {
    def result
    if (cmd.commandClass == 32) {
       if (cmd.parameter == [0]) {
          if (cmd.sourceEndPoint == 1) {
              result = createEvent(name: "switch1", value: "closed")
              log.debug "switch 1 closed"
         }
         else
         if (cmd.sourceEndPoint == 2) {
             result = createEvent(name: "switch2", value: "closed")
             log.debug "switch 2 closed"
         }
     }
    if (cmd.parameter == [255]) {
        if (cmd.sourceEndPoint == 1) {
            result = createEvent(name: "switch1", value: "open")
            log.debug "switch 1 open"
        }
        else
        if (cmd.sourceEndPoint == 2) {
            result = createEvent(name: "switch2", value: "open")
            log.debug "switch 2 open"
        }
    }
}
return result
}
1 Like

OK - figured out how to pass data back and forth between the driver and the smart app.
Progress is slow but it is progress… :wink:

FWIW, I figured out the virtual device stuff. So now I have a device driver for the UBS I can use which links to a smart app and operates two virtual switches. These can then be passed to any other smart app that needs a switch.
I can also set the switches to be either momentary (pass through) or toggle from the smart app.

Bad bits. I can’t seem to make the temperature bit work - don’t need it but it’d be nice for completeness and my driver has a lot of stuff missing compared to other drivers I’ve looked at.
This is almost certainly because I still have a lot to figure out - but then it does work so it can’t be missing anything important… Can it? Hmmm…

Hi @SteveWard

Looks like you are getting along very well. if you need any help testing it please let me know.

Hi @SteveWard

Would you share your device type code with all by any chance???

I am trying to integrate one of these sensors to detect a gate open/close positions and so far I can’t even get input 1 to work for some reason.

Thanks
Carlos

Ok,
I finally got both inputs working

Here’s the code for the device type for what is worth:

metadata {
definition (name: “FUS”, namespace: “Carlos”, author: “Carlos”) {
capability "Sensor"
command "report"
command "singleSet"
command "singleRemove"
command "multiSet"
command "multiRemove"
fingerprint deviceId: “0x2001”, inClusters: “0x30 0x60 0x85 0x8E 0x72 0x70 0x86 0x7A 0xEF 0x2B”
}

simulator {
// These show up in the IDE simulator “messages” drop-down to test
// sending event messages to your device handler
status “open” : "zw device: 02, command: 2001, payload: 00"
status “closed”: "zw device: 02, command: 2001, payload: FF"
status “basic report on”:
zwave.basicV1.basicReport(value:0xFF).incomingMessage()
status “basic report off”:
zwave.basicV1.basicReport(value:0).incomingMessage()
status “dimmer switch on at 70%”:
zwave.switchMultilevelV1.switchMultilevelReport(value:70).incomingMessage()
status “basic set on”:
zwave.basicV1.basicSet(value:0xFF).incomingMessage()
status “temperature report 70°F”:
zwave.sensorMultilevelV2.sensorMultilevelReport(scaledSensorValue: 70.0, precision: 1, sensorType: 1, scale: 1).incomingMessage()
status “low battery alert”:
zwave.batteryV1.batteryReport(batteryLevel:0xFF).incomingMessage()
status “multichannel sensor”:
zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1).encapsulate(zwave.sensorBinaryV1.sensorBinaryReport(sensorValue:0)).incomingMessage()
// simulate turn on
reply “2001FF,delay 5000,2002”: “command: 2503, payload: FF”

        // simulate turn off
        reply "200100,delay 5000,2002": "command: 2503, payload: 00"

}

tiles {
standardTile(“Switch1”, “device.Switch1”, width: 1, height: 1) {
state “open”, label: ‘${name}’, icon: “st.contact.contact.open”, backgroundColor: "#ffa81e"
state “closed”, label: ‘${name}’, icon: “st.contact.contact.closed”, backgroundColor: “#79b821
}
standardTile(“Switch2”, “device.Switch2”, width: 1, height: 1) {
state “open”, label: ‘${name}’, icon: “st.contact.contact.open”, backgroundColor: "#ffa81e"
state “closed”, label: ‘${name}’, icon: “st.contact.contact.closed”, backgroundColor: “#79b821
}

main(["Switch1","Switch2"])
details(["Switch1","Switch2"])

}
}

def parse(String description)
{
def result = null
def cmd = zwave.parse(description, [ 0x60: 3])
if (cmd) {
result = zwaveEvent(cmd)
}
log.debug "parsed ‘$description’ to result: ${result}"
result
}

def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv1.ManufacturerSpecificReport cmd) {
log.debug(“ManufacturerSpecificReport ${cmd.inspect()}”)
}

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
log.debug(“ConfigurationReport ${cmd.inspect()}”)
}

def report() {
// zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
//
delayBetween([
zwave.configurationV1.configurationGet(parameterNumber: 5).format(),
zwave.configurationV1.configurationGet(parameterNumber: 6).format()
])
}

def configTest() {
log.debug "configTest"
zwave.multiChannelAssociationV2.multiChannelAssociationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
//zwave.associationV2.associationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
zwave.associationV2.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()
}

def singleSet() {
def cmds = []

//cmds << zwave.associationV2.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format()
//cmds << zwave.associationV2.associationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
cmds << zwave.associationV2.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()

delayBetween(cmds, 500)
}

def singleRemove() {
def cmds = []

//cmds << zwave.associationV2.associationRemove(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format()
//cmds << zwave.associationV2.associationRemove(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
cmds << zwave.associationV2.associationRemove(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()

delayBetween(cmds, 500)
}

def multiSet() {
def cmds = []

//cmds << zwave.multiChannelAssociationV2.multiChannelAssociationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format()
//cmds << zwave.multiChannelAssociationV2.multiChannelAssociationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
cmds << zwave.multiChannelAssociationV2.multiChannelAssociationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()

delayBetween(cmds, 500)
}

def multiRemove() {
def cmds = []

//cmds << zwave.multiChannelAssociationV2.multiChannelAssociationRemove(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format()
//cmds << zwave.multiChannelAssociationV2.multiChannelAssociationRemove(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
cmds << zwave.multiChannelAssociationV2.multiChannelAssociationRemove(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()

delayBetween(cmds, 500)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd)
{
log.debug "BasicSet V1 ${cmd.inspect()}"
if (cmd.value) {
createEvent(name: “Switch1”, value: “open”, descriptionText: “$device.displayName is open”)
} else {
createEvent(name: “Switch1”, value: “closed”, descriptionText: “$device.displayName is closed”)
}
}

def zwaveEvent(physicalgraph.zwave.commands.multichannelv3.MultiChannelCmdEncap cmd) {
log.debug "ZWaveEvent V3 ${cmd.inspect()}"
def result
if (cmd.commandClass == 32) {
if (cmd.parameter == [0]) {
if (cmd.sourceEndPoint == 1) {
result = createEvent(name: “Switch1”, value: “closed”, descriptionText: “$device.displayName is closed”)
log.debug “Switch 1 closed”
}
else
if (cmd.sourceEndPoint == 2) {
result = createEvent(name: “Switch2”, value: “closed”, descriptionText: “$device.displayName is closed”)
log.debug “Switch 2 closed”
}
}
if (cmd.parameter == [255]) {
if (cmd.sourceEndPoint == 1) {
result = createEvent(name: “Switch1”, value: “open”, descriptionText: “$device.displayName is open”)
log.debug “Switch 1 open”
}
else
if (cmd.sourceEndPoint == 2) {
result = createEvent(name: “Switch2”, value: “open”, descriptionText: “$device.displayName is open”)
log.debug “Switch 2 open”
}
}
}
return result
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
// This will capture any commands not handled by other instances of zwaveEvent
// and is recommended for development so you can see every command the device sends
return createEvent(descriptionText: “${device.displayName}: ${cmd}”)
}

Hi Carlos, sorry for the tardy response I’ve only just got back to looking at this stuff…

Looks like you’re doing OK at any rate, all I have currently is what I published above which functionally isn’t much different to what you appear to have.

If I figure out anything else I’ll put it on this thread but it looks as though it’ll work for what I want it to do.
I haven’t managed to get the temperature function to work and I may need to be able to change the configuration but wont know until I come to use them in anger (they’ll fit between the PIR’s on my alarm and the panel itself so I can use the alarm PIR’s to trigger events in the system).

Cheers.

Thanks for sharing all the work guys.
I’ve just started trying to integrate the same Fibaro UBS but using the temperature sensors, to monitor the status of my hot water tank, much like in this post -


It’s a shame it’s not yet supported. If anyone has any updates on using this device with ST I’d love to hear. It works well for me using a RaZberry controller, so I may end up having to keep the UBS on the RaZberry only.

This is starting to look good, I can get input1 to change state but not input2. also is it possible to have both inputs show as contact sensor? or do we need an app and 2 virtual devices?

Thanks

Paul

You don’t need an app. I could get both to report open close, however I wired my sensors IN2 to a PIR as I want a contact and motion sensor. I have also wire in the temp sensor, but so far only the contact sensor works.

But I need to start looking into it again soon

Hi @Fuzzyligic

Which code did you use? and did you make any changes to it?

With @carlos.ir33 code I can only make input 1 work and they is nothing in the log file.

what I am working towards is both inputs working as independent contactSensors that can be used with Rule Machine

Thanks

Paul

i started with his code, but i want happy with the configuration functions as they did not work for me, so i got rid of them and created my own configure block to ensure the correct association group was set. let me clean up the code i am using and set it back to be for dual contact sensor inputs. i’ll post the link to the code here shortly