Request: Edge Drivers for Aeotec Smart Switch 6 and and Multisensor 6

Has anyone written Edge Drivers for these two Devices?

Aeotech Multisensor 6

Raw Description zw:S type:2101 mfr:0086 prod:0102 model:0064 ver:1.07 zwv:4.05 lib:03 cc:5E,86,72,59,85,73,71,84,80,30,31,70,7A,5A role:06 ff:8C07 ui:8C07

Aeotec Smart Switch 6

Raw Description zw:Ls type:1001 mfr:0086 prod:0103 model:0060 ver:1.03 zwv:4.05 lib:03 cc:5E,86,72,98 ccOut:5A,82 sec:25,26,33,70,27,32,81,85,59,7A,73 role:05 ff:8700 ui:8700

4 Likes

I would also add the Aeotec Smart switch 7

aeotec

Raw Description zw:Ls2a type:1001 mfr:0371 prod:0003 model:00AF ver:1.02 zwv:6.04 lib:03 cc:5E,55,22,98,9F,6C sec:85,59,70,2C,2B,81,71,32,25,33,26,75,73,7A,86,5A,72

But it wouldn’t be in their interest to write the driver?

1 Like

@JDRoberts, can this be moved to the new section that you created for Edge Driver requests. I don’t know how to do it.

I would like to test an Edge driver for Aeotec Smart Switch 7 as well.

I can’t move it, but I’ll add a link. :sunglasses:. That said, I would expect Aeotec to have stock edge drivers by the time edge gets out of beta, but I don’t know for sure.

1 Like

I’ve put together a small set of Edge drivers for some Aeotec devices and published them to a channel. These drivers provide expanded configuration options for the devices, including indicator light control and group associations. :grinning:

The repository (with the invitation link) is right here; the currently-supported devices include:

  • Aeotec Illumino Dimmer (ZWA037-A)
  • Aeotec Illumino Switch (ZWA038-A)
  • Aeotec Smart Switch 6 (ZW096)
  • Aeotec Smart Switch 7 (ZWA023-A)
  • Aeotec WallMote 7 (ZWA022-A)
  • Aeotec WallMote (Duo) (ZW129)

Any feedback is welcome, as is some exercise for the drivers.

3 Likes

@CommanderQ , i will try Smart Switch 6 later today.

Aeotec Edge Drivers

4 Likes

Did you find the EDGE driver for Multisensor 6 Aeotec?

for Multisensor 6, I have been using the stock z-wave sensor, and it work good, not as many settings as I would like, but it works.

Any chance to add the driver for nanomote quad (ZWA003)?

I can look into that. :slight_smile: Incidentally, Aeotec is starting to create some drivers as well and may get to it before me; this article has their list of supported devices.

Hi Mike
Would you perhaps be able to look into creating a driver for the Aeotec Garage Door opener, please?
I have been using this custom DTH with these devices: SmartThings/device_type-aeon-garage-door-v0.1 at master · robertvandervoort/SmartThings · GitHub
Thank you!

2 Likes

Hey @CommanderQ , thanks for you excellent work.
I was wondering, would you be able to create drivers for:

  • Aeotec Siren Gen 5
  • Aeotec Garage controller?

They are 2 of the Aeotec devices that aren’t yet covered by Edge.

I’d be happy to support and test (I have both and I have ST CLI set up, but I’m not yet able to develop driver by myself).

1 Like

I tried this for the aeotec smart switch 7 (the one from aeotec themselfs is really limited), but it doesn’t work. That’s probably because im using the EU version, not the US version of this plug. Any way you could make it work for my EU version?

For the custom DTH that was created for the Aeon Smart Switch 6, there was a setting that allowed you to “Disable On/Off Switch”. So it is possible to use the device to monitor power consumption, but prevent you from inadvertently turning the switch Off. Can this be implemented in the Driver?

Happy to queue up each of these for the Smart Switch 6, Smart Switch 7 (EU), Siren, and Garage. I should have a little free time in a couple weeks to tinker with these and post back here with updates. :grinning:

@CommanderQ, any chance of you updating the driver for the Aeon Smart Switch 6 to add a setting to control the ability to turn the switch on/off? See previous post.

