Fibaro Drivers that not working Whats happening?

I couldn't agree more.

Thanks this is the first I have heard of this and now I know. I was left thinking that it was exclusively to do with the 2.2.3 zwave update that caused the problem.

Couldn't agree more.

1 Like

Bad news regarding the Fibaro UBS (FGBS-001), this device will not work with a C7 hub.
The device was not compliant with spec when certified and won't be supported on 700 series hubs, this isn't a Hubitat issue, this was a decision that silicon labs made to not further support legacy devices that aren't compliant with spec.

I imagine it could be resolved by Fibaro via a firmware update, but that's not something that we can drive.

There is no changing silabs stance on this, one could only pester fibaro directly in the hope they would update the firmware on this device, but there's likely little incentive for them to do so.

There are no issues with the Implant device which seems to be the replacement for the UBS.

And there we have it. Thanks for letting us know.

1 Like

Oh no that's bad news since I have a lot of them..But nothing to do about it. I hope the Shelly Uni will be a competitor since its low price (but with that comes other stuff). I have tested a Fibaro Smart implant and it works great with the C7 but they cost 4 times more than a Shelly UNI. Thanx for investigating this in to the bone.
/Mattias

No chance of this it's too old, I had asked awhile ago, I don't believe it even has a bootloader. So it would be a manual pic even if they changed stance.

1 Like

Out of curiosity, why would the UBS device not work on the C7 hub?

I just bought a Fibaro Implant on the basis my UBS devices won't work, and have set that up successfully. However after doing the transfer I moved the UBS over aswell, and can see the variou payloads arriving in Live logging? Am I missing something but it seems a payload of 0A FF and 0B FF correspond to open/closed on contact 1, while 14 FF and 15 FF correspond to open/closed on contact 2.....

Thanks!

Not sure because i have mine working, I just had to use the scene events rather than the normal contact events. maybe something has changed if your seeing those events? @bcopeland?

Are the payloads I mention what you would expect as a scene event? Or is this something different? (I dont use scenes at all, and have never configured them, but I guess they may be enabled by default)

Probably shouldnt have bothered buying the Implant if I can get this working.....

I'll enable debug and get back too you on that.

I know one of the other thing I had to do was for the temperature probs they don't sent updates on the C7 so to get that to work you have too pole a refresh.

So I added a runin option to poll that every random 5 mins.

implant is going to work better no mater what, its just I still have a few new UBSs to install ! I don't want to waste them :rage:

@cjcharles / @BorrisTheCat

Both of you guys have helped me out in the past, either with advise or by tweaking software or drivers.

I have a few unused ubs's and an implant. Any good to you? I believe we're all UK based so postage should be fine.

2 Likes

That's a kind offer, thank you. I think you should keep them for future projects and playing! I'll see where I get to with my UBS if I can find the time and maybe your UBS sensors will have another life! (After I've done some more fixes for various Fibaro devices - where does my time go?!?! :roll_eyes::roll_eyes::roll_eyes:) Otherwise maybe swapping to Implants may be needed!

1 Like

@BorrisTheCat
@cjcharles

The offer was serious. These things are just sitting there. I have absolutely no intention of using them.

If they're any good to either of you, you can have them. Pay for postage, they're yours. They'll sit in a drawer until I eventually sling them.

Bear it in mind and let me know. =)

3 Likes

I blew one of mine up and sent the other to HE. So if there not going to be used I will make use of them if the offer is still there :slightly_smiling_face: thank you.

1 Like

Certainly is. Pm me your address and let me know how you'd like it posted (which service etc). I'll send it and just sort the postage via bank xfer if that suits.

One ubs, yup? =)

1 Like

Just ran into this issue myself. The UBS built-in Hubitat driver does not report changes of state. Tweaking zwave Param 14 to scene mode means I can see the changes ARE reported, so yeah, just needs a handler added to the driver for that it seems. I tried myself but groovy is like undocumented Martian to me. I also notice that associations for group 1 and 2 are not set. Switching to a driver from cjcharles, I can't get associations to add via groovy commands, not sure why.

Last post was back in December on this. Don't give up coders, us newbies rely on your expertise :sunglasses:

Has anyone solved this yet? Do I really need to bin yet more z-wave poorly designed crap? Just rooted out Devolo MT:2655 devices (x8 @ ~Β£50) that have caused no end of trouble on my Smartthings hub and now Hubitat. Really not enjoying the idea of using ANY WiShite devices. Who can we use on the certification side of things, utter tossers the lot of them :scream:

Ok, I got bored of this thing not working so here's a version (dare I say bodge?) that seems to work well enough...

