7
7
from zigpy .quirks import CustomCluster
8
8
from zigpy .zcl import foundation
9
9
from zigpy .zcl .clusters .closures import WindowCovering
10
- from zigpy .zcl .clusters .general import Basic
10
+ from zigpy .zcl .clusters .general import Basic , OnOff
11
+ from zigpy .zcl .clusters .lighting import Ballast
11
12
from zigpy .zcl .foundation import BaseAttributeDefs , ZCLAttributeDef
12
13
13
14
SE_MANUF_NAME = "Schneider Electric"
@@ -20,46 +21,157 @@ class SEBasic(CustomCluster, Basic):
20
21
class AttributeDefs (Basic .AttributeDefs ):
21
22
"""Attribute definitions."""
22
23
23
- se_sw_build_id : Final = ZCLAttributeDef (
24
+ # The Application FW Version attribute specifies the firmware version of the application. The format of this
25
+ # attribute is XXX.YYY.ZZZ V.
26
+ # XXX = major version
27
+ # YYY = minor version
28
+ # ZZZ = patch version
29
+ # V = Build Type (One of the following: D = Development version, T0, T1 = Verification version, V = Validation
30
+ # version, R = Official Release version).
31
+ se_application_fw_version : Final = ZCLAttributeDef (
24
32
id = 0xE001 ,
25
33
type = t .CharacterString ,
26
34
is_manufacturer_specific = True ,
27
- ) # value: "002.004.016 R"
28
- unknown_attribute_57346 : Final = ZCLAttributeDef (
35
+ )
36
+ # The Application HWVersion attribute specifies the hardware version of the application design in format
37
+ # AAA.BBB.CCC. Meaning:
38
+ # AAA - major version
39
+ # BBB - minor version
40
+ # CCC - patch version
41
+ # If version is 000.000.000, HW version is not available.
42
+ se_application_hw_version : Final = ZCLAttributeDef (
29
43
id = 0xE002 ,
30
44
type = t .CharacterString ,
31
45
is_manufacturer_specific = True ,
32
- ) # value: "001.000.000"
33
- unknown_attribute_57348 : Final = ZCLAttributeDef (
46
+ )
47
+ # Device serial number. Hexadecimal string of 15 chars length.
48
+ se_device_serial_number : Final = ZCLAttributeDef (
34
49
id = 0xE004 ,
35
50
type = t .CharacterString ,
36
51
is_manufacturer_specific = True ,
37
- ) # value: "213249FEFF5ECFD"
38
- unknown_attribute_57351 : Final = ZCLAttributeDef (
52
+ )
53
+ # The ProductIdentifier attribute specifies the unique internal numerical identifier of the product. See device
54
+ # description for this value.
55
+ se_product_identifier : Final = ZCLAttributeDef (
39
56
id = 0xE007 ,
40
57
type = t .enum16 ,
41
58
is_manufacturer_specific = True ,
42
59
)
43
- se_device_type : Final = ZCLAttributeDef (
60
+ # The ProductRange attribute specifies the name of the range to which the product belongs.
61
+ se_product_range : Final = ZCLAttributeDef (
44
62
id = 0xE008 ,
45
63
type = t .CharacterString ,
46
64
is_manufacturer_specific = True ,
47
- ) # value: "Wiser Light"
48
- se_model : Final = ZCLAttributeDef (
65
+ )
66
+ # The ProductModel attribute specifies the name of the product model. Same value as model identifier attribute
67
+ # 0x0005.
68
+ se_product_model : Final = ZCLAttributeDef (
49
69
id = 0xE009 ,
50
70
type = t .CharacterString ,
51
71
is_manufacturer_specific = True ,
52
- ) # value: "NHPB/SHUTTER/1"
53
- se_realm : Final = ZCLAttributeDef (
72
+ )
73
+ # The ProductFamily attribute specifies the name of the family to which the product belongs.
74
+ se_product_family : Final = ZCLAttributeDef (
54
75
id = 0xE00A ,
55
76
type = t .CharacterString ,
56
77
is_manufacturer_specific = True ,
57
- ) # value: "Wiser Home"
58
- unknown_attribute_57355 : Final = ZCLAttributeDef (
78
+ )
79
+ # VendorURL, value: "http://www.schneider-electric.com"
80
+ se_vendor_url : Final = ZCLAttributeDef (
59
81
id = 0xE00B ,
60
82
type = t .CharacterString ,
61
83
is_manufacturer_specific = True ,
62
- ) # value: "http://www.schneider-electric.com"
84
+ )
85
+
86
+
87
+ class SEOnTimeReloadOptions (t .bitmap8 ):
88
+ """Valid values for the SE OnTimeReloadOptions attr"""
89
+
90
+ # OnTimeReload timer can be canceled by receiving OFF command -> light is going OFF immediately.
91
+ # If this bit is not set, the timer can not be canceled, it is always restarted.
92
+ OnTimeReloadCanceledByOffCommand = 0x1
93
+
94
+ # Impulse mode active. Whenever output should be switched ON, it will be switched ON only for 200msec.
95
+ # OnTimeReload attributes is ignored, also bit0 inside this attribute has no sense. If this bit is not set,
96
+ # impulse mode is disabled.
97
+ ImpulseMode = 0x2
98
+
99
+
100
+ class SEOnOff (CustomCluster , OnOff ):
101
+ """Schneider Electric manufacturer specific OnOff cluster."""
102
+
103
+ class AttributeDefs (OnOff .AttributeDefs ):
104
+ """Attribute definitions."""
105
+
106
+ # Has meaning only if attribute OnTimeReload is not 0. Defines number of seconds before the light is switched
107
+ # off automatically when the user is somehow inform the light will be switched off automatically. Value 0 or
108
+ # 0xFFFF disables pre-warning. For switch is just short switch OFF and ON, for dimmer device goes to 60
109
+ # percent and starts slowly dim down. During this time user can reload the time and postpone automatic switch
110
+ # off for time defined in OnTimeReload. If you enter value greater than 6553, after reboot you will read again
111
+ # value 6553. If you enter 0xFFFF, functionality will be disabled.
112
+ se_pre_warning_time : Final = ZCLAttributeDef (
113
+ id = 0xE000 ,
114
+ type = t .uint16_t ,
115
+ is_manufacturer_specific = True ,
116
+ )
117
+
118
+ # Defines number of seconds before the light is switched off automatically. Time is in seconds.
119
+ # Value 0 disable the functionality. When brightness is changed, or ON command is received, timer is always
120
+ # restarted. Check OnTimeReloadOptions for possible impulse mode (if attribute is implemented).
121
+ se_on_time_reload : Final = ZCLAttributeDef (
122
+ id = 0xE001 ,
123
+ type = t .uint32_t ,
124
+ is_manufacturer_specific = True ,
125
+ )
126
+
127
+ se_on_time_reload_options : Final = ZCLAttributeDef (
128
+ id = 0xE002 ,
129
+ type = SEOnTimeReloadOptions ,
130
+ is_manufacturer_specific = True ,
131
+ )
132
+
133
+
134
+ class SEControlMode (t .enum8 ):
135
+ """Dimming mode for PUCK/DIMMER/* and NHROTARY/DIMMER/1."""
136
+
137
+ Auto = 0
138
+ RC = 1
139
+ RL = 2
140
+ RL_LED = 3
141
+
142
+
143
+ class SEWiringMode (t .enum8 ):
144
+ """Dimmer wiring mode. Default value depends on how the dimmer is connected to the mains."""
145
+
146
+ TwoWiredMode = 0
147
+ ThreeWiredMode = 1
148
+
149
+
150
+ class SEDimmingCurve (t .enum8 ):
151
+ """Dimmer dimming curve"""
152
+
153
+ Logarithmic = 0
154
+ Linear = 1 # Not supported in current FW, but defined in the spec
155
+ Exponential = 2 # Not supported in current FW, but defined in the spec
156
+
157
+
158
+ class SEBallast (CustomCluster , Ballast ):
159
+ """Schneider Electric Ballast cluster."""
160
+
161
+ manufacturer_id_override = SE_MANUF_ID
162
+
163
+ class AttributeDefs (Ballast .AttributeDefs ):
164
+ """Attribute definitions."""
165
+
166
+ se_control_mode : Final = ZCLAttributeDef (
167
+ id = 0xE000 , type = SEControlMode , is_manufacturer_specific = True
168
+ )
169
+ se_wiring_mode : Final = ZCLAttributeDef (
170
+ id = 0xE002 , type = t .enum8 , is_manufacturer_specific = True
171
+ )
172
+ se_dimming_curve : Final = ZCLAttributeDef (
173
+ id = 0xE002 , type = t .enum8 , is_manufacturer_specific = True
174
+ )
63
175
64
176
65
177
class SEWindowCovering (CustomCluster , WindowCovering ):
@@ -138,17 +250,57 @@ async def command(
138
250
return await super ().command (command_id , * args , ** kwargs )
139
251
140
252
141
- class SELedIndicatorSignals (t .enum8 ):
253
+ class SESwitchIndication (t .enum8 ):
142
254
"""Available LED indicator signal combinations.
143
255
144
256
Shutter movement can be indicated with a red LED signal. A green LED
145
257
light permanently provides orientation, if desired.
146
258
"""
147
259
148
- MOVEMENT_ONLY = 0x00
149
- MOVEMENT_AND_ORIENTATION = 0x01
150
- ORIENTATION_ONLY = 0x02
151
- NONE = 0x03
260
+ # For lights: LED is on when load is on. For shutter controllers: red LED is on while shutter is moving.
261
+ FollowsLoad = 0x00
262
+ # For lights: LED is always on. For shutter controllers: red LED is on while shutter is moving, green LED indicates
263
+ # direction.
264
+ AlwaysOn = 0x01
265
+ # For lights: LED is on when load is off. For shutter controllers: red LED is never on, green LED indicates
266
+ # direction.
267
+ InverseOfLoad = 0x02
268
+ # LED(s) are always off.
269
+ AlwaysOff = 0x03
270
+
271
+
272
+ class SESwitchAction (t .enum8 ):
273
+ # Behave like a light switch (Up = On, Down = Off)
274
+ Light = 0x00
275
+ # Behave like an inverted light switch (Up = Off, Down = On)
276
+ LightOpposite = 0xFE
277
+ # Behave like a dimmer (Up/rotate right = on and/or dim up, Down/rotate left = off and/or dim down)
278
+ Dimmer = 0x01
279
+ # Behave like an inverted dimmer (Up/rotate right = off and/or dim down, Down/rotate left = on and/or dim up)
280
+ DimmerOpposite = 0xFD
281
+ # Behave like a standard shutter controller (up/rotate right = move shutter up, down/rotate left = move shutter
282
+ # down, short press to stop movement)
283
+ StandardShutter = 0x02
284
+ # Behave like an inverted standard shutter controller (up/rotate right = move shutter down, down/rotate left = move
285
+ # shutter up, short press to stop movement)
286
+ StandardShutterOpposite = 0xFC
287
+ # Behave like a Schneider shutter controller using SE custom Window Covering cluster (up/rotate right = move
288
+ # shutter up, down/rotate left = move shutter down, short press to stop movement)
289
+ SchneiderShutter = 0x03
290
+ # Behave like an inverted Schneider shutter controller using SE custom Window Covering cluster (up/rotate right =
291
+ # move shutter down, down/rotate left = move shutter up, short press to stop movement)
292
+ SchneiderShutterOpposite = 0xFB
293
+ # Recall scenes according to the Up/DownSceneID attributes, and group using the Up/DownGroupID attributes.
294
+ Scene = 0x04
295
+ # No observable function?
296
+ ToggleLight = 0x05
297
+ # No observable function?
298
+ ToggleDimmer = 0x06
299
+ # No observable function?
300
+ AlternateLight = 0x07
301
+ # No observable function?
302
+ AlternateDimmer = 0x08
303
+ NotUsed = 0x7F
152
304
153
305
154
306
class SESpecific (CustomCluster ):
@@ -161,37 +313,50 @@ class SESpecific(CustomCluster):
161
313
class AttributeDefs (BaseAttributeDefs ):
162
314
"""Attribute definitions."""
163
315
164
- led_indicator_signals : Final = ZCLAttributeDef (
316
+ se_switch_indication : Final = ZCLAttributeDef (
165
317
id = 0x0000 ,
166
- type = SELedIndicatorSignals ,
318
+ type = SESwitchIndication ,
167
319
is_manufacturer_specific = True ,
168
320
)
169
- unknown_attribute_1 : Final = ZCLAttributeDef (
321
+ # Default values depends on endpoint and device type. More info you find in device description.
322
+ se_switch_actions : Final = ZCLAttributeDef (
170
323
id = 0x0001 ,
171
- type = t . enum8 ,
324
+ type = SESwitchAction ,
172
325
is_manufacturer_specific = True ,
173
326
)
174
- unknown_attribute_16 : Final = ZCLAttributeDef (
327
+ # The UpSceneID attribute represents the Scene Id field value of any Scene command cluster transmitted by the
328
+ # device when user activates is rocker up side according to the rocker configuration. See SwitchActions
329
+ # attribute.
330
+ se_up_scene_id : Final = ZCLAttributeDef (
175
331
id = 0x0010 ,
176
332
type = t .uint8_t ,
177
333
is_manufacturer_specific = True ,
178
334
)
179
- unknown_attribute_17 : Final = ZCLAttributeDef (
335
+ # The UpGroupID attribute represents the Group Id field value of any Scene command cluster transmitted by the
336
+ # device when user activates is rocker up side according to the rocker configuration. Value greater than 0xFFF7
337
+ # means, no command is sent. See SwitchActions attribute.
338
+ se_up_group_id : Final = ZCLAttributeDef (
180
339
id = 0x0011 ,
181
340
type = t .uint16_t ,
182
341
is_manufacturer_specific = True ,
183
342
)
184
- unknown_attribute_32 : Final = ZCLAttributeDef (
343
+ # The DownSceneID attribute represents the Scene Id field value of any Scene command cluster transmitted by the
344
+ # device when user activates is rocker down side according to the rocker configuration. See SwitchActions
345
+ # attribute.
346
+ se_down_scene_id : Final = ZCLAttributeDef (
185
347
id = 0x0020 ,
186
348
type = t .uint8_t ,
187
349
is_manufacturer_specific = True ,
188
350
)
189
- unknown_attribute_33 : Final = ZCLAttributeDef (
351
+ # The DownGroupID attribute represents the Group Id field value of any Scene command cluster transmitted by the
352
+ # device when user activates is rocker down side according to the rocker configuration. Value greater than
353
+ # 0xFFF7 means, no command is sent. See SwitchActions attribute.
354
+ se_down_group_id : Final = ZCLAttributeDef (
190
355
id = 0x0021 ,
191
356
type = t .uint16_t ,
192
357
is_manufacturer_specific = True ,
193
358
)
194
- unknown_attribute_65533 : Final = ZCLAttributeDef (
359
+ se_cluster_revision : Final = ZCLAttributeDef (
195
360
id = 0xFFFD ,
196
361
type = t .uint16_t ,
197
362
is_manufacturer_specific = True ,
0 commit comments