Skip to content

Commit da4e8ea

Browse files
WWSTCERT-9438 Add frient io module driver (#2600)
* initial commit * test changes * add register_native_switch_handler * tests WIP * working tests * get rid of unused variables * test * additional test * Revert changes and add can_handle file * fixed test * capabilities fix * Changes according to pr comments * changes according to pr comments * Shortened Copyright statement
1 parent 52ab8d3 commit da4e8ea

File tree

9 files changed

+1467
-1
lines changed

9 files changed

+1467
-1
lines changed

drivers/SmartThings/zigbee-switch/fingerprints.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ zigbeeManufacturer:
505505
manufacturer: frient A/S
506506
model: SMRZB-342
507507
deviceProfileName: frient-switch-power-energy-voltage
508+
- id: "frient/IOMZB-110"
509+
deviceLabel: frient IO Module
510+
manufacturer: frient A/S
511+
model: IOMZB-110
512+
deviceProfileName: switch-4inputs-2outputs
508513
- id: "AduroSmart Eria/AD-DimmableLight3001"
509514
deviceLabel: Eria Light
510515
manufacturer: AduroSmart Eria
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: frient-io-output-switch
2+
components:
3+
- id: main
4+
capabilities:
5+
- id: switch
6+
version: 1
7+
- id: refresh
8+
version: 1
9+
preferences:
10+
- title: "Output: On Time"
11+
name: configOnTime
12+
required: true
13+
preferenceType: integer
14+
definition:
15+
minimum: 0
16+
maximum: 6553
17+
default: 0
18+
- title: "Output: Off Wait Time"
19+
name: configOffWaitTime
20+
required: true
21+
preferenceType: integer
22+
definition:
23+
minimum: 0
24+
maximum: 6553
25+
default: 0
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: switch-4inputs-2outputs
2+
components:
3+
- id: main
4+
capabilities:
5+
- id: firmwareUpdate
6+
version: 1
7+
- id: refresh
8+
version: 1
9+
categories:
10+
- name: Switch
11+
- id: input1
12+
label: "Input 1"
13+
capabilities:
14+
- id: switch
15+
version: 1
16+
- id: input2
17+
label: "Input 2"
18+
capabilities:
19+
- id: switch
20+
version: 1
21+
- id: input3
22+
label: "Input 3"
23+
capabilities:
24+
- id: switch
25+
version: 1
26+
- id: input4
27+
label: "Input 4"
28+
capabilities:
29+
- id: switch
30+
version: 1
31+
preferences:
32+
# Input 1
33+
- title: "Input 1: Reverse Polarity"
34+
name: reversePolarity1
35+
required: true
36+
preferenceType: boolean
37+
definition:
38+
default: false
39+
- title: "Input 1: Control Output 1"
40+
name: controlOutput11
41+
required: true
42+
preferenceType: boolean
43+
definition:
44+
default: false
45+
- title: "Input 1: Control Output 2"
46+
name: controlOutput21
47+
required: true
48+
preferenceType: boolean
49+
definition:
50+
default: false
51+
# Input 2
52+
- title: "Input 2: Reverse Polarity"
53+
name: reversePolarity2
54+
required: true
55+
preferenceType: boolean
56+
definition:
57+
default: false
58+
- title: "Input 2: Control Output 1"
59+
name: controlOutput12
60+
required: true
61+
preferenceType: boolean
62+
definition:
63+
default: false
64+
- title: "Input 2: Control Output 2"
65+
name: controlOutput22
66+
required: true
67+
preferenceType: boolean
68+
definition:
69+
default: false
70+
# Input 3
71+
- title: "Input 3: Reverse Polarity"
72+
name: reversePolarity3
73+
required: true
74+
preferenceType: boolean
75+
definition:
76+
default: false
77+
- title: "Input 3: Control Output 1"
78+
name: controlOutput13
79+
required: true
80+
preferenceType: boolean
81+
definition:
82+
default: false
83+
- title: "Input 3: Control Output 2"
84+
name: controlOutput23
85+
required: true
86+
preferenceType: boolean
87+
definition:
88+
default: false
89+
# Input 4
90+
- title: "Input 4: Reverse Polarity"
91+
name: reversePolarity4
92+
required: true
93+
preferenceType: boolean
94+
definition:
95+
default: false
96+
- title: "Input 4: Control Output 1"
97+
name: controlOutput14
98+
required: true
99+
preferenceType: boolean
100+
definition:
101+
default: false
102+
- title: "Input 4: Control Output 2"
103+
name: controlOutput24
104+
required: true
105+
preferenceType: boolean
106+
definition:
107+
default: false

drivers/SmartThings/zigbee-switch/src/configurations/devices.lua

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ local IASZone = clusters.IASZone
77
local ElectricalMeasurement = clusters.ElectricalMeasurement
88
local SimpleMetering = clusters.SimpleMetering
99
local Alarms = clusters.Alarms
10+
local BasicInput = clusters.BasicInput
11+
local OnOff = clusters.OnOff
1012
local constants = require "st.zigbee.constants"
13+
local data_types = require "st.zigbee.data_types"
1114

1215
local devices = {
1316
IKEA_RGB_BULB = {
@@ -110,6 +113,64 @@ local devices = {
110113
},
111114
}
112115
},
116+
FRIENT_IO_MODULE = {
117+
FINGERPRINTS = {
118+
{ mfr = "frient A/S", model = "IOMZB-110" }
119+
},
120+
CONFIGURATION = {
121+
{
122+
cluster = OnOff.ID,
123+
attribute = OnOff.attributes.OnTime.ID,
124+
minimum_interval = 10,
125+
maximum_interval = 600,
126+
reportable_change = 1,
127+
data_type = OnOff.attributes.OnOff.base_type,
128+
configurable = true,
129+
monitored = true
130+
},
131+
{
132+
cluster = OnOff.ID,
133+
attribute = OnOff.attributes.OffWaitTime.ID,
134+
minimum_interval = 10,
135+
maximum_interval = 600,
136+
reportable_change = 1,
137+
data_type = OnOff.attributes.OffWaitTime.base_type,
138+
configurable = true,
139+
monitored = true
140+
},
141+
{
142+
cluster = BasicInput.ID,
143+
attribute = BasicInput.attributes.PresentValue.ID,
144+
minimum_interval = 10,
145+
maximum_interval = 600,
146+
reportable_change = 0,
147+
data_type = BasicInput.attributes.PresentValue.base_type,
148+
configurable = true,
149+
monitored = true
150+
},
151+
{
152+
cluster = BasicInput.ID,
153+
attribute = BasicInput.attributes.Polarity.ID,
154+
minimum_interval = 10,
155+
maximum_interval = 600,
156+
reportable_change = 0,
157+
data_type = BasicInput.attributes.Polarity.base_type,
158+
configurable = true,
159+
monitored = true
160+
},
161+
{
162+
cluster = BasicInput.ID,
163+
attribute = 0x8000, -- IASActivation
164+
minimum_interval = 10,
165+
maximum_interval = 600,
166+
reportable_change = 0,
167+
data_type = data_types.Uint16,
168+
mfg_code = 0x1015,
169+
configurable = true,
170+
monitored = true
171+
}
172+
}
173+
}
113174
}
114175

115176
return devices
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Copyright 2025 SmartThings, Inc.
2+
-- Licensed under the Apache License, Version 2.0
3+
4+
-- Function to determine if the driver can handle this device
5+
return function(opts, driver, device, ...)
6+
if device:get_manufacturer() == "frient A/S" and device:get_model() == "IOMZB-110" then
7+
local subdriver = require("frient-IO")
8+
return true, subdriver
9+
else
10+
return false
11+
end
12+
end

0 commit comments

Comments
 (0)