Control US/CA 3A Smart ZigBee 3.0 Plug / Outlet with SmartThings


#1

The US/CA version 3A Smart ZigBee Plug / Outlet works with SmartThings Hub. People can easily make it as following:

  1. Reset the socket: Plug the socket in a power point and keep pressing the reset button about 10 seconds until the led flashing and turn to red color.

  2. Log in to SmartThings Developer Tools https://account.smartthings.com

  3. Click Locations. Then in the table select the (hub name). Then click on the “Hubs . (hub name)”
    Ensure Zigbee: “OTA enabled for all non-light devices” and “Unsecure rejoin: true”. If this is not the case click “View Utilities” and edit ZigBee Utilities appropriately.

  4. Open the SmartThings APP and click “Add a Thing” button to start searching New Devices.

If APP failed to find the smart socket, click the “Add a Thing” to search again, then press the socket Reset button to pair with the SmartThings hub.

From the APP, you will see the smart socket is added in as a “Thing”.

  1. Edit the device “Thing” from API
    – Name : 3A Smart Plug or what you want
    – Type: ZigBee Switch
    – Version: Published

  2. Go back your mobile phone and open the SmartThings APP to control the smart zigbee plug / outlet .

Note:

  1. If you could not find the ZigBee Switch Power from the Type List, create a device handler as following and select the Type - 3A Nue ZigBee ZLL Socket, Version: self-Published;
  2. If you get the err when copying and pasting the code below, please feel free send a msg to 3aSmartHome@gmail.com for a copy of the Device Handler.

******************* Instruction on creating a device Handler************
Create a device handler by clicking on My Device Handlers and on the next page the +Create New Device Handler button. On the next page click on tab From code. Paste the code below. Then click the Save button. Then click the Publish button. Select For me.

/** Please copy the Device Handler from this line

  • Copyright 2015 SmartThings
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.
  • Updated by Kevin X from 3A Smart Home on 23/05/2018

*/

metadata {
definition (name: “3A Nue ZigBee ZLL Socket”, namespace: “smartthings”, author: “SmartThings”) {
capability “Actuator”
capability “Configuration”
capability “Refresh”
capability “Switch”
capability “Health Check”

    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15S", deviceJoinName: "Leviton Lumina RF Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1GKJ1.7", deviceJoinName: "Nue ZigBee Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FNB56-SKT19FB1.2", deviceJoinName: "Nue ZigBee Socket"
}

// simulator metadata
simulator {
    // status messages
    status "on": "on/off: 1"
    status "off": "on/off: 0"

    // reply messages
    reply "zcl on-off on": "on/off: 1"
    reply "zcl on-off off": "on/off: 0"
}

tiles(scale: 2) {
    multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
        tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
            attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
            attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
            attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
            attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
        }
    }
    standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
    }
    main "switch"
    details(["switch", "refresh"])
}

}

// Parse incoming device messages to generate events
def parse(String description) {
log.debug “description is $description”
def event = zigbee.getEvent(description)
if (event) {
sendEvent(event)
}
else {
log.warn “DID NOT PARSE MESSAGE for description : $description”
log.debug zigbee.parseDescriptionAsMap(description)
}
}

def off() {
device.endpointId =“0B”
zigbee.off()
}

def on() {
device.endpointId =“0B”
zigbee.on()
}

/**

  • PING is used by Device-Watch in attempt to reach the Device
  • */
    def ping() {
    return refresh()
    }

def refresh() {
zigbee.onOffRefresh() + zigbee.onOffConfig()
}

def configure() {
// Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time)
sendEvent(name: “checkInterval”, value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID])
log.debug “Configuring Reporting and Bindings.”
zigbee.onOffRefresh() + zigbee.onOffConfig()
}

//Please copy the Device Handler end this line


(Mark) #2

Your company seems to be based in Australia. Do you sell devices through US retail channels?

Several of the devices on your website look like rebranded Chinese devices that can be ordered direct from China on gearbest or aliexpress. I guess if the devices you’re selling are zigbee 3.0 that’s notable, but SmartThings doesn’t support zigbee 3.0 anyway.

FYI, you should consider not instructing people to login to the IDE through this link. Thats only one of several ST cloud “shards” and it won’t work for everyone. The correct link is https://account.smartthings.com.

Lastly, why instruct users to install your custom device handler after pairing the device to the ST hub? If one were to install the device handler first, and then pair, the hub would be more likely to identify the device correctly without needing to change the handler in the IDE.


#3
  1. Our company is based on Australia and have a factory in China.

  2. We just start selling on Amazon USA. Below is the item.


#4

Thanks Mark. I have updated the instruction on your comments.


(Super Mouse Dv) #5