Happily @damohabir . :slight_smile: Interestingly, I can’t find the specific parameter that controls that behavior in the docs for the Smart Switch 6 (or I keep reading past it). I don’t suppose you have a link to the old Groovy driver that had that configuration option? I could figure out the right parameter if I can take a peek at the old driver, I think.

@CommanderQ , here is the DTH for the Smart Switch 6 (posted in 2 parts):

def clientVersion() {
return “5.3.2”
}

metadata {
definition(name: “Aeon Labs Smart Switch 6 Gen5_V5.3.2”, namespace: “dmohabir”, author: “D. Mohabir”) {
capability “Switch”
capability “Polling”
capability “Power Meter”
capability “Energy Meter”
capability “Refresh”
capability “Switch Level”
capability “Sensor”
capability “Actuator”
capability “Configuration”
capability “Color Control”

    command "energy"
    command "momentary"
    command "nightLight"

    command "reset"
    command "factoryReset"
    command "setBrightnessLevel"
    command "getDeviceInfo"

    attribute "deviceMode", "String"

    // Base on https://community.smartthings.com/t/new-z-wave-fingerprint-format/48204
    fingerprint mfr: "0086", prod: "0103", model: "0060" // Aeon brand
	fingerprint mfr: "0086", prod: "0003", model: "004B" // Foxx Project (UK)
    fingerprint mfr: "0134", prod: "0259", model: "0096" // AT&T rebrand
    fingerprint type: "1001", cc: "5E,25,26,33,70,27,32,81,85,59,72,86,7A,73", ccOut: "5A,82"
}

tiles(scale: 2) {
    multiAttributeTile(name: "mainPanel", type: "lighting", width: 6, height: 4, canChangeIcon: true) {
        tileAttribute("device.switch", key: "PRIMARY_CONTROL") {
            attributeState "on", label: '${name}', action: "switch.off", icon: "st.Appliances.appliances17", backgroundColor: "#00a0dc", nextState: "turningOff"
            attributeState "off", label: '${name}', action: "switch.on", icon: "st.Appliances.appliances17", backgroundColor: "#ffffff", nextState: "turningOn"
            attributeState "turningOn", label: '${name}', action: "switch.off", icon: "st.Appliances.appliances17", backgroundColor: "#00a0dc", nextState: "turningOff"
            attributeState "turningOff", label: '${name}', action: "switch.on", icon: "st.Appliances.appliances17", backgroundColor: "#ffffff", nextState: "turningOn"
        }
        tileAttribute("statusText3", key: "SECONDARY_CONTROL") {
            attributeState "statusText3", label: '${currentValue}'
        }
    }
    standardTile("deviceMode", "deviceMode", canChangeIcon: true, canChangeBackground: false, width: 2, height: 2) {
        state "energy", label: 'energy', action: "momentary", icon: "http://mail.lgk.com/aeonv6orange.png"
        state "momentary", label: 'momentary', action: "nightLight", icon: "http://mail.lgk.com/aeonv6white.png"
        state "nightLight", label: 'NightLight', action: "energy", icon: "http://mail.lgk.com/aeonv6blue.png"
    }

    valueTile("power", "device.power", width: 2, height: 1, decoration: "flat") {
        state "default", label: '${currentValue} W'
    }

    valueTile("energy", "device.energy", width: 2, height: 1, decoration: "flat") {
        state "default", label: '${currentValue} kWh'
    }

    valueTile("amperage", "device.amperage", width: 2, height: 1, decoration: "flat") {
        state "default", label: '${currentValue} A'
    }

    valueTile("voltage", "device.voltage", width: 2, height: 1, decoration: "flat") {
        state "default", label: '${currentValue} v'
    }

    valueTile("currentEnergyCostTxt", "currentEnergyCostTxt", width: 2, height: 1, decoration: "flat") {
        state "default", label: 'Energy Cost \n(Current Usage):'
    }

    valueTile("currentEnergyCostDay", "currentEnergyCostDay", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nDay\n$${currentValue}'
    }

    valueTile("currentEnergyCostWeek", "currentEnergyCostWeek", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nWeek\n$${currentValue}'
    }

    valueTile("currentEnergyCostMonth", "currentEnergyCostMonth", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nMonth\n$${currentValue}'
    }

    valueTile("currentEnergyCostYear", "currentEnergyCostYear", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nYear\n$${currentValue}'
    }

    valueTile("cumulativeEnergyCostTxt", "cumulativeEnergyCostTxt", width: 2, height: 1, decoration: "flat") {
        state "default", label: 'Energy Cost Since\n${currentValue}:'
    }
    
    valueTile("cumulativeEnergyCostActual", "cumulativeEnergyCostActual", width: 2, height: 1, decoration: "flat") {
        state "default", label: 'Cost: \n$${currentValue}'
    }
    
    valueTile("resetDate", "resetDate", width: 4, height: 1, decoration: "flat") {
        state "default", label: '${currentValue}'
    }
    
    valueTile("cumulativeEnergyCostDay", "cumulativeEnergyCostDay", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nDay \n$${currentValue}'
    }

    valueTile("cumulativeEnergyCostWeek", "cumulativeEnergyCostWeek", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nWeek\n$${currentValue}'
    }

    valueTile("cumulativeEnergyCostMonth", "cumulativeEnergyCostMonth", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nMonth\n$${currentValue}'
    }

    valueTile("cumulativeEnergyCostYear", "cumulativeEnergyCostYear", width: 1, height: 1, decoration: "flat") {
        state "default", label: 'Per\nYear \n$${currentValue}'
    }

    controlTile("levelSliderControl", "device.brightnessLevel", "slider", width: 2, height: 1) {
        state "level", action: "switch level.setLevel"
    }

    valueTile("levelSliderTxt", "device.brightnessLevel", decoration: "flat") {
        state "brightnessLevel", label: '${currentValue} %'
    }

    standardTile("refresh", "device.switch", decoration: "flat", width: 2, height: 2) {
        state "default", label: "", action: "refresh.refresh", icon: "st.secondary.refresh"
    }

    standardTile("reset", "device.energy", decoration: "flat", width: 2, height: 2) {
        state "default", label: 'reset', action: "reset", icon: "st.secondary.refresh-icon"
    }

    controlTile("rgbSelector", "device.color", "color", height: 3, width: 2) {
        state "color", action: "setColor"
    }

    standardTile("configure", "device.power", inactiveLabel: false, decoration: "flat", width: 1, height: 1) {
        state "configure", label: '', action: "configuration.configure", icon: "st.secondary.configure"
    }

    valueTile("deviceInfo", "deviceInfo", decoration: "flat", width: 6, height: 2) {
        state "default", label: '${currentValue}', action: "getDeviceInfo"
    }

    main(["mainPanel", "power", "energy", "voltage", "amperage"])
    details(["mainPanel", "cumulativeEnergyCostActual", "resetDate", "deviceMode", "power", "energy", "amperage", "voltage",
             "currentEnergyCostTxt", "currentEnergyCostDay", "currentEnergyCostWeek", "currentEnergyCostMonth", "currentEnergyCostYear",
             "cumulativeEnergyCostTxt", "cumulativeEnergyCostDay", "cumulativeEnergyCostWeek", "cumulativeEnergyCostMonth", "cumulativeEnergyCostYear",
             "rgbSelector", "levelSliderControl", "levelSliderTxt", "configure", "refresh", "reset", "deviceInfo"])
}

}

