From f3d77ca6fd47371068fe4fc8deb910c6a3fe7572 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:29:25 +0100 Subject: [PATCH 01/14] Create zigbee_fht.json --- tests/response/zigbee_fht.json | 128 +++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 tests/response/zigbee_fht.json diff --git a/tests/response/zigbee_fht.json b/tests/response/zigbee_fht.json new file mode 100644 index 00000000..941a01be --- /dev/null +++ b/tests/response/zigbee_fht.json @@ -0,0 +1,128 @@ +[ + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "device.messages.errors.raw", + "gatewayId": "################", + "isEnabled": false, + "isReady": true, + "properties": {}, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.messages.errors.raw" + }, + { + "apiVersion": 1, + "commands": { + "setName": { + "isExecutable": true, + "name": "setName", + "params": { + "name": { + "constraints": { + "maxLength": 40, + "minLength": 1, + "regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$" + }, + "required": true, + "type": "string" + } + }, + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name/commands/setName" + } + }, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "device.name", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "name": { + "type": "string", + "value": "" + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.active", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "value": { + "type": "string", + "value": "standby" + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.active" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.cooling", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": false + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.cooling" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.heating", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": false + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.heating" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.standby", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": true + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.standby" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.sensors.temperature.supply", + "gatewayId": "################", + "isEnabled": false, + "isReady": true, + "properties": {}, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.sensors.temperature.supply" + } +] From 4c4a7eb52157ae66c8e09d050a6c99f263cfc946 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Wed, 3 Apr 2024 10:31:44 +0200 Subject: [PATCH 02/14] add floorheating --- PyViCare/PyViCareFloorHeatingDevice.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 PyViCare/PyViCareFloorHeatingDevice.py diff --git a/PyViCare/PyViCareFloorHeatingDevice.py b/PyViCare/PyViCareFloorHeatingDevice.py new file mode 100644 index 00000000..f45ebf41 --- /dev/null +++ b/PyViCare/PyViCareFloorHeatingDevice.py @@ -0,0 +1,13 @@ +from PyViCare.PyViCareHeatingDevice import HeatingDevice +from PyViCare.PyViCareUtils import handleNotSupported + + +class RadiatorActuator(HeatingDevice): + + @handleNotSupported + def getSupplyTemperature(self): + return self.service.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"] + + @handleNotSupported + def getActiveMode(self): + return self.service.getProperty("fht.operating.modes.active")["properties"]["value"]["value"] From c67735f0dd6746bd1c20a96d1bae9f899b74e317 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Wed, 3 Apr 2024 10:31:53 +0200 Subject: [PATCH 03/14] add tests --- tests/test_zigbee_fht.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/test_zigbee_fht.py diff --git a/tests/test_zigbee_fht.py b/tests/test_zigbee_fht.py new file mode 100644 index 00000000..b593c78d --- /dev/null +++ b/tests/test_zigbee_fht.py @@ -0,0 +1,28 @@ +import unittest + +from PyViCare.PyViCareRadiatorActuator import RadiatorActuator +from tests.ViCareServiceMock import ViCareServiceMock + + +class ZK03840(unittest.TestCase): + def setUp(self): + self.service = ViCareServiceMock('response/zigbee_fht.json') + self.device = RadiatorActuator(self.service) + + def test_getTemperature(self): + self.assertEqual( + self.device.getTemperature(), 18.5) + + def test_getTargetTemperature(self): + self.assertEqual( + self.device.getTargetTemperature(), 18) + + def test_setTargetTemperature(self): + self.device.setTargetTemperature(22) + self.assertEqual(len(self.service.setPropertyData), 1) + self.assertEqual( + self.service.setPropertyData[0]['property_name'], 'trv.temperature') + self.assertEqual( + self.service.setPropertyData[0]['action'], 'setTargetTemperature') + self.assertEqual(self.service.setPropertyData[0]['data'], { + 'temperature': 22}) From d94c635d26e6b2cf5f48645125a150c3944a3a67 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Fri, 24 May 2024 10:23:24 +0200 Subject: [PATCH 04/14] Update PyViCareFloorHeatingDevice.py --- PyViCare/PyViCareFloorHeatingDevice.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PyViCare/PyViCareFloorHeatingDevice.py b/PyViCare/PyViCareFloorHeatingDevice.py index f45ebf41..21bde0e4 100644 --- a/PyViCare/PyViCareFloorHeatingDevice.py +++ b/PyViCare/PyViCareFloorHeatingDevice.py @@ -4,6 +4,10 @@ class RadiatorActuator(HeatingDevice): + @handleNotSupported + def getSerial(self): + return self.service.getProperty("device.name")["deviceId"] + @handleNotSupported def getSupplyTemperature(self): return self.service.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"] From 44a186a1ff961439ac5cab8b64d67a4491e8bfd7 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Fri, 24 May 2024 10:24:29 +0200 Subject: [PATCH 05/14] Update test_zigbee_fht.py --- tests/test_zigbee_fht.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_zigbee_fht.py b/tests/test_zigbee_fht.py index b593c78d..e5693021 100644 --- a/tests/test_zigbee_fht.py +++ b/tests/test_zigbee_fht.py @@ -9,6 +9,10 @@ def setUp(self): self.service = ViCareServiceMock('response/zigbee_fht.json') self.device = RadiatorActuator(self.service) + def test_getSerial(self): + self.assertEqual( + self.device.getSerial(), "zigbee-1a1a1a1a1a1a1a1a") + def test_getTemperature(self): self.assertEqual( self.device.getTemperature(), 18.5) From 92b0292f01c43056e79bec430d128cfb01bc41ba Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Fri, 24 May 2024 14:26:04 +0200 Subject: [PATCH 06/14] Update PyViCareFloorHeatingDevice.py --- PyViCare/PyViCareFloorHeatingDevice.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PyViCare/PyViCareFloorHeatingDevice.py b/PyViCare/PyViCareFloorHeatingDevice.py index 21bde0e4..f1db1d5b 100644 --- a/PyViCare/PyViCareFloorHeatingDevice.py +++ b/PyViCare/PyViCareFloorHeatingDevice.py @@ -12,6 +12,24 @@ def getSerial(self): def getSupplyTemperature(self): return self.service.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"] + @handleNotSupported + def getModes(self): + return self.service.getProperty("fht.operating.modes.active")["commands"]["setMode"]["params"]["mode"]["constraints"]["enum"] + @handleNotSupported def getActiveMode(self): return self.service.getProperty("fht.operating.modes.active")["properties"]["value"]["value"] + + def setMode(self, mode): + """ Set the active mode + Parameters + ---------- + mode : str + Valid mode can be obtained using getModes() + + Returns + ------- + result: json + json representation of the answer + """ + return self.service.setProperty("fht.operating.modes.active", "setMode", {'mode': mode}) From 4e000a8bbbbcd61d7da13f41a70fd91c6400880a Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:11:38 +0200 Subject: [PATCH 07/14] Update zigbee_fht.json --- tests/response/zigbee_fht.json | 246 +++++++++++++++++---------------- 1 file changed, 124 insertions(+), 122 deletions(-) diff --git a/tests/response/zigbee_fht.json b/tests/response/zigbee_fht.json index 941a01be..bb8eeff5 100644 --- a/tests/response/zigbee_fht.json +++ b/tests/response/zigbee_fht.json @@ -1,128 +1,130 @@ -[ - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "device.messages.errors.raw", - "gatewayId": "################", - "isEnabled": false, - "isReady": true, - "properties": {}, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.messages.errors.raw" - }, - { - "apiVersion": 1, - "commands": { - "setName": { - "isExecutable": true, - "name": "setName", - "params": { - "name": { - "constraints": { - "maxLength": 40, - "minLength": 1, - "regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$" - }, - "required": true, - "type": "string" - } - }, - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name/commands/setName" - } +{ + "data": [ + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "device.messages.errors.raw", + "gatewayId": "################", + "isEnabled": false, + "isReady": true, + "properties": {}, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.messages.errors.raw" }, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "device.name", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "name": { - "type": "string", - "value": "" - } + { + "apiVersion": 1, + "commands": { + "setName": { + "isExecutable": true, + "name": "setName", + "params": { + "name": { + "constraints": { + "maxLength": 40, + "minLength": 1, + "regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$" + }, + "required": true, + "type": "string" + } + }, + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name/commands/setName" + } + }, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "device.name", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "name": { + "type": "string", + "value": "" + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name" }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name" - }, - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "fht.operating.modes.active", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "value": { - "type": "string", - "value": "standby" - } + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.active", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "value": { + "type": "string", + "value": "standby" + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.active" }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.active" - }, - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "fht.operating.modes.cooling", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "active": { - "type": "boolean", - "value": false - } + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.cooling", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": false + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.cooling" }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.cooling" - }, - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "fht.operating.modes.heating", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "active": { - "type": "boolean", - "value": false - } + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.heating", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": false + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.heating" }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.heating" - }, - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "fht.operating.modes.standby", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "active": { - "type": "boolean", - "value": true - } + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.operating.modes.standby", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "active": { + "type": "boolean", + "value": true + } + }, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.standby" }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.standby" - }, - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", - "feature": "fht.sensors.temperature.supply", - "gatewayId": "################", - "isEnabled": false, - "isReady": true, - "properties": {}, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.sensors.temperature.supply" - } -] + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "feature": "fht.sensors.temperature.supply", + "gatewayId": "################", + "isEnabled": false, + "isReady": true, + "properties": {}, + "timestamp": "2024-03-01T04:40:59.911Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.sensors.temperature.supply" + } + ] +} From f2900847fc1130a4efc8a4f3fe1be7f5e48cf2f6 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Wed, 14 Aug 2024 15:50:06 +0200 Subject: [PATCH 08/14] correct class name --- PyViCare/PyViCareFloorHeatingDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyViCare/PyViCareFloorHeatingDevice.py b/PyViCare/PyViCareFloorHeatingDevice.py index f1db1d5b..94109cee 100644 --- a/PyViCare/PyViCareFloorHeatingDevice.py +++ b/PyViCare/PyViCareFloorHeatingDevice.py @@ -2,7 +2,7 @@ from PyViCare.PyViCareUtils import handleNotSupported -class RadiatorActuator(HeatingDevice): +class FloorHeating(HeatingDevice): @handleNotSupported def getSerial(self): From d203dbaefedabc12f6ebfb91b758e97166101afc Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Wed, 14 Aug 2024 15:55:28 +0200 Subject: [PATCH 09/14] fix test case --- tests/test_zigbee_fht.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/test_zigbee_fht.py b/tests/test_zigbee_fht.py index e5693021..dba5966f 100644 --- a/tests/test_zigbee_fht.py +++ b/tests/test_zigbee_fht.py @@ -1,32 +1,18 @@ import unittest -from PyViCare.PyViCareRadiatorActuator import RadiatorActuator +from PyViCare.PyViCareFloorHeatingDevice import FloorHeating from tests.ViCareServiceMock import ViCareServiceMock class ZK03840(unittest.TestCase): def setUp(self): self.service = ViCareServiceMock('response/zigbee_fht.json') - self.device = RadiatorActuator(self.service) + self.device = FloorHeating(self.service) def test_getSerial(self): self.assertEqual( self.device.getSerial(), "zigbee-1a1a1a1a1a1a1a1a") - def test_getTemperature(self): + def test_getActiveMode(self): self.assertEqual( - self.device.getTemperature(), 18.5) - - def test_getTargetTemperature(self): - self.assertEqual( - self.device.getTargetTemperature(), 18) - - def test_setTargetTemperature(self): - self.device.setTargetTemperature(22) - self.assertEqual(len(self.service.setPropertyData), 1) - self.assertEqual( - self.service.setPropertyData[0]['property_name'], 'trv.temperature') - self.assertEqual( - self.service.setPropertyData[0]['action'], 'setTargetTemperature') - self.assertEqual(self.service.setPropertyData[0]['data'], { - 'temperature': 22}) + self.device.getActiveMode(), "standby") From 70c599e1f2210b92c0ccca3663ba09d3d4771bf7 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Tue, 1 Oct 2024 21:37:33 +0200 Subject: [PATCH 10/14] update test data --- tests/response/zigbee_fht.json | 67 +++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/tests/response/zigbee_fht.json b/tests/response/zigbee_fht.json index bb8eeff5..24a79b8f 100644 --- a/tests/response/zigbee_fht.json +++ b/tests/response/zigbee_fht.json @@ -3,14 +3,19 @@ { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "device.messages.errors.raw", "gatewayId": "################", - "isEnabled": false, + "isEnabled": true, "isReady": true, - "properties": {}, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.messages.errors.raw" + "properties": { + "entries": { + "type": "array", + "value": [] + } + }, + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/device.messages.errors.raw" }, { "apiVersion": 1, @@ -29,10 +34,10 @@ "type": "string" } }, - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name/commands/setName" + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/device.name/commands/setName" } }, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "device.name", "gatewayId": "################", "isEnabled": true, @@ -43,13 +48,13 @@ "value": "" } }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/device.name" + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/device.name" }, { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "fht.operating.modes.active", "gatewayId": "################", "isEnabled": true, @@ -60,13 +65,13 @@ "value": "standby" } }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.active" + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/fht.operating.modes.active" }, { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "fht.operating.modes.cooling", "gatewayId": "################", "isEnabled": true, @@ -77,13 +82,13 @@ "value": false } }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.cooling" + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/fht.operating.modes.cooling" }, { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "fht.operating.modes.heating", "gatewayId": "################", "isEnabled": true, @@ -94,13 +99,13 @@ "value": false } }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.heating" + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/fht.operating.modes.heating" }, { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "fht.operating.modes.standby", "gatewayId": "################", "isEnabled": true, @@ -111,20 +116,30 @@ "value": true } }, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.operating.modes.standby" + "timestamp": "2024-10-01T03:59:44.794Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/fht.operating.modes.standby" }, { "apiVersion": 1, "commands": {}, - "deviceId": "zigbee-1a1a1a1a1a1a1a1a", + "deviceId": "zigbee-5cc7c1fffea25f73", "feature": "fht.sensors.temperature.supply", "gatewayId": "################", - "isEnabled": false, + "isEnabled": true, "isReady": true, - "properties": {}, - "timestamp": "2024-03-01T04:40:59.911Z", - "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-1a1a1a1a1a1a1a1a/features/fht.sensors.temperature.supply" + "properties": { + "status": { + "type": "string", + "value": "connected" + }, + "value": { + "type": "number", + "unit": "celsius", + "value": 21.9 + } + }, + "timestamp": "2024-10-01T11:06:25.941Z", + "uri": "https://api.viessmann.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-5cc7c1fffea25f73/features/fht.sensors.temperature.supply" } ] } From c6e2e9b0de38e8fa470783c78a297d85b88d53d4 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Tue, 1 Oct 2024 21:37:41 +0200 Subject: [PATCH 11/14] rename --- .../{PyViCareFloorHeatingDevice.py => PyViCareFloorHeating.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename PyViCare/{PyViCareFloorHeatingDevice.py => PyViCareFloorHeating.py} (100%) diff --git a/PyViCare/PyViCareFloorHeatingDevice.py b/PyViCare/PyViCareFloorHeating.py similarity index 100% rename from PyViCare/PyViCareFloorHeatingDevice.py rename to PyViCare/PyViCareFloorHeating.py From c8323b1e7aafc8b46097ac247a84d9f79fb3e59f Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Tue, 1 Oct 2024 21:38:07 +0200 Subject: [PATCH 12/14] add autodetect entry --- PyViCare/PyViCareDeviceConfig.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PyViCare/PyViCareDeviceConfig.py b/PyViCare/PyViCareDeviceConfig.py index 8245704c..67d267da 100644 --- a/PyViCare/PyViCareDeviceConfig.py +++ b/PyViCare/PyViCareDeviceConfig.py @@ -2,6 +2,7 @@ import logging import re +from PyViCare.PyViCareFloorHeating import FloorHeating from PyViCare.PyViCareFuelCell import FuelCell from PyViCare.PyViCareGazBoiler import GazBoiler from PyViCare.PyViCareHeatingDevice import HeatingDevice @@ -50,6 +51,9 @@ def asHybridDevice(self): def asRadiatorActuator(self): return RadiatorActuator(self.service) + def asFloorHeating(self): + return FloorHeating(self.service) + def asRoomSensor(self): return RoomSensor(self.service) @@ -85,6 +89,7 @@ def asAutoDetectDevice(self): (self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]), (self.asVentilation, r"E3_ViAir", ["type:ventilation"]), (self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]), + (self.asFloorHeating, r"E3_FloorHeatingCircuitDistributorBox", ["type:fhtMain"]), (self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]), (self.asGateway, r"E3_TCU19_x05", ["type:gateway;TCU200"]), (self.asGateway, r"E3_TCU10_x07", ["type:gateway;TCU300"]), From 483855eb6539f0def24e8f9984751bc5668d9c12 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Tue, 1 Oct 2024 21:51:42 +0200 Subject: [PATCH 13/14] fix import --- tests/test_zigbee_fht.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_zigbee_fht.py b/tests/test_zigbee_fht.py index dba5966f..24e753ae 100644 --- a/tests/test_zigbee_fht.py +++ b/tests/test_zigbee_fht.py @@ -1,6 +1,6 @@ import unittest -from PyViCare.PyViCareFloorHeatingDevice import FloorHeating +from PyViCare.PyViCareFloorHeating import FloorHeating from tests.ViCareServiceMock import ViCareServiceMock From a703810f4502de22e14560dac67e4add190e9c07 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Tue, 1 Oct 2024 21:53:09 +0200 Subject: [PATCH 14/14] fix test case --- tests/test_zigbee_fht.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_zigbee_fht.py b/tests/test_zigbee_fht.py index 24e753ae..fb080b85 100644 --- a/tests/test_zigbee_fht.py +++ b/tests/test_zigbee_fht.py @@ -11,7 +11,7 @@ def setUp(self): def test_getSerial(self): self.assertEqual( - self.device.getSerial(), "zigbee-1a1a1a1a1a1a1a1a") + self.device.getSerial(), "zigbee-5cc7c1fffea25f73") def test_getActiveMode(self): self.assertEqual(