[RELEASE] Fibaro Dimmer 2 (FGS-212) Driver

To be honest, I am not sure. I have selected the logs page and filtered the device. I can see the switch being turned on. I have pressed B three times, there is some debug text, but I am not sure if these are a result of the triple press or routine reporting to the HE. The syncPending Status is still true, so it looks like it has not updated.

I am not clear what the two save buttons do, and am not confident the B triple press is doing anything.

Yes, I am using this driver.

I can't for the life of me remember what I did.
I know mine was set to a momentary switch when first fitted/discovered and I changed it to a toggle switch.
I also remember getting frustrated with it not seeming to take the configuration.
They do sync up every so often so perhaps I changed the config and waited for it to update.
How long have you given it to update?
@Robin. Sorry to be a pain and link you into this but can you offer more advice on how to get this changed or is it a matter of just waiting for the config to update?
Thanks.

Ok, thanks. The device hasn't sync'd for about 5 hours. I'll take a look tomorrow and see what the status is.

OK. Here is the device handler I'm using, without checking its probably the same one as above.
When I change a parameter and hit 'Save', in the logs I can see the config being saved by the device.
image

Here is the DH.

/**
 *  
 *	Fibaro Dimmer 2 (FGD-212) Driver - For use on Hubitat
 *  
 *	Author: Robin Winbourne
 *	Date: 2018-04-01 
 */