preferences {
input title: “”, description: “Aeon Smart Switch 6 (gen5) v${clientVersion()}”, displayDuringSetup: true, type: “paragraph”, element: “paragraph”

input name: "switchDisabled", type: "bool", title: "Disable switch on/off\n", defaultValue: "false", displayDuringSetup: true, required: true
input name: "refreshInterval", type: "number", title: "Refresh interval \n\nSet the refresh time interval (seconds) between each report [Default (300)].\n", displayDuringSetup: true, required: true
input name: "switchAll", type: "enum", title: "Respond to switch all?\n", description: "How does switch respond to the 'Switch All' command", options: ["Disabled", "Off Enabled", "On Enabled", "On and Off Enabled"], defaultValue: "On and Off Enabled", displayDuringSetup: true, required: false
input name: "forceStateChangeOnReport", type: "bool", title: "Force state change when receiving a report ? If true, you'll always get notification even if report data doesn't change.\n", defaultValue: "false", displayDuringSetup: true, required: true
input name: "secureInclusionOverride", type: "bool", title: "Is this device in secure inclusive mode?\n", defaultValue: "false", displayDuringSetup: true, required: true

input name: "onlySendReportIfValueChange", type: "bool", title: "Only send report if value change (either in terms of wattage or a %)\n", defaultValue: "false", displayDuringSetup: true, required: true
input title: "", description: "The next two parameters are only functional if the 'only send report' is set to true.", type: "paragraph", element: "paragraph", displayDuringSetup: true, required: true

input name: "minimumChangeWatts", type: "number", title: "Minimum change in wattage for a report to be sent (0 - 60000) [Default (25)].\n", range: "0..60000", displayDuringSetup: true, required: true
input name: "minimumChangePercent", type: "number", title: "Minimum change in percentage for a report to be sent (0 - 100) [Default (5)]\n", range: "0..100", displayDuringSetup: true, required: true

input name: "costPerKwh", type: "decimal", title: "Cost per kWh (Used for energy cost /per kWh) [Default (0.12)]\n", displayDuringSetup: true, required: true

input name: "includeWattInReport", type: "bool", title: "Include energy meter (W) in report?\n", defaultValue: "true", displayDuringSetup: true, required: true
input name: "includeVoltageInReport", type: "bool", title: "Include voltage (V) in report?\n", defaultValue: "true", displayDuringSetup: true, required: true
input name: "includeCurrentInReport", type: "bool", title: "Include current (A) in report?\n", defaultValue: "true", displayDuringSetup: true, required: true
input name: "includeCurrentUsageInReport", type: "bool", title: "Include current usage (kWh) in report?\n", defaultValue: "true", displayDuringSetup: true, required: true

input title: "", description: "Logging", type: "paragraph", element: "paragraph"
input name: "isLogLevelTrace", type: "bool", title: "Show trace log level ?\n", defaultValue: "false", displayDuringSetup: true, required: true
input name: "isLogLevelDebug", type: "bool", title: "Show debug log level ?\n", defaultValue: "true", displayDuringSetup: true, required: true

}