/*
  *  Device Type Definition File
  *
  *  Device Type:		Fibaro UBS - Dual Contact and Temperature Sensor
  *  File Name:			Fibaro UBS - Dual Contact and Temperature Sensor.groovy
  *	Initial Release:	2017-11-07
  *	Author:				Chris Charles modified by Borristhecat for hubitat and bit more mods by Dean Turner
  *	5/4/2019  rebuilt all logging from Hubitat repo, altered temperature creation and fixed typo bugs by Borristhecat
  *	7/4/2019 dzerovibe fixed V3 Zwave command parameters Thanks
  * 7/4/2019 cleared up some logging and added default state to install method. Borristhecat
  * 28/11/2019 added new parse for next firmware . Borristhecat
  * 24/01/2020 happygreen frog: Bodged to use scene reporting as workaround for Silicon Labs decision to deprecate broken Fibaro firmware (who certifies this shite!!!)
  *
  *  Copyright 2017 Chris Charles, based on original code by carlos.ir33, modified
  *  by Stuart Buchanan and Paul Crookes. Testing thanks to borristhecat.
  *
  ***************************************************************************************
  */
  
 metadata {
 	definition (name: "Fibaro UBS", namespace: "cjcharles0", author: "Chris Charles", importUrl: "https://raw.githubusercontent.com/borristhecat/HUBITAT/master/Fibaro%20UBS.groovy") {
     
    capability "Contact Sensor"
  	capability "Motion Sensor"
    capability "Sensor"
 	capability "Temperature Measurement"
    capability "Configuration"
 	//capability "Polling"
 	capability "Refresh"
     
    command "removeChildDevices"
    command "createChildDevices"
    command "createChildTempDevices"
	//command "updateCurrentParams"
	command "listCurrentParams"
    command "open1"
    command "open2"
    command "close1"
    command "close2"
     
     attribute "contact1","enum",["open1","close1"]
     attribute "contact2","enum",["open2","close2"]
	 attribute "TP1","decimal"
	 attribute "TP2","decimal"
	 attribute "TP3","decimal"
	 attribute "TP4","decimal" 
 	
		fingerprint deviceId: "1002", inClusters: "0x30,0x60,0x85,0x8E,0x72,0x70,0x86,0x7A", outClusters: "0x2B", mfr: "010F", deviceJoinName: "Fibaro UBS"
       	
 	//fingerprint type: "1281", cc: "30 60 85 8E 72 70 86 7A", ccOut: "2B"
 }
 
 //main(["temperature1"]) //, "contact1"
// details(["contact1","contact2",
 //		"temp1text", "TP1", "temp2text", "TP2",
 //        "temp3text", "TP3", "temp4text", "TP4",
 //        "configure", "report", "createchildren", "createtempchildren", "removechildren"])
 
 preferences {
        //standard logging options
        input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
        input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true
		input name: "settingEnable", type: "bool", title: "Enable setting", defaultValue: false
	 	input name: "IP1Type", type: "enum", title: "Input 1 Type",
                    options: ["Contact", "Motion"], defaultValue: "Contact", displayDuringSetup: false
		input name: "IP2Type", type: "enum", title: "Input 2 Type",
                    options: ["Contact", "Motion"], defaultValue: "Contact", displayDuringSetup: false
	 	input name: "Temps", type: "number", range: "0..4", required: true, defaultValue: "0",
            title: "Temperature probes number. \n" +
                   "Default value: 0."
		// input name: "Info", type: "paragraph", title:"Device Handler by @cjcharles", description: "Parameter Settings:", displayDuringSetup: false

    	   
       if (settingEnable) input name: "param1", type: "number", range: "0..65535", required: true, defaultValue: "0",
            title: "Parameter No. 1 - Input 1 Alarm Cancellation Delay. \n" +
                   "Additional delay after an alarm from input 1 has ceased.\n" +
                   "Time in seconds to delay the ceasing event.\n" +
                   "Default value: 0."
       
       if (settingEnable) input name: "param2", type: "number", range: "0..65535", required: true, defaultValue: "0",
            title: "Parameter No. 2 - Input 2 Alarm Cancellation Delay. \n" +
                   "Additional delay after an alarm from input 2 has ceased.\n" +
                   "Time in seconds to delay the ceasing event.\n" +
                   "Default value: 0."
       
       if (settingEnable) input name: "param3", type: "number", range: "0..3", required: true, defaultValue: "1",
            title: "Parameter No. 3 - Type of Input No 1." +
                   "Available settings:\n" +
                   "0 – INPUT_NO (Normal Open)\n" +
				   "1 – INPUT_NC (Normal Close)\n" +
				   "2 – INPUT_MONOSTABLE\n" +
				   "3 – INPUT_BISTABLE\n" +
                   "Default value: 1."

	if (settingEnable) input name: "param4", type: "number", range: "0..3", required: true, defaultValue: "1",
            title: "Parameter No. 4 - Type of Input No 2." +
                   "Available settings:\n" +
                   "0 – INPUT_NO (Normal Open)\n" +
				   "1 – INPUT_NC (Normal Close)\n" +
				   "2 – INPUT_MONOSTABLE\n" +
				   "3 – INPUT_BISTABLE\n" +
                   "Default value: 1."

	if (settingEnable) input name: "param5", type: "number", range: "0..255", required: true, defaultValue: "255",
            title: "Parameter No. 5 - Type of transmitted control or alarm frame for association group 1." +
                   "Available settings:\n" +
				   "0 – Frame ALARM GENERIC\n" +
				   "1 – Frame ALARM SMOKE\n" +
				   "2 – Frame ALARM CO\n" +
				   "3 – Frame ALARM CO2\n" +
				   "4 – Frame ALARM HEAT\n" +
				   "5 – Frame ALARM WATER\n" +
				   "255 – Control frame BASIC_SET\n" +
                   "Default value: 255."

	if (settingEnable) input name: "param6", type: "number", range: "0..255", required: true, defaultValue: "255",
            title: "Parameter No. 6 - Type of transmitted control or alarm frame for association group 2." +
                   "Available settings:\n" +
				   "0 – Frame ALARM GENERIC\n" +
				   "1 – Frame ALARM SMOKE\n" +
				   "2 – Frame ALARM CO\n" +
				   "3 – Frame ALARM CO2\n" +
				   "4 – Frame ALARM HEAT\n" +
				   "5 – Frame ALARM WATER\n" +
				   "255 – Control frame BASIC_SET\n" +
                   "Default value: 255."

	if (settingEnable) input name: "param7", type: "number", range: "0..255", required: true, defaultValue: "255",
            title: "Parameter No. 7 - Value of the parameter specifying the forced level of dimming / opening sun blinds when " +
            	   "sent a β€œswitch on” / ”open” command from association group no. 1.\n" +
                   "Available settings:\n" +
                   "0-99 - Dimming or Opening Percentage\n" +
                   "255 - Last set percentage\n" +
                   "Default value: 255."

	if (settingEnable) input name: "param8", type: "number", range: "0..255", required: true, defaultValue: "255",
            title: "Parameter No. 8 - Value of the parameter specifying the forced level of dimming / opening sun blinds when " +
            	   "sent a β€œswitch on” / ”open” command from association group no. 2.\n" +
                   "Available settings:\n" +
                   "0-99 - Dimming or Opening Percentage\n" +
                   "255 - Last set percentage\n" +
                   "Default value: 255."

	if (settingEnable) input name: "param9", type: "number", range: "0..3", required: true, defaultValue: "0",
            title: "Parameter No. 9 - Deactivating transmission of the frame cancelling the alarm or the " +
				   "control frame deactivating the device (Basic). Disable the alarm cancellation function.\n" +
                   "Available settings:\n" +
                   "0 – Cancellation sent for association group 1 and 2\n" +
				   "1 – Cancellation sent for association group 1 only\n" +
				   "2 – Cancellation sent for association group 2 only\n" +
				   "3 - Not sent for association group 1 or 2\n" +
                   "Default value: 0."

	if (settingEnable) input name: "param10", type: "number", range: "1..255", required: true, defaultValue: "20",
            title: "Parameter No. 10 - Interval between successive readings of temperature from all " +
				   "sensors connected to the device. (A reading does not result in sending to HE)\n" +
                   "Available settings:\n" +
                   "1-255 - Seconds between readings\n" +
                   "Default value: 20."

	if (settingEnable) input name: "param11", type: "number", range: "0..255", required: true, defaultValue: "200",
            title: "Parameter No. 11 - Interval between forcing to send report of the temperature. " +
				   "The forced report is sent immediately after the next temperature reading, " +
				   "irrespective of parameter 12. Advised to be 200 unless rapid temperature changes are expected.\n" +
                   "Available settings:\n" +
                   "0 - Deactivate temperature sending\n" +
                   "1-255 - Seconds between sends\n" +
                   "Default value: 200."

	if (settingEnable) input name: "param12", type: "number", range: "0..255", required: true, defaultValue: "8",
            title: "Parameter No. 12 - Insensitiveness to temperature changes. This is the maximum " +
				   "difference between the last reported temperature and the current temperature. " +
				   "If they differ by more than this then a report is sent.\n" +
                   "Available settings:\n" +
                   "0-255 - x/16 = temp diff in C\n" +
                   "x/80*9 = temp diff in F\n" +
                   "Default value: 8 (0.5oC)."

	if (settingEnable) input name: "param13", type: "number", range: "0..3", required: true, defaultValue: "0",
            title: "Parameter No. 13 - Transmitting the alarm or control frame in β€œbroadcast” mode (i.e. to " +
				   "all devices within range), this information is not repeated by the mesh network." +
                   "Available settings:\n" +
                   "0 - IN1 and IN2 broadcast inactive,\n" +
                   "1 - IN1 broadcast mode active only,\n" +
                   "2 - IN2 broadcast mode active only,\n" +
                   "3 - INI and IN2 broadcast mode active.\n" +
                   "Default value: 0."

	//if (settingEnable) input name: "param14", type: "number", range: "0..1", required: true, defaultValue: "1",
    //        title: "Parameter No. 14 - Scene activation functionality." +
    //               "Available settings:\n" +
    //               "0 - Deactivated functionality,\n" +
    //               "1 - Activated functionality.\n" +
    //               "Default value: 0."
 	} 
 }

