Skip to content

Commit d6c71da

Browse files
authored
Merge pull request #1631 from vturekhanov/S60ZBTPF
Add initial support for Sonoff S60ZBTPF
2 parents f758fb8 + d0de247 commit d6c71da

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

custom_components/xiaomi_gateway3/core/converters/zigbee.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def encode(self, device: "XDevice", payload: dict, value: float):
216216
payload[self.attr] = value
217217

218218

219-
class ZVoltageConv(ZConverter):
219+
@dataclass
220+
class ZVoltageConv(ZMathConv):
220221
cluster_id = ElectricalMeasurement.cluster_id
221222
attr_id = ElectricalMeasurement.AttributeDefs.rms_voltage.id
222223

custom_components/xiaomi_gateway3/core/devices.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,19 @@
12591259
ZHumidityConv("humidity", "sensor", report="10s 1h 100"),
12601260
ZBatteryPercConv("battery", "sensor", report="1h 12h 0", multiply=0.5),
12611261
],
1262+
}, {
1263+
"S60ZBTPF": ["Sonoff", "Smart Plug", "S60ZBTPF"],
1264+
# Initial support for S60ZBTPF
1265+
# Energy-related data is only updated when the switch is turned on — possibly a device firmware-related issue
1266+
# This device does not provide a total energy sensor; only "yesterday", "today", and "month" energy values are available (not yet implemented)
1267+
# Many other features are also not implemented
1268+
"spec": [
1269+
ZOnOffConv("plug", "switch", report="0s 5m 0"),
1270+
ZCurrentConv("current", "sensor", report="12s 57m 10"),
1271+
ZPowerConv("power", "sensor", report="10s 10m 3"),
1272+
ZVoltageConv("voltage", "sensor", report="11s 55m 10", multiply=0.01), # need changes in ZVoltageConv class
1273+
ZPowerOnConv("power_on_state", "select")
1274+
],
12621275
}, {
12631276
"SML001": ["Philips", "Hue motion sensor", "9290012607"],
12641277
"support": 4, # @AlexxIT TODO: sensitivity, led

0 commit comments

Comments
 (0)