/*******************************************************************************

  • Z-WAVE PARSE / EVENTS *
    ******************************************************************************/

/**

  • parse - Called when messages from a device are received from the hub

  • The parse method is responsible for interpreting those messages and returning Event definitions.

  • String description The message from the device
    */
    def parse(String description) {
    def result = null
    logTrace “parse: ‘$description’”

    if (description != “updated”) {
    if (description.contains(“command: 5E02”)) {
    logInfo “Ignoring command 5E02 has it’s not supported by the platform.”
    return
    }

    def cmd = zwave.parse(description, [0x98: 1, 0x20: 1, 0x26: 3, 0x70: 1, 0x32: 3])
    logTrace "cmd: '$cmd'"
    
    if (cmd) {
        result = zwaveEvent(cmd)
        //log.debug("'$description' parsed to $result $result?.name")
    } else {
        logError "Couldn't zwave.parse '$description'"
    }
    

    }

    updateStatus()
    result
    }

/**

  • COMMAND_CLASS_SECURITY (0x98)

*/
def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
def encapsulatedCommand = cmd.encapsulatedCommand([0x20: 1, 0x26: 3, 0x70: 1, 0x32: 3])
logTrace “secure cmd: ‘$cmd’”
state.deviceInfo[‘secureInclusion’] = true;

// can specify command class versions here like in zwave.parse
if (encapsulatedCommand) {
    return zwaveEvent(encapsulatedCommand)
} else {
    logError "Unable to extract encapsulated cmd from $cmd"
}

}

/**

  • COMMAND_CLASS_SECURITY (0x98)

*/
def zwaveEvent(physicalgraph.zwave.commands.securityv1.NetworkKeyVerify cmd) {
log.debug “NetworkKeyVerify with cmd: $cmd (node is securely included)”

//after device securely joined the network, call configure() to config device
state.deviceInfo['secureInclusion'] = true;
updateDeviceInfo()

}