def installed() {
 	if (txtEnable) log.info "installed()"
	state.ContactUsed = true
	state.MotionUsed = false
 }

def uninstalled() {
    if (txtEnable) log.info "uninstalled()"
     removeChildDevices()
 }
def configure() {
	log.warn "configure()"
    updateCurrentParams()
}
def logsOff(){
    log.warn "debug logging disabled..."
    device.updateSetting("logEnable",[value:"false",type:"bool"])
}
def SettingsOff(){
    log.warn "Settings disabled..."
    device.updateSetting("settingEnable",[value:"false",type:"bool"])
}

def refresh() {
	log.info "refresh"
	def cmds = []
	 switch(Temps){
		case 0:
		
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1, commandClass:32, command:2).format()
 		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:2, destinationEndPoint:2, commandClass:32, command:2).format()
		return delayBetween(cmds, 1500)
		 break;
		 
		case 1:
		 
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:2, destinationEndPoint:2, commandClass:32, command:2).format()
 		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:3, destinationEndPoint:3, commandClass:49, command:5).format()
		return delayBetween(cmds, 1500)
		 break;
		 
		case 2:
		 
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:2, destinationEndPoint:2, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:3, destinationEndPoint:3, commandClass:49, command:5).format()
 		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:4, destinationEndPoint:4, commandClass:49, command:5).format()
		return delayBetween(cmds, 1500)
		 break;
		 
		case 3:
		 
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:2, destinationEndPoint:2, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:3, destinationEndPoint:3, commandClass:49, command:5).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:4, destinationEndPoint:4, commandClass:49, command:5).format()
 		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:5, destinationEndPoint:5, commandClass:49, command:5).format()
		return delayBetween(cmds, 1500)
		 break;
		 
		case 4:
		
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:1, destinationEndPoint:1, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:2, destinationEndPoint:2, commandClass:32, command:2).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:3, destinationEndPoint:3, commandClass:49, command:5).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:4, destinationEndPoint:4, commandClass:49, command:5).format()
		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:5, destinationEndPoint:5, commandClass:49, command:5).format()
 		cmds << zwave.multiChannelV3.multiChannelCmdEncap(sourceEndPoint:6, destinationEndPoint:6, commandClass:49, command:5).format()
		return delayBetween(cmds, 1500)
		 break;
		 
	 }
 }
 
 def createChildDevices(){
 	log.info "Adding Child Devices if not already added"
     //for (i in 1..2) {
	 for (i in 1) {
     	try {
         	if (txtEnable) log.info "Trying to create child switch if it doesn't already exist ${i}"
             def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP${i}"}
             if (currentchild == null) {
             if (txtEnable) log.info "Creating child for IP${i}"
             if (IP1Type == "Contact") addChildDevice("hubitat", "Virtual Contact Sensor", "${device.deviceNetworkId}-IP${i}", [name: "${device.displayName} (Contact${i})", isComponent: true])
 			 if (IP1Type == "Motion") addChildDevice("hubitat", "Virtual Motion Sensor", "${device.deviceNetworkId}-IP${i}", [name: "${device.displayName} (Contact${i})", isComponent: true])
 			
             }
         } catch (e) {
         if (txtEnable) log.debug "Error adding child ${i}: ${e}"
         }
		 
     }
	 for (i in 2) {
     	try {
         	if (txtEnable) log.info "Trying to create child switch if it doesn't already exist ${i}"
             def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP${i}"}
             if (currentchild == null) {
             if (txtEnable) log.info "Creating child for IP${i}"
             if (IP2Type == "Contact") addChildDevice("hubitat", "Virtual Contact Sensor", "${device.deviceNetworkId}-IP${i}", [name: "${device.displayName} (Contact${i})", isComponent: true])
 			 if (IP2Type == "Motion") addChildDevice("hubitat", "Virtual Motion Sensor", "${device.deviceNetworkId}-IP${i}", [name: "${device.displayName} (Contact${i})", isComponent: true])
             
			 }
         } catch (e) {
         if (txtEnable) log.debug "Error adding child ${i}: ${e}"
         }
		 
     }
 }
 def createChildTempDevices() {
   	 switch(Temps){
		case 1:
		 	 for (i in 1) {
		if (txtEnable) log.info "Creating 1 Temperature child" 
                    def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-TP${i}"}
              		if (currentchild == null) {
                    addChildDevice("hubitat", "Virtual Temperature Sensor", "${device.deviceNetworkId}-TP${i}", [name: "${device.displayName} (Temp${i})", isComponent: true])
					}
		}
		break
		case 2:
		 	for (i in 1..2) {
		if (txtEnable) log.info "Creating 2 Temperature child's" 
                    def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-TP${i}"}
              		if (currentchild == null) {
                    addChildDevice("hubitat", "Virtual Temperature Sensor", "${device.deviceNetworkId}-TP${i}", [name: "${device.displayName} (Temp${i})", isComponent: true])
				}
				}
		 break
		 case 3:
		 	for (i in 1..3) {
		if (txtEnable) log.info "Creating 3 Temperature child's" 
                    def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-TP${i}"}
              		if (currentchild == null) {
                    addChildDevice("hubitat", "Virtual Temperature Sensor", "${device.deviceNetworkId}-TP${i}", [name: "${device.displayName} (Temp${i})", isComponent: true])
				}
				}
		 break
		 case 4:
		 	for (i in 1..4) {
		if (txtEnable) log.info "Creating 4 Temperature child's" 
                    def currentchild = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-TP${i}"}
              		if (currentchild == null) {
                    addChildDevice("hubitat", "Virtual Temperature Sensor", "${device.deviceNetworkId}-TP${i}", [name: "${device.displayName} (Temp${i})", isComponent: true])
				}
				}
		 break
		 case 0:
		 	
		 if (txtEnable) log.info "Not creating any Temperature children as value is set to 0" 
           
		 break
	 }  	
 }
 private removeChildDevices() {
 	log.info "Removing Child Devices, if any installed"
     try {
         getChildDevices()?.each {
         	try {
             	deleteChildDevice(it.deviceNetworkId)
             } catch (e) {
          log.debug "Error deleting ${it.deviceNetworkId}, probably locked in a App: ${e}"
             }
         }
     } catch (err) {
       log.debug "Either no children exist or error finding child devices for some reason: ${err}"
     }
 }