metadata {
	definition (name: "Fibaro Dimmer 2. Robins", namespace: "Hubitat", author: "Robin Winbourne") {
		capability "Energy Meter"
		capability "Actuator"
		capability "Switch"
		capability "Power Meter"
		capability "Polling"
		capability "Refresh"
		capability "Sensor"
        capability "Switch Level"

        attribute "scene", "number"           //Extending Fibaro Dimmer 2 devices with scene attribute
        attribute "syncPending", "bool"       // Updates when parameters have synced
        
		command "reset"
        command "changeSingleParam"

       // Fingerprints:
        fingerprint mfr: "010F", prod: "0102", model: "1000"
        fingerprint type: "1101", mfr: "010F", cc: "5E,86,72,59,73,22,31,32,71,56,98,7A"
        fingerprint type: "1101", mfr: "010F", cc: "5E,86,72,59,73,22,31,32,71,56,98,7A", sec: "20,5A,85,26,8E,60,70,75,27", secOut: "2B"
	}

   preferences {
       input name: "param1", type: "number", range: "1..98", defaultValue: "1", required: true,
            title: "1. Minimum brightness level. " +
                   "Set automatically during the calibration process, but can be changed afterwards. " +
                   "Values: 1-98 = Brightness level (%). Default value: 1."
               
       input name: "param2", type: "number", range: "2..99", defaultValue: "99", required: true,
            title: "2. maximum brightness level. " +
                   "Set automatically during the calibration process, but can be changed afterwards. " +
                   "Values: 2-99 = Brightness level (%). Default value: 99."

       input name: "param3", type: "number", range: "1..99", defaultValue: "1", required: true,
            title: "3. Incandescence Level of CFLs. " +
                   "The Dimmer 2 will set to this value after first switch on. It is required for warming up and switching dimmable compact fluorescent lamps and certain types of light sources. " +
                   "Values: 1-99 = Brightness level (%). Default value: 1"

        input name: "param4", type: "number", range: "0..255", defaultValue: "0", required: true,
            title: "4. Incandescence Time of CFLs. " +
                   "The time required for switching compact fluorescent lamps and certain types of light sources. " +
                   "Values: 0 = Function Disabled. 1-255 = 0.1-25.5s in 0.1s steps. Default value: 0."

        input name: "param5", type: "number", range: "1..99", defaultValue: "1", required: true,
            title: "5. Dimming Step Size (Auto). " +
                   "The percentage value of a dimming step during automatic control. " +
                   "Values: 1-99 = Dimming step (%). Default value: 1."

        input name: "param6", type: "number", range: "0..255", defaultValue: "1", required: true,
            title: "6. Dimming Step Time (Auto). " +
                   "The time of a single dimming step during automatic control. " +
                   "Values: 0-255 = 0-2.55s, in 10ms steps. Default value: 1."

        input name: "param7", type: "number", range: "1..99", defaultValue: "1", required: true,
            title: "7. Dimming Step Size (Manual). " +
                   "The percentage value of a dimming step during manual control. " +
                   "Values: 1-99 = Dimming step (%). Default value: 1."

        input name: "param8", type: "number", range: "0..255", defaultValue: "5", required: true,
            title: "8. Dimming Step Time (Manual). " +
                   "The time of a single dimming step during manual control. " +
                   "Values: 0-255 = 0-2.55s, in 10ms steps. Default value: 5."
       
        input name: "param9", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - Off"],
                      ["1" : "1 - Restore Previous State"]],
            title: "9. Dimmer dtate After Power Failure. " +
                   "The Dimmer can save its current state before a power failure and restore that state after a power failure. Default value: 1"

        input name: "param10", type: "number", range: "0..32767", defaultValue: "0", required: true,
            title: "10. Timer functionality (auto off). " +
                   "Automatically switch off the device after a specified time. " +
                   "Values: 0 = Function Disabled. 1-32767 = time in seconds. Default value: 0."

        input name: "param11", type: "enum", defaultValue: "255", required: true,
            options: [["0" : "0 - All ON not active, All OFF not active"],
                      ["1" : "1 - All ON not active, All OFF active"],
                      ["2" : "2 - All ON active, All OFF not active"],
                      ["255" : "255 - All ON active, All OFF active"]],
            title: "11. ALL ON / ALL OFF function. " +
                   "Dimmer response to SWITCH_ALL_SET commands which can be sent from other zwave devices. Default value: 255."
       
        input name: "param13", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Readout"],
                      ["1" : "1 - force auto-calibration of the load WITHOUT Fibaro Bypass 2"],
                      ["2" : "2 - force auto-calibration of the load WITH Fibaro Bypass 2"]],
            title: "13. Force auto-calibration. " +
                   "Set this parameter to 1 or 2 to trigger an auto calibration. Parameter switches back to 0 upon completion (but not updated here). Default value: 0."

        input name: "param15", type: "number", range: "0..99", defaultValue: "30", required: true,
            title: "15. Burnt out bulb detection. " +
                   "Power variation, compared to standard power consumption (measured during calibration). " +
                   "Values: 0 = Function Disabled. 1-99 = Power variation (%). Default value: 30."

        input name: "param16", type: "number", range: "0..255", defaultValue: "5", required: true,
            title: "16. Time Delay for Burnt Out Bulb/Overload Detection. " +
                   "Time delay (in seconds) for LOAD ERROR or OVERLOAD detection. " +
                   "Values: 0 = Detection Disabled. 1-255 = Time delay (s). Default value: 5."

        input name: "param19", type: "number", range: "0..99", defaultValue: "0", required: true,
            title: "19. Forced switch on brightness level. " +
                   "Switching on the dimmer will always set this brightness level. " +
                   "Values: 0 = Function Disabled. 1-99 = Brightness level (%). Default value: 0."
               
       input name: "param20", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Momentary switch"],
                      ["1" : "1 - Toggle switch"],
                      ["2" : "2 - Roller blind switch"]],
            title: "20. Switch Type Selection. " +
                   "Physical switch type: Momentary, Toggle, or Roller Blind (middle rest position, up to brighten, down to dim). Default value: 0."
          
       input name: "param21", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - 0xFF"],
                      ["1" : "1 - Current Level"]],
            title: "21. Value Sent to Associated Devices on Single Click. " +
         		   "0xFF will set associated devices to their last-saved state. Current Level will synchronise the state of all devices with this dimmer. Default value: 0."

       input name: "param22", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Change on Every Switch State Change"],
                      ["1" : "1 - Synchronise with Switch State"]],
            title: "22. Assign Toggle Switch Status to Device Status. " +
         		   "By default, each change of toggle switch position results in an on/off action regardless the physical connection of contacts. Default value: 0."

       input name: "param23", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - Double-click DISABLED"],
                      ["1" : "1 - Double-click ENABLED"]],
            title: "23. Double-click sets Max Brightness. " +
         		   "Double-clicking will set brightness level to maximum. Default value: 1."

       input name: "param24", type: "number", range: "0..31", defaultValue: "0", required: true,
            title: "24. Command Frames Sent to 2nd and 3rd Association Groups (S1 Associations). " +
                   "Determines which actions will not result in sending frames to association groups. Values (add together): " +
                   "0 = All actions sent to association groups, " +
                   "1 = Do not send when switching ON (single click), " +
                   "2 = Do not send when switching OFF (single click), " +
                   "4 = Do not send when changing dimming level (holding and releasing), " +
                   "8 = Do not send on double click, " +
                   "16 = Send 0xFF value on double click. Default value: 0."

       input name: "param25", type: "number", range: "0..31", defaultValue: "0", required: true,
            title: "25. Command Frames Sent to 4th and 5th Association Groups (S2 Associations). " +
                   "Determines which actions will not result in sending frames to association groups. Values (add together): " +
                   "0 = All actions sent to association groups, " +
                   "1 = Do not send when switching ON (single click), " +
                   "2 = Do not send when switching OFF (single click), " +
                   "4 = Do not send when changing dimming level (holding and releasing), " +
                   "8 = Do not send on double click, " +
                   "16 = Send 0xFF value on double click. Default value: 0."
              
       input name: "param26", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - 3-way switch function for S2 DISABLED"],
                      ["1" : "1 - 3-way switch function for S2 ENABLED"]],
            title: "26. 3-way Switch Function. " +
         		   "Switch S2 also controls the dimmer when in 3-way switch mode. Function is disabled if parameter #20 is set to 2 (roller blind switch). Default value: 0."
              
       input name: "param27", type: "number", range: "0..15", defaultValue: "15", required: true,
            title: "27. Association Group Security Mode. " +
                   "Defines if commands sent to association groups are secure or non-secure. Values (add together): " +
                   "0 = all groups sent as non-secure, " +
                   "1 = 2nd group sent as secure, " +
                   "2 = 3rd group sent as secure, " +
                   "4 = 4th group sent as secure, " +
                   "8 = 5th group sent as secure. " +
                   "E.g. 15 = all groups (2-5) sent as secure. Default value: 15."

       input name: "param28", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Function DISABLED"],
                      ["1" : "1 - Function ENABLED"]],
            title: "28. Scene Activation. " +
         		   "Defines if SCENE_ACTIVATION_SET commands are sent. " +
                   "For Momentary: S1 input: 16 = 1 x click, 14 = 2 x click, 12 = hold, 13 = release. " +
                   "S2 input: 26 = 1 x click, 24 = 2 x click, 25 = 3 x click, 22 = hold, 23 = release (see manual for other switch types). Default value: 0."
       
       input name: "param29", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Standard Mode"],
                      ["1" : "1 - S1 operates as S2, S2 operates as S1"]],
            title: "29. Swap S1 and S2. " +
         		   "Swap the roles of S1 and S2 without changes to physical wiring. Default value: 0."
              
       input name: "param30", type: "enum", defaultValue: "2", required: true,
            options: [["0" : "0 - Force leading edge mode"],
                      ["1" : "1 - Force trailing edge mode"],
                      ["2" : "2 - Automatic (based on auto-calibration)"]],
            title: "30. Load Control Mode. " +
         		   "Override the dimmer mode (i.e. leading or trailing edge). Default value: 2."
        
       input name: "param32", type: "enum", defaultValue: "2", required: true,
            options: [["0" : "0 - On/Off mode DISABLED (dimming is possible)"],
                      ["1" : "1 - On/Off mode ENABLED (dimming not possible)"],
                      ["2" : "2 - Automatic (based on auto-calibration)"]],
            title: "32. On/Off Mode. " +
         		   "This mode is necessary when connecting non-dimmable light sources. Default value: 2."

       input name: "param34", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No soft-start"],
                      ["1" : "1 - Short soft-start (0.1s)"],
                      ["2" : "2 - Long soft-start (0.5s)"]],
            title: "34. Soft-Start. " +
         		   "Time required to warm up the filament of halogen bulbs. Default value: 1."

       input name: "param35", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No auto-calibration"],
                      ["1" : "1 - Auto-calibration after first power on only"],
                      ["2" : "2 - Auto-calibration after each power on"],
                      ["3" : "3 - Auto-calibration after first power on and after each LOAD ERROR"],
                      ["4" : "4 - Auto-calibration after each power on and after each LOAD ERROR"]],
            title: "35. Auto-calibration. " +
         		   "Determines when auto-calibration is triggered. Default value: 1."
       
       input name: "param37", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - Device disabled until command or external switch"],
                      ["1" : "1 - Three attempts to turn on the load"]],
            title: "37. Behaviour After OVERCURRENT or SURGE. " +
         		   "The dimmer will turn off when a surge or overcurrent is detected. Default value: 1."

        input name: "param39", type: "number", range: "0..350", defaultValue: "250", required: true,
             title: "39. Power limit - OVERLOAD. " +
                    "Reaching the defined value will result in turning off the load. Additional apparent power limit of 350VA is active by default. " +
                    "Values: 0 = Function Disabled, 1-350 = Power limit (W). Default value: 250."

       input name: "param40", type: "enum", defaultValue: "3", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Turn ON the load"],
                      ["2" : "2 - Turn OFF the load"],
                      ["3" : "3 - Load blinking"]],
            title: "40. Response to General Purpose Alarm. " +
         		   "Default value: 3."

       input name: "param41", type: "enum", defaultValue: "2", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Turn ON the load"],
                      ["2" : "2 - Turn OFF the load"],
                      ["3" : "3 - Load blinking"]],
            title: "41. Response to Water Flooding Alarm. " +
         		   "Default value: 2."
       
      input name: "param42", type: "enum", defaultValue: "3", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Turn ON the load"],
                      ["2" : "2 - Turn OFF the load"],
                      ["3" : "3 - Load blinking"]],
            title: "42. Response to Smoke, CO or CO2 Alarm. " +
         		   "Default value: 3."

       input name: "param43", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Turn ON the load"],
                      ["2" : "2 - Turn OFF the load"],
                      ["3" : "3 - Load blinking"]],
            title: "43. Response to Temperature Alarm. " +
         		   "Default value: 1."  

        input name: "param44", type: "number", range: "1..32767", defaultValue: "600", required: true,
             title: "44. Time of alarm state. " +
                    "Values: 1-32767 = Time (s). Default value: 600."
              
       input name: "param45", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Send an alarm frame"]],
            title: "45. OVERLOAD Alarm Report. " +
         		   "Power consumption above Power Limit. Default value: 1."

       input name: "param46", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Send an alarm frame"]],
            title: "46. LOAD ERROR Alarm Report. " +
         		   "No load, load failure, or burnt out bulb. Default value: 1."
       
       input name: "param47", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Send an alarm frame"]],
            title: "47. OVERCURRENT Alarm Report. " +
         		   "Short circuit, or burnt out bulb causing overcurrent. Default value: 1."
       
       input name: "param48", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Send an alarm frame"]],
            title: "48. SURGE Alarm Report. " +
         		   "Dimmer 2 output overvoltage. Default value: 1."

       input name: "param49", type: "enum", defaultValue: "1", required: true,
            options: [["0" : "0 - No reaction"],
                      ["1" : "1 - Send an alarm frame"]],
            title: "49. OVERHEAT and VOLTAGE DROP Alarm Report. " +
         		   "Critical temperature, or low voltage. Default value: 1."

        input name: "param50", type: "number", range: "0..100", defaultValue: "10", required: true,
             title: "50. Power Reports Threshold. " +
                    "Power level change that will result in a new power report being sent. " +
                    "Values: 0 = Reports disabled, 1-100 = % change from previous report. Default value: 10."

        input name: "param52", type: "number", range: "0..32767", defaultValue: "3600", required: true,
             title: "52. Reporting Period. " +
                    "The time period between consecutive power and energy reports. " +
                    "Values: 0 = Reports disabled, 1-32767 = Time period (s). Default value: 3600."

        input name: "param53", type: "number", range: "0..255", defaultValue: "10", required: true,
             title: "53. Energy Reports Threshold. " +
                    "Energy level change that will result in a new energy report being sent. " +
                    "Values: 0 = Reports disabled, 1-255 = 0.01-2.55 kWh. Default value: 10."

       input name: "param54", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Self-measurement DISABLED"],
                      ["1" : "1 - Self-measurement ENABLED"]],
            title: "54. Self-measurement. " +
         		   "Include power and energy consumed by the device itself in reports. Default value: 0."
       
       input name: "param58", type: "enum", defaultValue: "0", required: true,
            options: [["0" : "0 - Standard algorithm"],
                      ["1" : "1 - Based on calibration data"],
                      ["2" : "2 - Based on control angle"]],
            title: "58. Method of Calculating Active Power. " +
         		   "Useful in 2-wire configurations with non-resistive loads. Default value: 0."
  
        input name: "param59", type: "number", range: "0..500", defaultValue: "0", required: true,
             title: "59. Approximated Power at Max Brightness. " +
                    "Determines the approximate value of the power that will be reported by the device at it's maximum brightness level. " +
                    "Values: 0-500 = Power (W). Default value: 0."

        input name: "paramAssociationGroup1", type: "bool", defaultValue: true, required: true,
             title: "The Dimmer 2 provides the association of five groups. " +
                    "1st Association Group 'Lifeline'. Default value: true"

        input name: "paramAssociationGroup2", type: "bool", defaultValue: true, required: true,
             title: "2nd Association Group 'On/Off (S1)'. Default value: true"

        input name: "paramAssociationGroup3", type: "bool", defaultValue: false, required: true,
             title: "3rd Association Group 'Dimmer (S1)'. Default value: false"

        input name: "paramAssociationGroup4", type: "bool", defaultValue: false, required: true,
             title: "4th Association Group 'On/Off (S2)'. Default value: false"

        input name: "paramAssociationGroup5", type: "bool", defaultValue: false, required: true,
             title: "5th Association Group 'Dimmer (S2)'. Default value: false"
    }
}