/**

  • COMMAND_CLASS_SWITCH_BINARY (0x25)

  • Short value 0xFF for on, 0x00 for off
    */
    def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinarySet cmd) {
    createEvent(name: “switch”, value: cmd.switchValue ? “on” : “off”)

    //return createEvent(name: “switch”, value: cmd.value ? “on” : “off”)
    }

/**

  • COMMAND_CLASS_SWITCH_BINARY (0x25)
  • Short value 0xFF for on, 0x00 for off
    */
    def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
    createEvent(name: “switch”, value: cmd.value ? “on” : “off”, displayed: false, isStateChange: true)
    }

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelReport cmd) {

}

/**

  • COMMAND_CLASS_BASIC (0x20)
  • This command is being ignored in secure inclusion mode.
  • Short value 0xFF for on, 0x00 for off
    */
    def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
    return createEvent(name: “switch”, value: cmd.value ? “on” : “off”, displayed: false)
    }

/**

  • COMMAND_CLASS_BASIC (0x20)
  • This command is being ignored in secure inclusion mode.
  • Short value 0xFF for on, 0x00 for off
    */
    def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
    return createEvent(name: “switch”, value: cmd.value ? “on” : “off”)
    }

/**

  • COMMAND_CLASS_SWITCH_MULTILEVEL (0x26)
  • Short value
    */
    def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv3.SwitchMultilevelReport cmd) {

}

/**

  • COMMAND_CLASS_METER (0x32)

  • Integer deltaTime Time in seconds since last report

  • Short meterType Unknown = 0, Electric = 1, Gas = 2, Water = 3

  • List meterValue Meter value as an array of bytes

  • Double scaledMeterValue Meter value as a double

  • List previousMeterValue Previous meter value as an array of bytes

  • Double scaledPreviousMeterValue Previous meter value as a double

  • Short size The size of the array for the meterValue and previousMeterValue

  • Short scale The scale of the values: “kWh”=0, “kVAh”=1, “Watts”=2, “pulses”=3, “Volts”=4, “Amps”=5, “Power Factor”=6, “Unknown”=7

  • Short precision The decimal precision of the values

  • Short rateType ???

  • Boolean scale2 ???
    */
    def zwaveEvent(physicalgraph.zwave.commands.meterv3.MeterReport cmd) {
    if (cmd.meterType == 1) {
    def eventList =

    if ("$costPerKwh" == "null") {
        logError "costPerKwh is null, please go through the configuration page first"
        return
    }
    
    if (cmd.scale == 0) {
        logDebug " got kwh $cmd.scaledMeterValue"
    
        BigDecimal costDecimal = ( costPerKwh as BigDecimal )
        def batteryRunTimeHours = getBatteryRuntimeInHours()
        eventList.push(internalCreateEvent([name: "energy", value: cmd.scaledMeterValue, unit: "kWh"]));
        
    	eventList.push(internalCreateEvent([name: "cumulativeEnergyCostTxt", value: getBatteryRuntime()]));
        eventList.push(internalCreateEvent([name: "cumulativeEnergyCostActual", value: String.format("%5.2f", cmd.scaledMeterValue * costDecimal)]));
    	eventList.push(internalCreateEvent([name: "cumulativeEnergyCostDay", value: String.format("%5.2f", cmd.scaledMeterValue / batteryRunTimeHours * costDecimal * 24)]));
        eventList.push(internalCreateEvent([name: "cumulativeEnergyCostWeek", value: String.format("%5.2f", cmd.scaledMeterValue / batteryRunTimeHours * costDecimal * 24 * 7)]));
        eventList.push(internalCreateEvent([name: "cumulativeEnergyCostMonth", value: String.format("%5.2f", cmd.scaledMeterValue / batteryRunTimeHours * costDecimal * 24 * 30.42)]));
        eventList.push(internalCreateEvent([name: "cumulativeEnergyCostYear", value: String.format("%5.2f", cmd.scaledMeterValue / batteryRunTimeHours * costDecimal * 24 * 365)]));
    } else if (cmd.scale == 1) {
        logDebug " got kVAh $cmd.scaledMeterValue"
        eventList.push(internalCreateEvent([name: "energy", value: cmd.scaledMeterValue, unit: "kVAh"]));
    } else if (cmd.scale == 2) {
        logDebug " got wattage $cmd.scaledMeterValue"
        eventList.push(internalCreateEvent([name: "power", value: Math.round(cmd.scaledMeterValue), unit: "W"]));
        BigDecimal costDecimal = ( costPerKwh as BigDecimal )
        eventList.push(internalCreateEvent([name: "currentEnergyCostDay", value: String.format("%5.2f", (cmd.scaledMeterValue / 1000) * 24 * costDecimal)]));
        eventList.push(internalCreateEvent([name: "currentEnergyCostWeek", value: String.format("%5.2f", (cmd.scaledMeterValue / 1000) * 24 * 7 * costDecimal)]));
        eventList.push(internalCreateEvent([name: "currentEnergyCostMonth", value: String.format("%5.2f", (cmd.scaledMeterValue / 1000) * 24 * 30.42 * costDecimal)]));
        eventList.push(internalCreateEvent([name: "currentEnergyCostYear", value: String.format("%5.2f", (cmd.scaledMeterValue / 1000) * 24 * 365 * costDecimal)]));
    } else if (cmd.scale == 4) { // Volts
        logDebug " got voltage $cmd.scaledMeterValue"
        eventList.push(internalCreateEvent([name: "voltage", value: Math.round(cmd.scaledMeterValue), unit: "V"]));
    } else if (cmd.scale == 5) { //amps scale 5 is amps even though not documented
        logDebug " got amperage = $cmd.scaledMeterValue"
        eventList.push(internalCreateEvent([name: "amperage", value: cmd.scaledMeterValue, unit: "A"]));
    } else {
        eventList.push(internalCreateEvent([name: "electric", value: cmd.scaledMeterValue, unit: ["pulses", "V", "A", "R/Z", ""][cmd.scale - 3]]));
    }
    
    return eventList
    

    }
    }