I just got mine and I get this error with your code.

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_6001f5bb_69a7_4841_a55e_aee25291cc3d: 14: unexpected token: ZLL @ line 14, column 27. definition (name: “ZigBee ZLL Socket”, namespace: “smartthings”, author: “SmartThings”, ocfDeviceType: “oic.d.switch”) { ^ 1 error

any idea what i did wrong. Mind you I have been using Smartthings for nearly a year now and Im very familiar in putting in Device handlers ect. Since I have 2 ceiling fans and nearly every one of my switches set up with smart things. please help… Thanks

Hal


#6

It is possible that your system has got a Device Handler with the name " ZigBee ZLL Socket" . I have rename the script name “3A Nue ZigBee ZLL Socket” and device type to “3A Nue ZigBee ZLL Socket” . Can you have a try again?


(Super Mouse Dv) #7

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_67c3e844_1bd1_4284_9f75_6e9f92a65711: 21: unexpected token: ZLL @ line 21, column 27. definition (name: “ZigBee ZLL Socket”, namespace: “smartthings”, author: “SmartThings”, ocfDeviceType: “oic.d.switch”) { ^ 1 error


#8

Please remove the previous code and copy and paste the code below.

/** Please copy the Device Handler from this line

  • Copyright 2015 SmartThings
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.
  • Updated by Kevin X from 3A Smart Home on 23/05/2018

*/

metadata {
definition (name: “3A Nue ZigBee ZLL Socket”, namespace: “smartthings”, author: “SmartThings”) {
capability “Actuator”
capability “Configuration”
capability “Refresh”
capability “Switch”
capability “Health Check”

    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15S", deviceJoinName: "Leviton Lumina RF Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1GKJ1.7", deviceJoinName: "Nue ZigBee Switch"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FNB56-SKT19FB1.2", deviceJoinName: "Nue ZigBee Socket"
}

// simulator metadata
simulator {
    // status messages
    status "on": "on/off: 1"
    status "off": "on/off: 0"

    // reply messages
    reply "zcl on-off on": "on/off: 1"
    reply "zcl on-off off": "on/off: 0"
}

tiles(scale: 2) {
    multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
        tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
            attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
            attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
            attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
            attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
        }
    }
    standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
    }
    main "switch"
    details(["switch", "refresh"])
}

}

// Parse incoming device messages to generate events
def parse(String description) {
log.debug “description is $description”
def event = zigbee.getEvent(description)
if (event) {
sendEvent(event)
}
else {
log.warn “DID NOT PARSE MESSAGE for description : $description”
log.debug zigbee.parseDescriptionAsMap(description)
}
}

def off() {
device.endpointId =“0B”
zigbee.off()
}

def on() {
device.endpointId =“0B”
zigbee.on()
}

/**

  • PING is used by Device-Watch in attempt to reach the Device
  • */
    def ping() {
    return refresh()
    }

def refresh() {
zigbee.onOffRefresh() + zigbee.onOffConfig()
}

def configure() {
// Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time)
sendEvent(name: “checkInterval”, value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID])
log.debug “Configuring Reporting and Bindings.”
zigbee.onOffRefresh() + zigbee.onOffConfig()
}

//Please copy the Device Handler end this line


(Super Mouse Dv) #9

Error this one caused. im digging into my device handlers to find conflict

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_d2cd05bd_1083_4389_b4dc_9c6c4bc94292: 14: unexpected token: Nue @ line 14, column 23. definition (name: “3A Nue ZigBee ZLL Socket”, namespace: “smartthings”, author: “SmartThings”) { ^ 1 error


(Super Mouse Dv) #10

and furthermore thanks for being cool and helpful… I really like this outlet just want to see what it can do :slight_smile:


(Super Mouse Dv) #11

Didnt find the Zigbee ZLL
Here are all my Device handlers I currently Use.

a4refillpad : Xiaomi Aqara Temperature Humidity Sensor
a4refillpad : Xiaomi Door/Window Sensor
a4refillpad : Xiaomi Motion Sensor
a4refillpad : Xiaomi Temperature Humidity Sensor
a4refillpad : Xiaomi Zigbee Button
a4refillpad : Xiaomi Zigbee Outlet
Aqara Wall Switch Binder 1.1
bspranger : Xiaomi Aqara Temperature Humidity Sensor bspranger
bspranger : xiaomi-zigbee-button bspranger
dcoffing : KOF Zigbee Fan Controller
dcoffing : KOF Zigbee Fan Controller - Fan Speed Child Device
dcoffing : KOF Zigbee Fan Controller - Light Child Device
erocm123 : Enerwave RSM2 Dual Relay Switch
erocm123 : Simulated Dimmer
erocm123 : Simulated Energy Switch
erocm123 : Simulated Switch
pstuart : Generic Video Camera
schwark : Alarm.com Switch
simic : Aqara 2 Button Wired Wall Switch
simic : Aqara 2 Button Wired Wall Switch1.1
skp19 : Foscam Universal Device
skp19 : Foscam Universal Device
terk : Xiaomi Zigbee Aqara Button AQ2
uncleskippy : HI3510 IP Camera Device
Z-Wave.me : Secure Wall Controllers & Key Fobs (Z-Wave.me, Popp & Devolo)


(Super Mouse Dv) #12

Update When I tried to change the type on the device… It showed up a group
of ZLL devices… I do not recognize them as they are mostly for RGB bulbs


#13

You need to create a new device handler by copying the code from this topic.


(Super Mouse Dv) #14

I have tried to make a new Device handler with your 2 codes. And it gave me those errors and would not let me save. I did find All Devices and I tried the ZLL RGB Bulb device handler and it works now…


#15

Thanks for letting me know. I will try it as well.


(Super Mouse Dv) #16

cool… Hopefully you can come up with a stable one or one of the stock ones work :slight_smile:


(Jonas Karlsson) #17

I just bought these, and similarly, the code above gave the same exact errors when trying to “save”.

However the basic “ZigBee Switch” worked just fine.


#18

Thanks for letting me know. It is very strange for clients always getting err when copying and pasting the code from SmartThings Community.


#19

Please just select the Type-ZigBee Switch. If not working, just send a msg to 3aSmartHome@gmail for a copy of the Device Handler.


(Super Mouse Dv) #20

That worked for me thank you… Knowing this now I think I Will be buying a few more in the near future :slight_smile: Gotta get ready for the christmas tree :slight_smile: