Skip to content

Commit

Permalink
222
Browse files Browse the repository at this point in the history
Change-Id: I0f5aa07c6b15581ce3822c8c0512eaae603aa6a7
  • Loading branch information
weihuan1111 committed May 30, 2023
1 parent 74477f7 commit 59c3155
Show file tree
Hide file tree
Showing 24 changed files with 1,789 additions and 417 deletions.
2 changes: 1 addition & 1 deletion huan.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "huan-light1.1",
"name": "huan-light1.3",
"description": light,
"termsOfServiceUrl": "",
"type": "DRIVER"
Expand Down
58 changes: 52 additions & 6 deletions zigbee-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ zigbeeManufacturer:
manufacturer: LUMI
model: lumi.switch.b1laus01
deviceProfileName: basic-switch
- id: "LUMI/lumi.switch.n1acn1"
deviceLabel: Aqara Smart Wall Switch H1 (With Neutral, Single Rocker)
manufacturer: LUMI
model: lumi.switch.n1acn1
deviceProfileName: aqara-switch-power
- id: "LUMI/lumi.switch.n2acn1"
deviceLabel: Aqara Smart Wall Switch H1 (With Neutral, Double Rocker) 1
manufacturer: LUMI
model: lumi.switch.n2acn1
deviceProfileName: aqara-switch-power
- id: "LUMI/lumi.switch.n3acn1"
deviceLabel: Aqara Smart Wall Switch H1 (With Neutral, Triple Rocker) 1
manufacturer: LUMI
model: lumi.switch.n3acn1
deviceProfileName: aqara-switch-power
- id: "LUMI/lumi.switch.n0agl1"
deviceLabel: Aqara Single Switch Module T1 (With Neutral)
manufacturer: LUMI
model: lumi.switch.n0agl1
deviceProfileName: aqara-switch-module
- id: "LUMI/lumi.light.acn004"
deviceLabel: Aqara Smart Dimmer Controller T1 Pro
manufacturer: LUMI
model: lumi.light.acn004
deviceProfileName: aqara-light
# VIMAR
- id: "Vimar/xx592-2-way-smart-switch"
deviceLabel: Vimar 2-way Smart Switch
Expand All @@ -21,7 +46,7 @@ zigbeeManufacturer:
- id: "Vimar/xx595-smart-dimmer-switch"
deviceLabel: Vimar Smart Dimmer Switch
model: "DimmerSwitch_v1.0"
deviceProfileName: on-off-level-no-firmware-update
deviceProfileName: on-off-level-no-firmware-update
- id: "Vimar/xx593-smart-actuator-power"
deviceLabel: Vimar Smart Actuator with Power Metering
model: "Mains_Power_Outlet_v1.0"
Expand Down Expand Up @@ -219,6 +244,11 @@ zigbeeManufacturer:
manufacturer: Sinope Technologies
model: RM3250ZB
deviceProfileName: switch-power-smartplug
- id: "Sinope Switch/RM3500ZB"
deviceLabel: "RM3500ZB Sinope Load Controller"
manufacturer: Sinope Technologies
model: RM3500ZB
deviceProfileName: switch-power-smartplug
- id: "Sinope Dimmer Switch/DM2500ZB"
deviceLabel: "DM2500ZB Sinope Dimmer"
manufacturer: Sinope Technologies
Expand Down Expand Up @@ -844,7 +874,7 @@ zigbeeManufacturer:
model: 3RSP019BZ
deviceProfileName: basic-switch
- id: Third Reality/3RSP02028BZ
deviceLabel: Huan Plug9
deviceLabel: ThirdReality Plug
manufacturer: Third Reality, Inc
model: 3RSP02028BZ
deviceProfileName: switch-power-energy
Expand Down Expand Up @@ -907,7 +937,7 @@ zigbeeManufacturer:
deviceLabel: Samsung Light
manufacturer: Samsung Electronics
model: SAMSUNG-ITM-Z-002
deviceProfileName: rgbw-bulb
deviceProfileName: rgbw-bulb-2700K-5000K
- id: Juno/ABL-LIGHT-Z-201
deviceLabel: Juno Connect
manufacturer: Juno
Expand Down Expand Up @@ -1202,12 +1232,12 @@ zigbeeManufacturer:
deviceLabel: Juno Connect
manufacturer: Samsung Electronics
model: ABL-LIGHT-Z-001
deviceProfileName: color-temp-bulb-2700K-5000K
deviceProfileName: abl-light-z-001-bulb
- id: Juno/ABL-LIGHT-Z-001
deviceLabel: Juno Connect
manufacturer: Juno
model: ABL-LIGHT-Z-001
deviceProfileName: color-temp-bulb-2700K-5000K
deviceProfileName: abl-light-z-001-bulb
- id: Samsung/SAMSUNG-ITM-Z-001
deviceLabel: Samsung Light
manufacturer: Samsung Electronics
Expand Down Expand Up @@ -1979,7 +2009,7 @@ zigbeeManufacturer:
model: E13-N11
deviceProfileName: on-off-level-motion-sensor
- id: "Third Reality/3RSNL02043Z"
deviceLabel: Weihuan
deviceLabel: ThirdReality Test
manufacturer: Third Reality, Inc
model: 3RSNL02043Z
deviceProfileName: on-off-level-motion-sensor
Expand All @@ -1998,6 +2028,22 @@ zigbeeManufacturer:
manufacturer: GE
model: Daylight
deviceProfileName: ge-link-bulb
#ROBB (Sunricher)
- id: "ROBB smarrt/ROB_200-004-0"
manufacturer: ROBB smarrt
model: ROB_200-004-0
deviceLabel: ROBB SMARRT Zigbee dimmer 3-wire
deviceProfileName: on-off-level
- id: "ROBB smarrt/ROB_200-014-0"
manufacturer: ROBB smarrt
model: ROB_200-014-0
deviceLabel: ROBB SMARRT Zigbee rotary dimmer 2-wire
deviceProfileName: light-level-power-energy
- id: "ROBB smarrt/ROB_200-011-0"
manufacturer: ROBB smarrt
model: ROB_200-011-0
deviceLabel: ROBB SMARRT Zigbee dimmer 2-wire
deviceProfileName: light-level-power-energy
zigbeeGeneric:
- id: "genericSwitch"
deviceLabel: Zigbee Switch
Expand Down
19 changes: 19 additions & 0 deletions zigbee-switch/profiles/abl-light-z-001-bulb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: abl-light-z-001-bulb
components:
- id: main
capabilities:
- id: switch
version: 1
- id: switchLevel
version: 1
- id: colorTemperature
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Light
metadata:
mnmn: Samsung Electronics
vid: ABL-LIGHT-Z-001
33 changes: 33 additions & 0 deletions zigbee-switch/profiles/aqara-light.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: aqara-light
components:
- id: main
capabilities:
- id: switch
version: 1
- id: switchLevel
version: 1
config:
values:
- key: "level.value"
range: [1, 100]
- id: colorTemperature
version: 1
config:
values:
- key: "colorTemperature.value"
range: [2700, 6000]
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Light
preferences:
- preferenceId: stse.restorePowerState
explicit: true
- preferenceId: stse.turnOffIndicatorLight
explicit: true
- preferenceId: stse.lightFadeInTimeInSec
explicit: true
- preferenceId: stse.lightFadeOutTimeInSec
explicit: true
17 changes: 17 additions & 0 deletions zigbee-switch/profiles/aqara-switch-child.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: aqara-switch-child
components:
- id: main
capabilities:
- id: switch
version: 1
- id: button
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Switch
preferences:
- preferenceId: stse.changeToWirelessSwitch
explicit: true
26 changes: 26 additions & 0 deletions zigbee-switch/profiles/aqara-switch-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: aqara-switch-module
components:
- id: main
capabilities:
- id: switch
version: 1
- id: powerMeter
version: 1
- id: energyMeter
version: 1
- id: powerConsumptionReport
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Switch
preferences:
- preferenceId: stse.restorePowerState
explicit: true
- preferenceId: stse.electricSwitchType
explicit: true
metadata:
mnmn: SmartThingsCommunity
vid: 0f305a94-72e1-3fb8-af85-24eedff49d19
28 changes: 28 additions & 0 deletions zigbee-switch/profiles/aqara-switch-power.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: aqara-switch-power
components:
- id: main
capabilities:
- id: switch
version: 1
- id: button
version: 1
- id: powerMeter
version: 1
- id: energyMeter
version: 1
- id: powerConsumptionReport
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Switch
preferences:
- preferenceId: stse.restorePowerState
explicit: true
- preferenceId: stse.changeToWirelessSwitch
explicit: true
metadata:
mnmn: SmartThingsCommunity
vid: d3530dd0-6a53-370b-9b4f-36ac09f99a38
22 changes: 22 additions & 0 deletions zigbee-switch/profiles/light-level-power-energy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: light-level-power-energy
components:
- id: main
capabilities:
- id: switch
version: 1
- id: switchLevel
version: 1
config:
values:
- key: "level.value"
range: [1, 100]
- id: powerMeter
version: 1
- id: energyMeter
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Light
55 changes: 55 additions & 0 deletions zigbee-switch/src/aqara-light/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
local clusters = require "st.zigbee.zcl.clusters"
local cluster_base = require "st.zigbee.cluster_base"
local data_types = require "st.zigbee.data_types"