/**

  • COMMAND_CLASS_CONFIGURATION (0x70)
  • List configurationValue
  • Short parameterNumber
  • Short size
    */
    def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
    logTrace “received ConfigurationReport for " + cmd.parameterNumber + " (hex:” + Integer.toHexString(cmd.parameterNumber) + ") cmd: " + cmd
    switch (cmd.parameterNumber) {
    case 0x51:
    logTrace “received device mode event”
    if (cmd.configurationValue[0] == 0) {
    return createEvent(name: “deviceMode”, value: “energy”, displayed: true)
    } else if (cmd.configurationValue[0] == 1) {
    return createEvent(name: “deviceMode”, value: “momentary”, displayed: true)
    } else if (cmd.configurationValue[0] == 2) {
    return createEvent(name: “deviceMode”, value: “nightLight”, displayed: true)
    }
    break;
    case 0x54:
    logTrace “received brightness level event”
    return createEvent(name: “level”, value: cmd.configurationValue[0], displayed: true)
    break;
    }
    }

/**

  • COMMAND_CLASS_HAIL (0x82)

*/
def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
logDebug “Switch button was pressed”
return createEvent(name: “hail”, value: “hail”, descriptionText: “Switch button was pressed”)
}

/**

  • COMMAND_CLASS_VERSION (0x86)

  • Short applicationSubVersion

  • Short applicationVersion

  • Short zWaveLibraryType

  • Short zWaveProtocolSubVersion

  • Short zWaveProtocolVersion
    */
    def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) {
    state.deviceInfo[‘applicationVersion’] = “${cmd.applicationVersion}”
    state.deviceInfo[‘applicationSubVersion’] = “${cmd.applicationSubVersion}”
    state.deviceInfo[‘zWaveLibraryType’] = “${cmd.zWaveLibraryType}”
    state.deviceInfo[‘zWaveProtocolVersion’] = “${cmd.zWaveProtocolVersion}”
    state.deviceInfo[‘zWaveProtocolSubVersion’] = “${cmd.zWaveProtocolSubVersion}”

    return updateDeviceInfo()
    }