/*def parse(String description) {
	def result = null
	def cmd = zwave.parse(description, [ 0x60: 3])
	if (cmd) {
		result = zwaveEvent(cmd)
	}
	if (logEnable) log.debug "parsed '$description' to result: ${result}"
	return result
} */
def parse(String description) {
    if (logEnable) log.trace "description:${description}"
    if (logEnable) log.debug "parse description: ${description}"
    def cmd = zwave.parse(description,[ 0x20:1, 0x26: 1])
    if (cmd) {zwaveEvent(cmd)}
    return
}

 def zwaveEvent(hubitat.zwave.commands.manufacturerspecificv1.ManufacturerSpecificReport cmd) {
  if (txtEnable) log.info("ManufacturerSpecificReport ${cmd.inspect()}")
 }
 
 def zwaveEvent(hubitat.zwave.commands.configurationv1.ConfigurationReport cmd) {
 	if (txtEnable) log.info("ConfigurationReport ${cmd.inspect()}")
 }
 
 def createEvent(hubitat.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd, Map item1) { 
 if (txtEnable)	log.info "manufacturerId:   ${cmd.manufacturerId}"
 if (txtEnable) log.info "manufacturerName: ${cmd.manufacturerName}"
 if (txtEnable) log.info "productId:        ${cmd.productId}"
 if (txtEnable) log.info "productTypeId:    ${cmd.productTypeId}"
 
 }
 
 def createEvent(hubitat.zwave.commands.versionv1.VersionReport cmd, Map item1) {	
     updateDataValue("applicationVersion", "${cmd.applicationVersion}")
if (txtEnable)	log.info "applicationVersion:      ${cmd.applicationVersion}"
if (txtEnable)	log.info "applicationSubVersion:   ${cmd.applicationSubVersion}"
if (txtEnable)	log.info "zWaveLibraryType:        ${cmd.zWaveLibraryType}"
if (txtEnable)	log.info "zWaveProtocolVersion:    ${cmd.zWaveProtocolVersion}"
if (txtEnable)	log.info "zWaveProtocolSubVersion: ${cmd.zWaveProtocolSubVersion}"
 }

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {
if (logEnable) log.debug "BasicSet V1 ${cmd.inspect()}"
		if (state.ContactUsed) def currentstate
		if (state.MotionUsed) def motionstate
	if (cmd.value) {
		if (state.ContactUsed) currentstate = "open"
        if (state.MotionUsed) motionstate = "inactive"
 	} else {
		if (state.ContactUsed) currentstate = "closed"
     	if (state.MotionUsed) motionstate = "active"
 	}
     	if (state.ContactUsed) createEvent(name: "contact${cmd.sourceEndPoint}", value: currentstate, descriptionText: "${device.displayName} is ${currentstate}", type: "physical")
		if (state.MotionUsed) createEvent(name: "contact${cmd.sourceEndPoint}", value: motionstate, descriptionText: "${device.displayName} is ${motionstate}", type: "physical")

	try {
        def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP${cmd.sourceEndPoint}"}
        if (childDevice)
         if (state.MotionUsed) childDevice.sendEvent(name: "motion", value: motionstate, descriptionText: "IP${cmd.sourceEndPoint} is ${motionstate}", type: "physical")
        if (state.ContactUsed) childDevice.sendEvent(name: "contact", value: currentstate, descriptionText: "IP${cmd.sourceEndPoint} is ${currentstate}", type: "physical")

		if (txtEnable) log.info "Fibaro is ${motionstate} and ${currentstate}"
     } catch (e) {
         log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
     }
 }
 
 def zwaveEvent(hubitat.zwave.commands.multichannelv4.MultiChannelCmdEncap cmd) {
  if (logEnable) log.debug "ZWaveEvent V4 ${cmd.inspect()}"
 	def result
 	if (cmd.commandClass == 32) {
       if (state.ContactUsed) def currentstate
       if (state.MotionUsed) def motionstate
 		if (cmd.parameter[0] == 0) {
 		if (state.ContactUsed) currentstate = "closed"
        if (state.MotionUsed) motionstate = "active"

		}
 		if (cmd.parameter[0] == 255) {
 		if (state.ContactUsed) currentstate = "open"
        if (state.MotionUsed) motionstate = "inactive"

		}
    	if (txtEnable) log.info "IP${cmd.sourceEndPoint} is ${currentstate}"
         //First update tile on this device
 		if (state.ContactUsed) sendEvent(name: "contact${cmd.sourceEndPoint}", value: currentstate, descriptionText: "$device.displayName - IP${cmd.sourceEndPoint} is ${currentstate}", type: "physical")
		if (state.MotionUsed) sendEvent(name: "contact${cmd.sourceEndPoint}", value: motionstate, descriptionText: "$device.displayName - IP${cmd.sourceEndPoint} is ${motionstate}", type: "physical")

		//If not null then we have found either IP1 or IP2, hence try to send to the child device aswell
         try {
             def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP${cmd.sourceEndPoint}"}
             if (childDevice)
         if (state.MotionUsed) childDevice.sendEvent(name: "motion", value: motionstate, descriptionText: "IP${cmd.sourceEndPoint} is ${motionstate}", type: "physical")
         if (state.ContactUsed) childDevice.sendEvent(name: "contact", value: currentstate, descriptionText: "IP${cmd.sourceEndPoint} is ${currentstate}", type: "physical")

		 } catch (e) {
             log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
         }
     }
 	else if (cmd.commandClass == 49) {
 		if ((cmd.sourceEndPoint >= 3) && (cmd.sourceEndPoint <= 6)) { 
 			def tempsensorid = cmd.sourceEndPoint - 2
 			def tempendpoint = "TP" + tempsensorid.toString()
             def tempval = ((cmd.parameter[4] * 256) + cmd.parameter[5])
             if (tempval > 32767) {
             	//Here we deal with negative values
             	tempval = tempval - 65536
             }
             //Finally round the temperature
             
             def tempprocessed = (tempval / 100).toDouble().round(1)
             
             def units = getTemperatureScale()
 			//def cmdScale = cmd.scale == 1 ? "F" : "C"
 			//def tempval = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision).toDouble().round(1)
             
      if (txtEnable) log.info "${tempendpoint} has changed to ${tempprocessed}${units}"
             
             sendEvent(name: tempendpoint, value: tempprocessed, descriptionText: "$device.displayName - ${tempendpoint} is ${tempprocessed}", displayed: true, unit: units, type: "physical")
             
 			//If not null then we have found either contact1 or contact2, hence try to send to the child
             try {
                 def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-${tempendpoint}"}
                 if (childDevice)
                 	//We found a child device that matches so send it the new temperature
                     childDevice.sendEvent(name: "temperature", value: tempprocessed, descriptionText: "$device.displayName - ${tempendpoint} is ${tempprocessed}", unit: units, type: "physical")
             } catch (e) {
             	//Not an error message here as people may not want child temperature devices
          log.debug "Couldn't find child ${tempendpoint} device, probably hasn't been created yet? Please click create child Temp devices. Error: ${e}"
             }
         }
 	}
 	else {
 		//Send them here just in case we want to do more complicated processing (not doing it as need to have endpoint passed and that makes it a bit messy)
 		def encapsulatedCommand = cmd.encapsulatedCommand([0x31: 2, 0x60: 3, 0x85: 2, 0x8E: 2, 0x72: 1, 0x70: 1, 0x86: 1, 0x7A: 1, 0xEF: 1, 0x2B: 1]) // can specify command class versions here like in zwave.parse
 	if (logEnable) log.debug ("Command from endpoint ${cmd.sourceEndPoint}: ${encapsulatedCommand}")
 		if (encapsulatedCommand) {
 			result = zwaveEvent(encapsulatedCommand)
 		}
 	}
     return result
 }
 
 def zwaveEvent(hubitat.zwave.commands.sensormultilevelv2.SensorMultilevelReport cmd)
 {
 	//This is no longer used as caught in an earlier event, but kept here in case the code is useful
 if (logEnable) log.debug "Sensor MultiLevel Report - Sensor Type = ${cmd.sensorType}"
 	switch (cmd.sensorType) {
 		case 1:
 			// temperature
 			def cmdScale = cmd.scale == 1 ? "F" : "C"
 			def tempval = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision).toDouble().round(1)
             sendEvent(name: "TP${cmd.sourceEndPoint}", value: tempprocessed, displayed: true, unit: units, type: "physical")
 			break;
 	}
  if (logEnable) log.debug map
 	createEvent(map)
 }
 
 def zwaveEvent(hubitat.zwave.commands.sensormultilevelv1.SensorMultilevelReport cmd) {
   if (logEnable) log.debug "SensorMultilevelReport $cmd"
 }
 
//Added by JG
def zwaveEvent(hubitat.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
    log.debug(cmd)
    log.debug "sceneId: ${cmd.sceneId}"
    //log.debug "dimmingDuration: ${cmd.dimmingDuration}"
    
    def contactname = "contact2"
    def childid = "2"
    if (state.ContactUsed) def currentstate
    if (state.MotionUsed) def motionstate
    switch (cmd.sceneId) {
        case 10: // IP1 de-asserted
            contactname = "contact1"
            childid = "1"
        case 20: // IP2 de-asserted
            if (state.ContactUsed) currentstate = "open"
            if (state.MotionUsed) motionstate = "inactive"
        break
        case 11: // IP1 asserted
            contactname = "contact1"
            childid = "1"
        case 21: // IP2 asserted
            if (state.ContactUsed) currentstate = "closed"
            if (state.MotionUsed) motionstate = "active"
        break
        default:
            logging("Unhandled SceneActivationSet: ${cmd}")
            return
        break
    }
    
    if (txtEnable) log.info "IP${childid} is ${currentstate}"
    //First update tile on this device
    if (state.ContactUsed) sendEvent(name: contactname, value: currentstate, descriptionText: "$device.displayName - contactname is ${currentstate}", type: "physical")
    if (state.MotionUsed) sendEvent(name: contactname, value: motionstate, descriptionText: "$device.displayName - contactname is ${motionstate}", type: "physical")
      
    
    //If not null then we have found either IP1 or IP2, hence try to send to the child device aswell
    try {
        def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP${childid}"}
        if (childDevice)
        if (state.MotionUsed) childDevice.sendEvent(name: "motion", value: motionstate, descriptionText: "IP${childid} is ${motionstate}", type: "physical")
        if (state.ContactUsed) childDevice.sendEvent(name: "contact", value: currentstate, descriptionText: "IP${childid} is ${currentstate}", type: "physical")
    } catch (e) {
        log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
    }
}


 def zwaveEvent(hubitat.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
 if (txtEnable)	log.info "Catchall reached for cmd: ${cmd.toString()}}"
 if (txtEnable)	return createEvent(descriptionText: "${device.displayName}: ${cmd}")
 }

 def updateCurrentParams() {
	log.warn "Sending configuration parameters to ${device.displayName}"  
    
     
    log.debug "Param 14 setting = ${param14.value}" 
     
    def cmds = []  
	cmds << zwave.multiChannelAssociationV2.multiChannelAssociationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
	cmds << zwave.associationV2.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format()
	cmds << zwave.associationV1.associationRemove(groupingIdentifier:1, nodeId:zwaveHubNodeId).format() 
	cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param1 == null ? 0 : param1.value, parameterNumber: 1, size: 2).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param2 == null ? 0 : param2.value, parameterNumber: 2, size: 2).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param3 == null ? 1 : param3.value, parameterNumber: 3, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param4 == null ? 1 : param4.value, parameterNumber: 4, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param5 == null ? 255 : param5.value, parameterNumber: 5, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param6 == null ? 255 : param6.value, parameterNumber: 6, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param7 == null ? 255 : param7.value, parameterNumber: 7, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param8 == null ? 255 : param8.value, parameterNumber: 8, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param9 == null ? 0 : param9.value, parameterNumber: 9, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param10 == null ? 20 : param10.value, parameterNumber: 10, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param11 == null ? 200 : param11.value, parameterNumber: 11, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param12 == null ? 8 : param12.value, parameterNumber: 12, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param13 == null ? 0 : param13.value, parameterNumber: 13, size: 1).format()
    //cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: param14 == null ? 0 : param14.value, parameterNumber: 14, size: 1).format()
    cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 1, parameterNumber: 14, size: 1).format()
    return delayBetween(cmds, 500)
}
 
 def listCurrentParams() {
    log.info "Listing of current parameter settings of ${device.displayName}"
 def cmds = []
 	cmds << zwave.multiChannelAssociationV2.multiChannelAssociationGet(groupingIdentifier:2).format()
 	cmds << zwave.associationV2.associationGet(groupingIdentifier: 3).format()
 	cmds << zwave.associationV1.associationGet(groupingIdentifier: 1).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 1).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 2).format()
    cmds << zwave.configurationV1.configurationGet(parameterNumber: 3).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 4).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 5).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 6).format()
    cmds << zwave.configurationV1.configurationGet(parameterNumber: 7).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 8).format()
    cmds << zwave.configurationV1.configurationGet(parameterNumber: 9).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 10).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 11).format()
    cmds << zwave.configurationV1.configurationGet(parameterNumber: 12).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 13).format()
 	cmds << zwave.configurationV1.configurationGet(parameterNumber: 14).format()
 	return delayBetween(cmds, 500)
 }
 
 def open1() {
    if (IP1Type == "Contact") sendEvent(name: "contact1", value: "open", descriptionText: "$device.displayName - IP1 was set to open", type: "digital")
	if (IP1Type == "Motion") sendEvent(name: "contact1", value: "inactive", descriptionText: "$device.displayName - IP1 was set to inactive", type: "digital")
     try {
         def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP1"}
         log.info "Changing child ${childDevice} to open/inactive"
         if (childDevie)
         if (IP1Type == "Motion") childDevice.sendEvent(name: "motion", value: "inactive", descriptionText: "$device.displayName - IP1 was set to inactive", type: "digital")
         if (IP1Type == "Contact") childDevice.sendEvent(name: "contact", value: "open", descriptionText: "$device.displayName - IP1 was set to open", type: "digital")
     } catch (e) {
         log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
     }
 }
 
 def close1() {
    if (IP1Type == "Contact") sendEvent(name: "contact1", value: "closed", descriptionText: "$device.displayName - IP1 was set to closed", type: "digital")
	if (IP1Type == "Motion") sendEvent(name: "contact1", value: "active", descriptionText: "$device.displayName - IP1 was set to active", type: "digital")
     try {
         def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP1"}
         log.info "Changing child ${childDevice} to closed/active"
         if (childDevice)
         if (IP1Type == "Motion") childDevice.sendEvent(name: "motion", value: "active", descriptionText: "$device.displayName - IP1 was set to active", type: "digital")
         if (IP1Type == "Contact") childDevice.sendEvent(name: "contact", value: "closed", descriptionText: "$device.displayName - IP1 was set to closed", type: "digital")
     } catch (e) {
         log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
     }
 }
 
 def open2() {
    if (IP2Type == "Contact") sendEvent(name: "contact2", value: "open", descriptionText: "$device.displayName - IP2 was set to open", type: "digital")
	if (IP2Type == "Motion") sendEvent(name: "contact2", value: "inactive", descriptionText: "$device.displayName - IP2 was set to inactive", type: "digital")
     try {
         def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP2"}
         log.info "Changing child ${childDevice} to open/inactive"
         if (childDevice)
         if (IP2Type == "Motion") childDevice.sendEvent(name: "motion", value: "inactive", descriptionText: "$device.displayName - IP2 was set to inactive", type: "digital")
         if (IP2Type == "Contact") childDevice.sendEvent(name: "contact", value: "open", descriptionText: "$device.displayName - IP2 was set to open", type: "digital")
     } catch (e) {
         log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
     }
 }
 
 def close2() {
    if (IP2Type == "Contact") sendEvent(name: "contact2", value: "closed", descriptionText: "$device.displayName - IP2 was set to closed", type: "digital")
	if (IP2Type == "Motion") sendEvent(name: "contact2", value: "active", descriptionText: "$device.displayName - IP2 was set to active", type: "digital")
     try {
         def childDevice = getChildDevices()?.find { it.deviceNetworkId == "${device.deviceNetworkId}-IP2"}
         log.info "Changing child ${childDevice} to closed/active"
         if (childDevice)
         if (IP2Type == "Motion") childDevice.sendEvent(name: "motion", value: "active", descriptionText: "$device.displayName - IP2 was set to active", type: "digital")
         if (IP2Type == "Contact") childDevice.sendEvent(name: "contact", value: "closed", descriptionText: "$device.displayName - IP2 was set to closed", type: "digital")
     } catch (e) {
         log.error "Couldn't find child device, probably hasn't been created yet? Please click create child devices. Error: ${e}"
	 }
 }