local OnOff = clusters.OnOff
local Level = clusters.Level
local ColorControl = clusters.ColorControl

local PRIVATE_CLUSTER_ID = 0xFCC0
local PRIVATE_ATTRIBUTE_ID = 0x0009
local MFG_CODE = 0x115F

local FINGERPRINTS = {
{ mfr = "LUMI", model = "lumi.light.acn004" }
}

local function is_aqara_products(opts, driver, device)
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

local function do_refresh(self, device)
device:send(OnOff.attributes.OnOff:read(device))
device:send(Level.attributes.CurrentLevel:read(device))
device:send(ColorControl.attributes.ColorTemperatureMireds:read(device))
end

local function do_configure(self, device)
device:send(ColorControl.commands.MoveToColorTemperature(device, 200, 0x0000))
device:configure()
do_refresh(self, device)
end

local function device_added(driver, device, event)
device:send(cluster_base.write_manufacturer_specific_attribute(device,
PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1)) -- private

device:send(Level.attributes.OnTransitionTime:write(device, 0))
device:send(Level.attributes.OffTransitionTime:write(device, 0))
end

local aqara_light_handler = {
NAME = "Aqara Light Handler",
lifecycle_handlers = {
added = device_added,
doConfigure = do_configure
},
can_handle = is_aqara_products
}

return aqara_light_handler
60 changes: 0 additions & 60 deletions zigbee-switch/src/aqara/aqara_version/init.lua

This file was deleted.

Loading

0 comments on commit 59c3155

Please sign in to comment.