/**

  • COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72)
  • Integer manufacturerId
  • Integer productId
  • Integer productTypeId

*/
def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
state.deviceInfo[‘manufacturerId’] = “${cmd.manufacturerId}”
state.deviceInfo[‘manufacturerName’] = “${cmd.manufacturerName}”
state.deviceInfo[‘productId’] = “${cmd.productId}”
state.deviceInfo[‘productTypeId’] = “${cmd.productTypeId}”

return updateDeviceInfo()

}

/**

  • COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72)
  • List deviceIdData
  • Short deviceIdDataFormat
  • Short deviceIdDataLengthIndicator
  • Short deviceIdType

*/
def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) {
logTrace “deviceIdData: ${cmd.deviceIdData}”
logTrace “deviceIdDataFormat: ${cmd.deviceIdDataFormat}”
logTrace “deviceIdDataLengthIndicator:${cmd.deviceIdDataLengthIndicator}”
logTrace “deviceIdType: ${cmd.deviceIdType}”

return updateDeviceInfo()

}

/**

  • COMMAND_CLASS_FIRMWARE_UPDATE_MD_V2 (0x7a)
  • Integer checksum
  • Integer firmwareId
  • Integer manufacturerId

*/
def zwaveEvent(physicalgraph.zwave.commands.firmwareupdatemdv2.FirmwareMdReport cmd) {
state.deviceInfo[‘checksum’] = “${cmd.checksum}”
state.deviceInfo[‘firmwareId’] = “${cmd.firmwareId}”

return updateDeviceInfo()

}

/*******************************************************************************

  • CAPABILITITES *
    ******************************************************************************/