def parse(String description) {
	log.trace(description)
    log.debug("RAW command: $description")
	def result = null

    if (description != "updated") {
		def cmd = zwave.parse(description.replace("98C1", "9881"), [0x20: 1, 0x26: 3, 0x32: 3, 0x25: 1, 0x98: 1, 0x70: 1, 0x85: 2, 0x9B: 1, 0x90: 1, 0x73: 1, 0x30: 1, 0x28: 1, 0x72: 1])
		if (cmd) {
			result = zwaveEvent(cmd)
		}
    }
    log.debug "Parsed '${description}' to ${result.inspect()}"
	return result
}

def zwaveEvent(hubitat.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
	log.debug( "Scene ID: $cmd.sceneId")
    log.debug( "Dimming Duration: $cmd.dimmingDuration")

    sendEvent(name: "scene", value: "$cmd.sceneId", data: [switchType: "$settings.param20"], descriptionText: "Scene id $cmd.sceneId was activated", isStateChange: true)
    log.debug( "Scene id $cmd.sceneId was activated" )
}

// Devices that support the Security command class can send messages in an encrypted form;
// they arrive wrapped in a SecurityMessageEncapsulation command and must be unencapsulated
def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
	log.trace(cmd)
	def encapsulatedCommand = cmd.encapsulatedCommand([0x20: 1, 0x26: 3, 0x32: 3, 0x25: 1, 0x98: 1, 0x70: 1, 0x85: 2, 0x9B: 1, 0x90: 1, 0x73: 1, 0x30: 1, 0x28: 1, 0x72: 1]) // can specify command class versions here like in zwave.parse
	if (encapsulatedCommand) {
		return zwaveEvent(encapsulatedCommand)
	} else {
		log.warn "Unable to extract encapsulated cmd from $cmd"
		createEvent(descriptionText: cmd.toString())
	}
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicReport cmd) {
	log.trace(cmd)
	dimmerEvents(cmd)
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {
	log.trace(cmd)
	dimmerEvents(cmd)
}
def zwaveEvent(hubitat.zwave.commands.switchmultilevelv3.SwitchMultilevelReport cmd) {
	log.trace(cmd)
	dimmerEvents(cmd)
}

def zwaveEvent(hubitat.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd)
{
	log.trace(cmd)
	dimmerEvents(cmd)
}

def dimmerEvents(hubitat.zwave.Command cmd) {
	log.trace(cmd)
	def result = []
	def value = (cmd.value ? "on" : "off")
	def switchEvent = createEvent(name: "switch", value: value, descriptionText: "$device.displayName was turned $value")
	result << switchEvent
	if (cmd.value) {
		result << createEvent(name: "level", value: cmd.value, unit: "%")
	}
	if (switchEvent.isStateChange) {
		result << response(["delay 3000", zwave.meterV2.meterGet(scale: 2).format()])
	}
	return result
}

def zwaveEvent(hubitat.zwave.commands.meterv3.MeterReport cmd) {
	log.trace(cmd)
	if (cmd.meterType == 1) {
		if (cmd.scale == 0) {
			return createEvent(name: "energy", value: cmd.scaledMeterValue, unit: "kWh")
		} else if (cmd.scale == 1) {
			return createEvent(name: "energy", value: cmd.scaledMeterValue, unit: "kVAh")
		} else if (cmd.scale == 2) {
			return createEvent(name: "power", value: Math.round(cmd.scaledMeterValue), unit: "W")
		} else {
			return createEvent(name: "electric", value: cmd.scaledMeterValue, unit: ["pulses", "V", "A", "R/Z", ""][cmd.scale - 3])
		}
	}
}

def zwaveEvent(hubitat.zwave.commands.configurationv1.ConfigurationReport cmd) {
    //Handles Configuration Reports and sets syncPending to False
    log.trace("zwaveEvent(): Configuration Report received: ${cmd}")
	sendEvent(name: "syncPending", value: false, isStateChange: true)
}

def zwaveEvent(hubitat.zwave.commands.sensormultilevelv4.SensorMultilevelReport cmd) {
    log.trace("zwaveEvent(): SensorMultilevelReport received: ${cmd}")
}

def zwaveEvent(hubitat.zwave.Command cmd) {
	log.trace(cmd)
	log.debug "No handler for $cmd"
	// Handles all Z-Wave commands we aren't interested in
	createEvent(descriptionText: cmd.toString(), isStateChange: false)
}

def on() {
	log.trace("on")
	secureSequence([
			zwave.basicV1.basicSet(value: 0xFF),
            zwave.switchMultilevelV1.switchMultilevelGet()
	])
}

def off() {
	log.trace("off")
	secureSequence([
			zwave.basicV1.basicSet(value: 0x00),
            zwave.switchMultilevelV1.switchMultilevelGet()
	])
}

def poll() {
	log.trace("poll")
	secureSequence([
		zwave.meterV2.meterGet(scale: 0),
		zwave.meterV2.meterGet(scale: 2)
	])
}

def refresh() {
	log.trace("trace")
	secureSequence([
		zwave.meterV2.meterGet(scale: 0),
		zwave.meterV2.meterGet(scale: 2)
	])
}

def reset() {
	log.trace("reset")
	return secureSequence([
    	zwave.switchMultilevelV1.switchMultilevelGet(),
		zwave.meterV2.meterReset(),
		zwave.meterV2.meterGet(scale: 0),
        zwave.meterV2.meterGet(scale: 2)
	])
}

def setLevel(level) {
	log.trace("setlevel")
	if(level > 99) level = 99
	secureSequence([
		zwave.basicV1.basicSet(value: level),
		zwave.switchMultilevelV1.switchMultilevelGet()
	], 5000)
}

def changeSingleParam(paramNum, paramSize, paramValue) {
	log.debug "changeSingleParam(paramNum: $paramNum, paramSize: $paramSize, paramValue: $paramValue)"
    def cmds = secureSequence([
    	zwave.configurationV1.configurationSet(parameterNumber: paramNum, size: paramSize, scaledConfigurationValue: paramValue)
        ])
    cmds
}

def updated() {
     log.debug "configureAfterSecure()"
     sendEvent(name: "syncPending", value: true, isStateChange: true)
        def cmds = secureSequence([
            zwave.configurationV1.configurationSet(parameterNumber: 1, size: 1, scaledConfigurationValue: param1.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, scaledConfigurationValue: param2.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: param3.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 4, size: 2, scaledConfigurationValue: param4.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: param5.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 6, size: 2, scaledConfigurationValue: param6.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, scaledConfigurationValue: param7.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 8, size: 2, scaledConfigurationValue: param8.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, scaledConfigurationValue: param9.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 10, size: 2, scaledConfigurationValue: param10.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 11, size: 2, scaledConfigurationValue: param11.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: param13.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 15, size: 1, scaledConfigurationValue: param15.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 16, size: 2, scaledConfigurationValue: param16.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 19, size: 1, scaledConfigurationValue: param19.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 20, size: 1, scaledConfigurationValue: param20.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 21, size: 1, scaledConfigurationValue: param21.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 22, size: 1, scaledConfigurationValue: param22.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 23, size: 1, scaledConfigurationValue: param23.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 24, size: 1, scaledConfigurationValue: param24.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 25, size: 1, scaledConfigurationValue: param25.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 26, size: 1, scaledConfigurationValue: param26.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 27, size: 1, scaledConfigurationValue: param27.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 28, size: 1, scaledConfigurationValue: param28.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 29, size: 1, scaledConfigurationValue: param29.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 30, size: 1, scaledConfigurationValue: param30.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 32, size: 1, scaledConfigurationValue: param32.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 34, size: 1, scaledConfigurationValue: param34.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: param35.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 37, size: 1, scaledConfigurationValue: param37.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 39, size: 2, scaledConfigurationValue: param39.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 40, size: 1, scaledConfigurationValue: param40.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 41, size: 1, scaledConfigurationValue: param41.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 42, size: 1, scaledConfigurationValue: param42.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 43, size: 1, scaledConfigurationValue: param43.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 44, size: 2, scaledConfigurationValue: param44.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 45, size: 1, scaledConfigurationValue: param45.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 46, size: 1, scaledConfigurationValue: param46.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 47, size: 1, scaledConfigurationValue: param47.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 48, size: 1, scaledConfigurationValue: param48.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 49, size: 1, scaledConfigurationValue: param49.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 50, size: 1, scaledConfigurationValue: param50.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 52, size: 2, scaledConfigurationValue: param52.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 53, size: 2, scaledConfigurationValue: param53.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 54, size: 1, scaledConfigurationValue: param54.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 58, size: 1, scaledConfigurationValue: param58.toInteger()),
            zwave.configurationV1.configurationSet(parameterNumber: 59, size: 2, scaledConfigurationValue: param59.toInteger())
        ])

        // Register for Group 1
        if(paramAssociationGroup1) {
        	cmds << secure(zwave.associationV2.associationSet(groupingIdentifier:1, nodeId: [zwaveHubNodeId]))
        }
        else {
        	cmds << secure(zwave.associationV2.associationRemove(groupingIdentifier:1, nodeId: [zwaveHubNodeId]))
        }
        // Register for Group 2
        if(paramAssociationGroup2) {
        	cmds << secure(zwave.associationV2.associationSet(groupingIdentifier:2, nodeId: [zwaveHubNodeId]))
        }
        else {
        	cmds << secure(zwave.associationV2.associationRemove(groupingIdentifier:2, nodeId: [zwaveHubNodeId]))
        }
        // Register for Group 3
        if(paramAssociationGroup3) {
        	cmds << secure(zwave.associationV2.associationSet(groupingIdentifier:3, nodeId: [zwaveHubNodeId]))
        }
        else {
        	cmds << secure(zwave.associationV2.associationRemove(groupingIdentifier:3, nodeId: [zwaveHubNodeId]))
        }
        // Register for Group 4
        if(paramAssociationGroup4) {
        	cmds << secure(zwave.associationV2.associationSet(groupingIdentifier:4, nodeId: [zwaveHubNodeId]))
        }
        else {
        	cmds << secure(zwave.associationV2.associationRemove(groupingIdentifier:4, nodeId: [zwaveHubNodeId]))
        }
        // Register for Group 5
        if(paramAssociationGroups5) {
        	cmds << secure(zwave.associationV2.associationSet(groupingIdentifier:5, nodeId: [zwaveHubNodeId]))
        }
        else {
        	cmds << secure(zwave.associationV2.associationRemove(groupingIdentifier:5, nodeId: [zwaveHubNodeId]))
        }
	cmds 
}

private secure(hubitat.zwave.Command cmd) {
	log.trace(cmd)
	zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
}

private secureSequence(commands, delay=200) {
	log.debug "$commands"
	delayBetween(commands.collect{ secure(it) }, delay)
}

Hi Again,

Thanks for displaying your driver and error log. My driver is the same as you are using. I have posted a screenshot of my log below. What I notice is that each time I press Save (the first save, i.e. the parameter save), I get the same error. If you look at the log from 18:43.06, the first configureAfterSecure was saving a changed parameter resulting in an error. At 18:44.04 I selected the Refresh Button which resulted in the next four lines of code, then at 18:45:10 and at 18:47.37 I tried two parameter changes and saves, each with the same result. Finally, at 18:52.24 I clicked save with out changing a parameter and got the same error. So it looks to me I have a null value somewhere where I shouldn't have it.

@jonathan.rostron1969
I think I had the same problem as well.
What I did was fill in all the parameters that were blank when you look at the device .
Just put in the default values.
The error you are seeing refers to Line 515 of the DH code which is where it puts the configuration to the device.
Give it a try and I think you will find it will work.

Yes, that's cleared the error in the log, thanks. I am still not getting the syncPending to go false, though. I have tried setting Parameter 20 to Value 1 (Toggle Switch), and I can see the code in the log reflects this, but it still does not seem to complete the sync. Furthermore, I have tried the on/off buttons on the device page, which I can see activate in the code (BasicSet (value:255) and BasicSet(value:0)), but the lights do not come on. I suspect I am looking at the basic syncing of the device with the HE now, though.

Help!
I've got a strange issue, i've tried to pair two different Dimmer 2 modules now and although they appear to pair once i change the device type and try to control the module nothing happens.
Strange thing is when i use the Basic tool as device type I can set variables, i.e. enable S2 for off/dim.
I've tried paring 20+ times now, rebooting the hub in between, repairing the zwave network, changing the zwave network to be secure for all devices, having the modules less than 30mm away form the HE and I generally get the same result. When i've got the all secured option enabled the log gives next to no infformation. When it pairs normally i get;
dev:992018-11-20 12:40:43.515 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 21 01 00 AE B8 7E 00
dev:992018-11-20 12:40:43.508 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 3A 01 00 1D 2A 7E 00
dev:992018-11-20 12:40:43.489 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 20 01 02 B9 CA 7E 00
dev:992018-11-20 12:40:43.472 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 1F 01 01 60 3D 7E 00
dev:992018-11-20 12:40:43.448 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 0E 01 01 14 6E 7E 00
dev:992018-11-20 12:40:43.442 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 1E 01 02 67 6E 7E 00
dev:992018-11-20 12:40:43.416 pm debugDevice, parse description: zw device: 11, command: 5601, payload: 70 06 01 01 01 38 5F 7E 00
dev:992018-11-20 12:40:43.408 pm debugDevice, parse description: zw device: 11, command: 5601,
payload: 70 06 02 01 34 07 F9 7E 00

Any advice welcome
Dave

Hi Dave,

Not sure if it will work, but Hubitat Support advised earlier today that I try the following:
From "Settings" go to Z-Wave Details, then on the top right hand corner, select "All Secure Z-Wave", then click "Update". Once enabled, please exclude any previously paired dimmers, the try to discover them again.

Not sure if it works yet as I am away from home, but I will try once I return.

That’s funny, they suggested I do the same!
For me it didn’t work :weary:
I’ve even tried a brand new out the box dinner with the same result.
Not sur wit it’s a big but when the secure setting is enabled the log output seems pretty much non existent when pairing.
Dave

Hi Dave,

I tried this today, but only with limited success. The Fibaro Dimmer 2 driver still does not work, but the generic z-wave dimmer driver does, so I have some limited funtionality (I can control the lights on and off and set the level from HE). I suspect that this is something to do with the secure pairing.

Regards

John

Ah I haven’t tried that.
To be honest I’ve put my hubitat back in its box for a while...until I k ow the two main modules I use will work properly.
Support have said that they’re close to having a driver for the Dimmer 2 but can’t give any time line...so it’s a bit open ended.

Update should be instant after you click save... triggered by the updated function.

Make sure you have entered all the values into all the parameter fields... HE won’t allow defaults to auto populate unlike ST.

Make sure you have achieved secure inclusion, if the device has to communicate through other devices on first inclusion, it will be set as insecure and parameter updates will fail. (Position hub near the device when including it).

I’d really appreciate any help. I have a number of dimmers that I have used with ST and home assistant without issues.

I am not able to get the dimmers working with Hubitat. I have tried to the default driver which works from the devices screen. However I can not get the dashboard working. The dimmer will turn off if I click the icon, but the lightbulb icon goes to a an hour glass icon and stays like this. I am then unable to turn the dimmer on but can do by adjusting the dimmer.

I suspect the issue is that the status of the dimmer does not update. Hence I tried to use this driver but I can’t get it working at all, even from the device screen. Any help appreciated!

@nikonshooter35mm try this one works great

1 Like

I'm planning on moving my 2 dimmers to from SmartThings to Hubitat soon. Does anyone know if rule machine can trigger off scene id's?

does not need to, the driver i posted above converts them into button events in the driver so i just run rules from them :slight_smile: . This way it's super fast! S1 controls the load S2 controls a zigbee RGBW pendant lamp ON/OFF UP/DOWN and different colours/ temperatures per mode. You need a few rules and a global variable to do all that but it works perfectly.

Well aren't you just the cats ass :grinning:. This is great news thx for the info, much appreciated.

1 Like

Just to clarify the rules I had to create to tie them all together are mine, but the genius behind the driver is @ericm :grin:

3 Likes

This is now easy as pie with rule 4.0 using button controller built in so rather than about 4-5 rules it's now all in one rule. I will post a screenshot later :slight_smile: