Skip to content

Commit 962d8ee

Browse files
authored
feat: Add floor heating device (#415)
* Create zigbee_fht.json * add floorheating * add tests * Update PyViCareFloorHeatingDevice.py * Update test_zigbee_fht.py * Update PyViCareFloorHeatingDevice.py * Update zigbee_fht.json * correct class name * fix test case * update test data * rename * add autodetect entry * fix import * fix test case * add FloorHeatingChannel class * add sample data * move files * ignore unused data points * add test cases * sort testdata
1 parent 78a21c7 commit 962d8ee

8 files changed

+475
-0
lines changed

PyViCare/PyViCareDeviceConfig.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import re
44

5+
from PyViCare.PyViCareFloorHeating import FloorHeating, FloorHeatingChannel
56
from PyViCare.PyViCareFuelCell import FuelCell
67
from PyViCare.PyViCareGazBoiler import GazBoiler
78
from PyViCare.PyViCareHeatingDevice import HeatingDevice
@@ -51,6 +52,12 @@ def asHybridDevice(self):
5152
def asRadiatorActuator(self):
5253
return RadiatorActuator(self.service)
5354

55+
def asFloorHeating(self):
56+
return FloorHeating(self.service)
57+
58+
def asFloorHeatingChannel(self):
59+
return FloorHeatingChannel(self.service)
60+
5461
def asRoomSensor(self):
5562
return RoomSensor(self.service)
5663

@@ -92,6 +99,8 @@ def asAutoDetectDevice(self):
9299
(self.asVentilation, r"E3_ViAir", ["type:ventilation;central"]),
93100
(self.asVentilation, r"E3_VitoPure", ["type:ventilation;purifier"]),
94101
(self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]),
102+
(self.asFloorHeating, r"Smart_zigbee_fht_main|E3_FloorHeatingCircuitDistributorBox", ["type:fhtMain"]),
103+
(self.asFloorHeatingChannel, r"Smart_zigbee_fht_channel", ["type:fhtChannel"]),
95104
(self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]),
96105
(self.asRepeater, r"E3_Repeater", ["type:repeater"]),
97106
(self.asGateway, r"E3_TCU41_x04", ["type:gateway;TCU100"]),

PyViCare/PyViCareFloorHeating.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from PyViCare.PyViCareDevice import ZigbeeDevice, Device
2+
from PyViCare.PyViCareUtils import handleAPICommandErrors, handleNotSupported
3+
4+
5+
class FloorHeating(ZigbeeDevice):
6+
7+
@handleNotSupported
8+
def getSupplyTemperature(self) -> float:
9+
return float(self.service.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"])
10+
11+
@handleNotSupported
12+
def getActiveMode(self) -> str:
13+
return str(self.service.getProperty("fht.operating.modes.active")["properties"]["value"]["value"])
14+
15+
16+
class FloorHeatingChannel(Device):
17+
18+
@handleNotSupported
19+
def getSerial(self) -> str:
20+
return str(self.service.getProperty("device.name")["deviceId"])
21+
22+
@handleNotSupported
23+
def getName(self) -> str:
24+
return str(self.service.getProperty("device.name")["properties"]["name"]["value"])
25+
26+
@handleAPICommandErrors
27+
def setName(self, name: str) -> None:
28+
self.service.setProperty("device.name", "setName", {'name': name})
29+
30+
@handleNotSupported
31+
def getValvePosition(self) -> str:
32+
return str(self.service.getProperty("fht.valve.state")["properties"]["status"]["value"])
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"data": [
3+
{
4+
"apiVersion": 1,
5+
"commands": {
6+
"setName": {
7+
"isExecutable": true,
8+
"name": "setName",
9+
"params": {
10+
"name": {
11+
"constraints": {
12+
"maxLength": 40,
13+
"minLength": 1,
14+
"regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$"
15+
},
16+
"required": true,
17+
"type": "string"
18+
}
19+
},
20+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################-2/features/device.name/commands/setName"
21+
}
22+
},
23+
"deviceId": "zigbee-################-2",
24+
"feature": "device.name",
25+
"gatewayId": "################",
26+
"isEnabled": true,
27+
"isReady": true,
28+
"properties": {
29+
"name": {
30+
"type": "string",
31+
"value": "Zone EG Bad"
32+
}
33+
},
34+
"timestamp": "2025-10-05T14:18:35.990Z",
35+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################-2/features/device.name"
36+
},
37+
{
38+
"apiVersion": 1,
39+
"commands": {},
40+
"deviceId": "zigbee-################-2",
41+
"feature": "fht.valve",
42+
"gatewayId": "################",
43+
"isEnabled": true,
44+
"isReady": true,
45+
"properties": {
46+
"type": {
47+
"type": "string",
48+
"value": "normallyClosed"
49+
}
50+
},
51+
"timestamp": "2025-10-05T14:18:35.990Z",
52+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################-2/features/fht.valve"
53+
},
54+
{
55+
"apiVersion": 1,
56+
"commands": {},
57+
"deviceId": "zigbee-################-2",
58+
"feature": "fht.valve.state",
59+
"gatewayId": "################",
60+
"isEnabled": true,
61+
"isReady": true,
62+
"properties": {
63+
"status": {
64+
"type": "string",
65+
"value": "closed"
66+
}
67+
},
68+
"timestamp": "2025-10-05T14:18:35.990Z",
69+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################-2/features/fht.valve.state"
70+
}
71+
]
72+
}

0 commit comments

Comments
 (0)