/**

  • configure - Configures the parameters of the device

  • Required for the “Configuration” capability
    */
    def configure() {
    logInfo “configure()”
    if (“$refreshInterval” == “null” || “$minimumChangeWatts” == “null”) {
    logError “Some preferences are null, please go through the configuration page first”
    return
    }

    updateDeviceInfo()

    def switchAllMode = physicalgraph.zwave.commands.switchallv1.SwitchAllSet.MODE_INCLUDED_IN_THE_ALL_ON_ALL_OFF_FUNCTIONALITY
    if (switchAll == “Disabled”) {
    switchAllMode = physicalgraph.zwave.commands.switchallv1.SwitchAllSet.MODE_EXCLUDED_FROM_THE_ALL_ON_ALL_OFF_FUNCTIONALITY
    } else if (switchAll == “Off Enabled”) {
    switchAllMode = physicalgraph.zwave.commands.switchallv1.SwitchAllSet.MODE_EXCLUDED_FROM_THE_ALL_ON_FUNCTIONALITY_BUT_NOT_ALL_OFF
    } else if (switchAll == “On Enabled”) {
    switchAllMode = physicalgraph.zwave.commands.switchallv1.SwitchAllSet.MODE_EXCLUDED_FROM_THE_ALL_OFF_FUNCTIONALITY_BUT_NOT_ALL_ON
    }

    logTrace "forceStateChangeOnReport value: " + forceStateChangeOnReport
    logTrace "switchAll value: " + switchAll

    def reportGroup;
    reportGroup = (“$includeVoltageInReport” == “true” ? 1 : 0)
    reportGroup += (“$includeCurrentInReport” == “true” ? 2 : 0)
    reportGroup += (“$includeWattInReport” == “true” ? 4 : 0)
    reportGroup += (“$includeCurrentUsageInReport” == “true” ? 8 : 0)

    logTrace “setting configuration refresh interval: " + new BigInteger(”$refreshInterval")

    /***************************************************************
    Device specific configuration parameters

    Param Size Default Description


    0x03 (3) 1 0 Current Overload Protection. Load will be closed when the Current overrun (US: 15.5A, other country: 16.2A) and the
    time more than 2 minutes (0=disabled, 1=enabled).
    0x14 (20) 1 0 Configure the output load status after re-power on (0=last status, 1=always on, 2=always off)
    0x21 (33) 4 Set the RGB LED color value for testing. alternate rgb color level ie res,blue,green,red ie 00ffffff
    0x50 (80) 1 0 Enable to send notifications to associated devices in Group 1 when load changes (0=nothing, 1=hail CC, 2=basic CC report)
    0x51 (81) 1 0 mode 0 - energy, 1 - momentary indicator, 2 - night light
    0x53 (83) 3 0 hex value ffffff00 
 only night light mode
    0x54 (84) 1 50 dimmer level 0 -100 (doesn’t work in night light mode)
    0x5A (90) 1 1 Enables/disables parameter 0x5A and 0x5B below
    0x5B (91) 2 25 The value here represents minimum change in wattage (in terms of wattage) for a REPORT to be sent (default 50W, size 2 bytes).
    0x5C (92) 1 5 The value here represents minimum change in wattage (in terms of percentage) for a REPORT to be sent (default 10%, size 1 byte).
    0x65 (101) 4 0x00 00 00 04 Which reports need to send in Report group 1
    0x66 (102) 4 0x00 00 00 08 Which reports need to send in Report group 2
    0x67 (103) 4 0 Which reports need to send in Report group 3
    0x6F (111) 4 0x00 00 02 58 The time interval in seconds for sending Report group 1 (Valid values 0x01-0x7FFFFFFF).
    0x70 (112) 4 0x00 00 02 58 The time interval in seconds for sending Report group 2 (Valid values 0x01-0x7FFFFFFF).
    0x71 (113) 4 0x00 00 02 58 The time interval in seconds for sending Report group 3 (Valid values 0x01-0x7FFFFFFF).
    0xC8 (200) 1 0 Partner ID
    0xFC (252) 1 0 Enable/disable Configuration Locked (0 =disable, 1 =enable).
    0xFE (254) 2 0 Device Tag.
    0xFF (255) 1 N/A Reset to factory default setting
    Configuration Values for parameters 0x65-0x67:
    BYTE | 7 6 5 4 3 2 1 0

    MSB 0 | 0 0 0 0 0 0 0 0
    Val 1 | 0 0 0 0 0 0 0 0
    VAL 2 | 0 0 0 0 0 0 0 0
    LSB 3 | 0 0 0 0 A B C 0
    Bit A - Send Meter REPORT (for kWh) at the group time interval
    Bit B - Send Meter REPORT (for watt) at the group time interval
    Bit C - Automatically send(1) or don’t send(0) Multilevel Sensor Report Command
    ***************************************************************/

    delayBetween([
    formatCommand(zwave.switchAllV1.switchAllSet(mode: switchAllMode)),
    formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x50, size: 1, scaledConfigurationValue: 0)), //Enable to send notifications to associated devices when load changes (0=nothing, 1=hail CC, 2=basic CC report)
    formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x5A, size: 1, scaledConfigurationValue: (“$onlySendReportIfValueChange” == “true” ? 1 : 0))), //Enables parameter 0x5B and 0x5C (0=disabled, 1=enabled)
    formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x5B, size: 2, scaledConfigurationValue: new BigInteger(“$minimumChangeWatts”))), //Minimum change in wattage for a REPORT to be sent (Valid values 0 - 60000)
    formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x5C, size: 1, scaledConfigurationValue: new BigInteger(“$minimumChangePercent”))), //Minimum change in percentage for a REPORT to be sent (Valid values 0 - 100)

        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x65, size: 4, scaledConfigurationValue: reportGroup)),    //Which reports need to send in Report group 1
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x66, size: 4, scaledConfigurationValue: 0)),    //Which reports need to send in Report group 2
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x67, size: 4, scaledConfigurationValue: 0)),    //Which reports need to send in Report group 3
    
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x6F, size: 4, scaledConfigurationValue: new BigInteger("$refreshInterval"))),    // change reporting time
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x70, size: 4, scaledConfigurationValue: new BigInteger(0xFFFFF))),
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x71, size: 4, scaledConfigurationValue: new BigInteger(0xFFFFF))),
    
        formatCommand(zwave.configurationV1.configurationSet(parameterNumber: 0x3, size: 1, scaledConfigurationValue: 0)),      // Current Overload Protection.
    

    ], 200)
    }