//capture preference changes
def updated() {
	log.info "updated()"
	log.warn "debug logging is: ${logEnable == true}"
    log.warn "description logging is: ${txtEnable == true}"
	log.warn "Settings is: ${settingEnable == true}"
	if (logEnable) runIn(1800,logsOff)
	if (settingEnable) runIn(2100,SettingsOff)
	
	// Check for any null settings and change them to default values
    if (IP1Type == null) IP1Type = "Contact"
    if (IP2Type == null) IP2Type = "Contact"
	
	// is contact or motion used or both
		
	if (IP1Type == "Contact" || IP2Type == "Contact") { state.ContactUsed = true
	if (txtEnable)	log.info "At least 1 Contact used"
	} else { state.ContactUsed = false
	if (txtEnable)	log.info "Contact's not used"	
			
		   }

	if (IP1Type == "Motion" || IP2Type == "Motion") { state.MotionUsed = true
	if (txtEnable)	log.info "At least 1 Motion used"
	} else { state.MotionUsed = false
	if (txtEnable)	log.info "Motion not used"	
			
		   }
}
3 Likes

could you post this in "community drivers" i was looking for someone to fix these Universal Sensors from Fibaro but ended up buying the Smart implants.. so now my UBS's just lie in the drawer...

but it seems like you have gotten it to work on the C7 and perhaps even with the latest firmware: 2.2.5.131?

Hi there, yes it does work on 2.2.5.131, no problems so far.

I'm a newbie to driver writing and Hubitat, I didn't feel confident enough to push this to community drivers. It's not well polished tbh.