PyViCare 2.32.0__tar.gz → 2.33.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PKG-INFO +1 -1
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCare.py +6 -21
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareAbstractOAuthManager.py +14 -15
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareBrowserOAuthManager.py +2 -2
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareDeviceConfig.py +5 -8
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareElectricalEnergySystem.py +0 -4
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareGateway.py +4 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareGazBoiler.py +1 -1
- pyvicare-2.33.0/PyViCare/PyViCareHeatPump.py +293 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareHeatingDevice.py +83 -100
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareOAuthManager.py +4 -4
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareRoomSensor.py +4 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareService.py +3 -3
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareUtils.py +2 -4
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareVentilationDevice.py +33 -33
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare.egg-info/PKG-INFO +1 -1
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare.egg-info/SOURCES.txt +1 -0
- pyvicare-2.33.0/tests/test_E3_TCU300_ethernet.py +19 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Integration.py +1 -2
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_PyViCareDeviceConfig.py +11 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_TestForMissingProperties.py +0 -1
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocal250A.py +61 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_VitochargeVX3.py +18 -39
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_VitoconnectOpto1.py +4 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens100W.py +3 -0
- PyViCare-2.32.0/PyViCare/PyViCareHeatPump.py +0 -144
- {PyViCare-2.32.0 → pyvicare-2.33.0}/LICENSE +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/Feature.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareCachedService.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareDevice.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareFuelCell.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareHeatCurveCalculation.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareHybrid.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareOilBoiler.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCarePelletsBoiler.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/PyViCareRadiatorActuator.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare/__init__.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare.egg-info/dependency_links.txt +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare.egg-info/requires.txt +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/PyViCare.egg-info/top_level.txt +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/README.md +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/setup.cfg +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/setup.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_GenericDevice.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_PyViCareCachedService.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_PyViCareExceptions.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_PyViCareService.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Solar.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Utils.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_ViCareOAuthManager.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_VitoairFs300E.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocal200.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocal200S.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocal222S.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocal300G.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitocaldens222F.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens200W.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens200W_2.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens222W.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens300W.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_Vitodens333F.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_VitolaUniferral.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_VitovalorPT2.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_zigbee_zk03839.py +0 -0
- {PyViCare-2.32.0 → pyvicare-2.33.0}/tests/test_zigbee_zk03840.py +0 -0
|
@@ -12,10 +12,9 @@ from PyViCare.PyViCareUtils import PyViCareInvalidDataError
|
|
|
12
12
|
logger = logging.getLogger('ViCare')
|
|
13
13
|
logger.addHandler(logging.NullHandler())
|
|
14
14
|
|
|
15
|
-
""""Viessmann ViCare API Python tools"""
|
|
16
|
-
|
|
17
15
|
|
|
18
16
|
class PyViCare:
|
|
17
|
+
""""Viessmann ViCare API Python tools"""
|
|
19
18
|
def __init__(self) -> None:
|
|
20
19
|
self.cacheDuration = 60
|
|
21
20
|
|
|
@@ -36,8 +35,7 @@ class PyViCare:
|
|
|
36
35
|
def __buildService(self, accessor, roles):
|
|
37
36
|
if self.cacheDuration > 0:
|
|
38
37
|
return ViCareCachedService(self.oauth_manager, accessor, roles, self.cacheDuration)
|
|
39
|
-
|
|
40
|
-
return ViCareService(self.oauth_manager, accessor, roles)
|
|
38
|
+
return ViCareService(self.oauth_manager, accessor, roles)
|
|
41
39
|
|
|
42
40
|
def __loadInstallations(self):
|
|
43
41
|
installations = self.oauth_manager.get(
|
|
@@ -54,26 +52,14 @@ class PyViCare:
|
|
|
54
52
|
for installation in self.installations:
|
|
55
53
|
for gateway in installation.gateways:
|
|
56
54
|
for device in gateway.devices:
|
|
57
|
-
if device.deviceType
|
|
58
|
-
continue # we are only interested in heating, photovoltaic, electricityStorage,
|
|
59
|
-
|
|
60
|
-
if device.id == "gateway" and device.deviceType == "vitoconnect":
|
|
61
|
-
device.id = "0" # vitoconnect has no device id, so we use 0
|
|
62
|
-
|
|
63
|
-
if device.id == "gateway" and device.deviceType == "tcu":
|
|
64
|
-
device.id = "0" # tcu has no device id, so we use 0
|
|
65
|
-
|
|
66
|
-
if device.id == "HEMS" and device.deviceType == "hems":
|
|
67
|
-
device.id = "0" # hems has no device id, so we use 0
|
|
68
|
-
|
|
69
|
-
if device.id == "EEBUS" and device.deviceType == "EEBus":
|
|
70
|
-
device.id = "0" # EEBus has no device id,
|
|
55
|
+
if device.deviceType not in ["heating", "zigbee", "vitoconnect", "electricityStorage", "tcu", "ventilation"]:
|
|
56
|
+
continue # we are only interested in heating, photovoltaic, electricityStorage, and ventilation devices
|
|
71
57
|
|
|
72
58
|
accessor = ViCareDeviceAccessor(
|
|
73
59
|
installation.id, gateway.serial, device.id)
|
|
74
60
|
service = self.__buildService(accessor, device.roles)
|
|
75
61
|
|
|
76
|
-
logger.info(
|
|
62
|
+
logger.info("Device found: %s", device.modelId)
|
|
77
63
|
|
|
78
64
|
yield PyViCareDeviceConfig(service, device.id, device.modelId, device.status)
|
|
79
65
|
|
|
@@ -91,5 +77,4 @@ def Wrap(v):
|
|
|
91
77
|
return DictWrap(v)
|
|
92
78
|
if isinstance(v, str) and len(v) == 24 and v[23] == 'Z' and v[10] == 'T':
|
|
93
79
|
return datetime.strptime(v, '%Y-%m-%dT%H:%M:%S.%f%z')
|
|
94
|
-
|
|
95
|
-
return v
|
|
80
|
+
return v
|
|
@@ -35,7 +35,7 @@ class AbstractViCareOAuthManager:
|
|
|
35
35
|
try:
|
|
36
36
|
logger.debug(self.__oauth)
|
|
37
37
|
response = self.__oauth.get(f"{API_BASE_URL}{url}", timeout=31).json()
|
|
38
|
-
logger.debug(
|
|
38
|
+
logger.debug("Response to get request: %s", response)
|
|
39
39
|
self.__handle_expired_token(response)
|
|
40
40
|
self.__handle_rate_limit(response)
|
|
41
41
|
self.__handle_server_error(response)
|
|
@@ -69,21 +69,20 @@ class AbstractViCareOAuthManager:
|
|
|
69
69
|
if ("statusCode" in response and response["statusCode"] >= 400):
|
|
70
70
|
raise PyViCareCommandError(response)
|
|
71
71
|
|
|
72
|
-
"""POST URL using OAuth session. Automatically renew the token if needed
|
|
73
|
-
Parameters
|
|
74
|
-
----------
|
|
75
|
-
url : str
|
|
76
|
-
URL to get
|
|
77
|
-
data : str
|
|
78
|
-
Data to post
|
|
79
|
-
|
|
80
|
-
Returns
|
|
81
|
-
-------
|
|
82
|
-
result: json
|
|
83
|
-
json representation of the answer
|
|
84
|
-
"""
|
|
85
|
-
|
|
86
72
|
def post(self, url, data) -> Any:
|
|
73
|
+
"""POST URL using OAuth session. Automatically renew the token if needed
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
url : str
|
|
77
|
+
URL to get
|
|
78
|
+
data : str
|
|
79
|
+
Data to post
|
|
80
|
+
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
result: json
|
|
84
|
+
json representation of the answer
|
|
85
|
+
"""
|
|
87
86
|
headers = {"Content-Type": "application/json",
|
|
88
87
|
"Accept": "application/vnd.siren+json"}
|
|
89
88
|
try:
|
|
@@ -75,14 +75,14 @@ class ViCareBrowserOAuthManager(AbstractViCareOAuthManager):
|
|
|
75
75
|
logger.debug("Timeout reached")
|
|
76
76
|
raise PyViCareBrowserOAuthTimeoutReachedError()
|
|
77
77
|
|
|
78
|
-
logger.debug(
|
|
78
|
+
logger.debug("Location: %s", location)
|
|
79
79
|
|
|
80
80
|
oauth_session.fetch_token(TOKEN_URL, authorization_response=location, code_verifier=code_verifier)
|
|
81
81
|
|
|
82
82
|
if oauth_session.token is None:
|
|
83
83
|
raise PyViCareInvalidCredentialsError()
|
|
84
84
|
|
|
85
|
-
logger.debug(
|
|
85
|
+
logger.debug("Token received: %s", oauth_session.token)
|
|
86
86
|
self.__storeToken(oauth_session.token)
|
|
87
87
|
logger.info("New token created")
|
|
88
88
|
return oauth_session
|
|
@@ -55,7 +55,7 @@ class PyViCareDeviceConfig:
|
|
|
55
55
|
|
|
56
56
|
def asElectricalEnergySystem(self):
|
|
57
57
|
return ElectricalEnergySystem(self.service)
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
def asGateway(self):
|
|
60
60
|
return Gateway(self.service)
|
|
61
61
|
|
|
@@ -84,21 +84,18 @@ class PyViCareDeviceConfig:
|
|
|
84
84
|
(self.asPelletsBoiler, r"Vitoligno|Ecotronic|VBC550P", []),
|
|
85
85
|
(self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]),
|
|
86
86
|
(self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]),
|
|
87
|
-
(self.
|
|
88
|
-
(self.asElectricalEnergySystem, r"
|
|
89
|
-
(self.asElectricalEnergySystem, r"E3_EEBus", ["type:eebus"]),
|
|
90
|
-
(self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:energy_storage"]),
|
|
87
|
+
(self.asGateway, r"E3_TCU10_x07", ["type:gateway;TCU300"]),
|
|
88
|
+
(self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]),
|
|
91
89
|
(self.asVentilation, r"E3_ViAir", ["type:ventilation"]),
|
|
92
90
|
(self.asGateway, r"Heatbox1", ["type:gateway;VitoconnectOpto1"])
|
|
93
91
|
]
|
|
94
92
|
|
|
95
93
|
for (creator_method, type_name, roles) in device_types:
|
|
96
94
|
if re.search(type_name, self.device_model) or self.service.hasRoles(roles):
|
|
97
|
-
logger.info(
|
|
95
|
+
logger.info("detected %s %s", self.device_model, creator_method.__name__)
|
|
98
96
|
return creator_method()
|
|
99
97
|
|
|
100
|
-
logger.info(
|
|
101
|
-
f"Could not auto detect {self.device_model}. Use generic device.")
|
|
98
|
+
logger.info("Could not auto detect %s. Use generic device.", self.device_model)
|
|
102
99
|
return self.asGeneric()
|
|
103
100
|
|
|
104
101
|
def get_raw_json(self):
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
from PyViCare.PyViCareDevice import Device
|
|
2
2
|
from PyViCare.PyViCareUtils import handleNotSupported
|
|
3
|
-
from PyViCare.PyViCareService import ViCareService
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
class ElectricalEnergySystem(Device):
|
|
7
6
|
|
|
8
|
-
def __init__(self, service: ViCareService) -> None:
|
|
9
|
-
self.service = service
|
|
10
|
-
|
|
11
7
|
@handleNotSupported
|
|
12
8
|
def getPointOfCommonCouplingTransferPowerExchange(self):
|
|
13
9
|
return self.service.getProperty("pcc.transfer.power.exchange")["properties"][
|
|
@@ -4,6 +4,10 @@ from PyViCare.PyViCareUtils import handleNotSupported
|
|
|
4
4
|
|
|
5
5
|
class Gateway(Device):
|
|
6
6
|
|
|
7
|
+
@handleNotSupported
|
|
8
|
+
def getSerial(self):
|
|
9
|
+
return self.service.getProperty("gateway.devices")["gatewayId"]
|
|
10
|
+
|
|
7
11
|
@handleNotSupported
|
|
8
12
|
def getWifiSignalStrength(self):
|
|
9
13
|
return self.service.getProperty("gateway.wifi")["properties"]["strength"]["value"]
|
|
@@ -180,7 +180,7 @@ class GazBoiler(HeatingDevice):
|
|
|
180
180
|
# Gas consumption for Domestic Hot Water data:
|
|
181
181
|
@handleNotSupported
|
|
182
182
|
def getGasSummaryConsumptionDomesticHotWaterUnit(self):
|
|
183
|
-
return self.service.getProperty("heating.gas.consumption.summary.dhw")["properties"]["
|
|
183
|
+
return self.service.getProperty("heating.gas.consumption.summary.dhw")["properties"]["unit"]["value"]
|
|
184
184
|
|
|
185
185
|
@handleNotSupported
|
|
186
186
|
def getGasSummaryConsumptionDomesticHotWaterCurrentDay(self):
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
from contextlib import suppress
|
|
2
|
+
from typing import Any, List
|
|
3
|
+
|
|
4
|
+
from PyViCare.PyViCareHeatingDevice import (HeatingDevice,
|
|
5
|
+
HeatingDeviceWithComponent)
|
|
6
|
+
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleAPICommandErrors, handleNotSupported
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class HeatPump(HeatingDevice):
|
|
10
|
+
|
|
11
|
+
@property
|
|
12
|
+
def compressors(self) -> List[Any]:
|
|
13
|
+
return list([self.getCompressor(x) for x in self.getAvailableCompressors()])
|
|
14
|
+
|
|
15
|
+
def getCompressor(self, compressor):
|
|
16
|
+
return Compressor(self, compressor)
|
|
17
|
+
|
|
18
|
+
@handleNotSupported
|
|
19
|
+
def getAvailableCompressors(self):
|
|
20
|
+
return self.service.getProperty("heating.compressors")["properties"]["enabled"]["value"]
|
|
21
|
+
|
|
22
|
+
@handleNotSupported
|
|
23
|
+
def getBufferMainTemperature(self):
|
|
24
|
+
return self.service.getProperty("heating.buffer.sensors.temperature.main")["properties"]['value']['value']
|
|
25
|
+
|
|
26
|
+
@handleNotSupported
|
|
27
|
+
def getBufferTopTemperature(self):
|
|
28
|
+
return self.service.getProperty("heating.buffer.sensors.temperature.top")["properties"]['value']['value']
|
|
29
|
+
|
|
30
|
+
# Power consumption for Heating:
|
|
31
|
+
@handleNotSupported
|
|
32
|
+
def getPowerSummaryConsumptionHeatingUnit(self):
|
|
33
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["currentDay"]["unit"]
|
|
34
|
+
|
|
35
|
+
@handleNotSupported
|
|
36
|
+
def getPowerSummaryConsumptionHeatingCurrentDay(self):
|
|
37
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["currentDay"]["value"]
|
|
38
|
+
|
|
39
|
+
@handleNotSupported
|
|
40
|
+
def getPowerSummaryConsumptionHeatingCurrentMonth(self):
|
|
41
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["currentMonth"]["value"]
|
|
42
|
+
|
|
43
|
+
@handleNotSupported
|
|
44
|
+
def getPowerSummaryConsumptionHeatingCurrentYear(self):
|
|
45
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["currentYear"]["value"]
|
|
46
|
+
|
|
47
|
+
@handleNotSupported
|
|
48
|
+
def getPowerSummaryConsumptionHeatingLastMonth(self):
|
|
49
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["lastMonth"]["value"]
|
|
50
|
+
|
|
51
|
+
@handleNotSupported
|
|
52
|
+
def getPowerSummaryConsumptionHeatingLastSevenDays(self):
|
|
53
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["lastSevenDays"]["value"]
|
|
54
|
+
|
|
55
|
+
@handleNotSupported
|
|
56
|
+
def getPowerSummaryConsumptionHeatingLastYear(self):
|
|
57
|
+
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["lastYear"]["value"]
|
|
58
|
+
|
|
59
|
+
@handleNotSupported
|
|
60
|
+
def getPowerConsumptionUnit(self):
|
|
61
|
+
return self.service.getProperty("heating.power.consumption.total")["properties"]["day"]["unit"]
|
|
62
|
+
|
|
63
|
+
@handleNotSupported
|
|
64
|
+
def getPowerConsumptionToday(self):
|
|
65
|
+
return self.service.getProperty("heating.power.consumption.total")["properties"]["day"]["value"][0]
|
|
66
|
+
|
|
67
|
+
@handleNotSupported
|
|
68
|
+
def getPowerConsumptionDomesticHotWaterToday(self):
|
|
69
|
+
return self.service.getProperty("heating.power.consumption.dhw")["properties"]["day"]["value"][0]
|
|
70
|
+
|
|
71
|
+
# Power consumption for Domestic Hot Water:
|
|
72
|
+
@handleNotSupported
|
|
73
|
+
def getPowerSummaryConsumptionDomesticHotWaterUnit(self):
|
|
74
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["currentDay"]["unit"]
|
|
75
|
+
|
|
76
|
+
@handleNotSupported
|
|
77
|
+
def getPowerSummaryConsumptionDomesticHotWaterCurrentDay(self):
|
|
78
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["currentDay"]["value"]
|
|
79
|
+
|
|
80
|
+
@handleNotSupported
|
|
81
|
+
def getPowerSummaryConsumptionDomesticHotWaterCurrentMonth(self):
|
|
82
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["currentMonth"]["value"]
|
|
83
|
+
|
|
84
|
+
@handleNotSupported
|
|
85
|
+
def getPowerSummaryConsumptionDomesticHotWaterCurrentYear(self):
|
|
86
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["currentYear"]["value"]
|
|
87
|
+
|
|
88
|
+
@handleNotSupported
|
|
89
|
+
def getPowerSummaryConsumptionDomesticHotWaterLastMonth(self):
|
|
90
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["lastMonth"]["value"]
|
|
91
|
+
|
|
92
|
+
@handleNotSupported
|
|
93
|
+
def getPowerSummaryConsumptionDomesticHotWaterLastSevenDays(self):
|
|
94
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["lastSevenDays"]["value"]
|
|
95
|
+
|
|
96
|
+
@handleNotSupported
|
|
97
|
+
def getPowerSummaryConsumptionDomesticHotWaterLastYear(self):
|
|
98
|
+
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["lastYear"]["value"]
|
|
99
|
+
|
|
100
|
+
@handleNotSupported
|
|
101
|
+
def getVolumetricFlowReturn(self):
|
|
102
|
+
return self.service.getProperty("heating.sensors.volumetricFlow.allengra")["properties"]['value']['value']
|
|
103
|
+
|
|
104
|
+
@handleNotSupported
|
|
105
|
+
def getAvailableVentilationModes(self):
|
|
106
|
+
return self.service.getProperty("ventilation.operating.modes.active")["commands"]["setMode"]["params"]["mode"]["constraints"]["enum"]
|
|
107
|
+
|
|
108
|
+
@handleNotSupported
|
|
109
|
+
def getActiveVentilationMode(self):
|
|
110
|
+
return self.service.getProperty("ventilation.operating.modes.active")["properties"]["value"]["value"]
|
|
111
|
+
|
|
112
|
+
def setActiveVentilationMode(self, mode):
|
|
113
|
+
""" Set the active mode
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
mode : str
|
|
117
|
+
Valid mode can be obtained using getModes()
|
|
118
|
+
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
result: json
|
|
122
|
+
json representation of the answer
|
|
123
|
+
"""
|
|
124
|
+
return self.service.setProperty("ventilation.operating.modes.active", "setMode", {'mode': mode})
|
|
125
|
+
|
|
126
|
+
@handleNotSupported
|
|
127
|
+
def getAvailableVentilationPrograms(self):
|
|
128
|
+
available_programs = []
|
|
129
|
+
for program in ['basic', 'intensive', 'reduced', 'standard', 'standby', 'comfort', 'eco', 'forcedLevelFour',
|
|
130
|
+
'holiday', 'holidayAtHome', 'levelFour', 'levelOne', 'levelThree', 'levelTwo', 'permanent', 'silent']:
|
|
131
|
+
with suppress(PyViCareNotSupportedFeatureError):
|
|
132
|
+
if self.service.getProperty(f"ventilation.operating.programs.{program}") is not None:
|
|
133
|
+
available_programs.append(program)
|
|
134
|
+
return available_programs
|
|
135
|
+
|
|
136
|
+
@handleNotSupported
|
|
137
|
+
def getActiveVentilationProgram(self):
|
|
138
|
+
return self.service.getProperty("ventilation.operating.programs.active")["properties"]["value"]["value"]
|
|
139
|
+
|
|
140
|
+
def activateVentilationProgram(self, program):
|
|
141
|
+
""" Activate a ventilation program
|
|
142
|
+
NOTE
|
|
143
|
+
DEVICE_COMMUNICATION_ERROR can just mean that the program is already on
|
|
144
|
+
Parameters
|
|
145
|
+
----------
|
|
146
|
+
program : str
|
|
147
|
+
|
|
148
|
+
Returns
|
|
149
|
+
-------
|
|
150
|
+
result: json
|
|
151
|
+
json representation of the answer
|
|
152
|
+
"""
|
|
153
|
+
return self.service.setProperty(f"ventilation.operating.programs.{program}", "activate", {})
|
|
154
|
+
|
|
155
|
+
@handleNotSupported
|
|
156
|
+
def getDomesticHotWaterHysteresisUnit(self) -> str:
|
|
157
|
+
return str(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["value"]["unit"])
|
|
158
|
+
|
|
159
|
+
@handleNotSupported
|
|
160
|
+
def getDomesticHotWaterHysteresis(self) -> float:
|
|
161
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["value"]["value"])
|
|
162
|
+
|
|
163
|
+
@handleNotSupported
|
|
164
|
+
def getDomesticHotWaterHysteresisMin(self) -> float:
|
|
165
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["min"])
|
|
166
|
+
|
|
167
|
+
@handleNotSupported
|
|
168
|
+
def getDomesticHotWaterHysteresisMax(self) -> float:
|
|
169
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["max"])
|
|
170
|
+
|
|
171
|
+
@handleNotSupported
|
|
172
|
+
def getDomesticHotWaterHysteresisStepping(self) -> float:
|
|
173
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["stepping"])
|
|
174
|
+
|
|
175
|
+
@handleAPICommandErrors
|
|
176
|
+
def setDomesticHotWaterHysteresis(self, temperature: float) -> Any:
|
|
177
|
+
""" Set the hysteresis temperature for domestic host water
|
|
178
|
+
Parameters
|
|
179
|
+
----------
|
|
180
|
+
temperature : float
|
|
181
|
+
hysteresis temperature
|
|
182
|
+
|
|
183
|
+
Returns
|
|
184
|
+
-------
|
|
185
|
+
result: json
|
|
186
|
+
json representation of the answer
|
|
187
|
+
"""
|
|
188
|
+
return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresis", {'hysteresis': temperature})
|
|
189
|
+
|
|
190
|
+
@handleNotSupported
|
|
191
|
+
def getDomesticHotWaterHysteresisSwitchOn(self) -> float:
|
|
192
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["switchOnValue"]["value"])
|
|
193
|
+
|
|
194
|
+
@handleNotSupported
|
|
195
|
+
def getDomesticHotWaterHysteresisSwitchOnMin(self) -> float:
|
|
196
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["min"])
|
|
197
|
+
|
|
198
|
+
@handleNotSupported
|
|
199
|
+
def getDomesticHotWaterHysteresisSwitchOnMax(self) -> float:
|
|
200
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["max"])
|
|
201
|
+
|
|
202
|
+
@handleNotSupported
|
|
203
|
+
def getDomesticHotWaterHysteresisSwitchOnStepping(self) -> float:
|
|
204
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["stepping"])
|
|
205
|
+
|
|
206
|
+
@handleAPICommandErrors
|
|
207
|
+
def setDomesticHotWaterHysteresisSwitchOn(self, temperature: float) -> Any:
|
|
208
|
+
""" Set the hysteresis switch on temperature for domestic host water
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
temperature : float
|
|
212
|
+
hysteresis switch on temperature
|
|
213
|
+
|
|
214
|
+
Returns
|
|
215
|
+
-------
|
|
216
|
+
result: json
|
|
217
|
+
json representation of the answer
|
|
218
|
+
"""
|
|
219
|
+
return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresisSwitchOnValue", {'hysteresis': temperature})
|
|
220
|
+
|
|
221
|
+
@handleNotSupported
|
|
222
|
+
def getDomesticHotWaterHysteresisSwitchOff(self) -> float:
|
|
223
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["switchOffValue"]["value"])
|
|
224
|
+
|
|
225
|
+
@handleNotSupported
|
|
226
|
+
def getDomesticHotWaterHysteresisSwitchOffMin(self) -> float:
|
|
227
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["min"])
|
|
228
|
+
|
|
229
|
+
@handleNotSupported
|
|
230
|
+
def getDomesticHotWaterHysteresisSwitchOffMax(self) -> float:
|
|
231
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["max"])
|
|
232
|
+
|
|
233
|
+
@handleNotSupported
|
|
234
|
+
def getDomesticHotWaterHysteresisSwitchOffStepping(self) -> float:
|
|
235
|
+
return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["stepping"])
|
|
236
|
+
|
|
237
|
+
@handleAPICommandErrors
|
|
238
|
+
def setDomesticHotWaterHysteresisSwitchOff(self, temperature: float) -> Any:
|
|
239
|
+
""" Set the hysteresis switch off temperature for domestic host water
|
|
240
|
+
Parameters
|
|
241
|
+
----------
|
|
242
|
+
temperature : float
|
|
243
|
+
hysteresis switch off temperature
|
|
244
|
+
|
|
245
|
+
Returns
|
|
246
|
+
-------
|
|
247
|
+
result: json
|
|
248
|
+
json representation of the answer
|
|
249
|
+
"""
|
|
250
|
+
return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresisSwitchOffValue", {'hysteresis': temperature})
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class Compressor(HeatingDeviceWithComponent):
|
|
254
|
+
|
|
255
|
+
@property
|
|
256
|
+
def compressor(self) -> str:
|
|
257
|
+
return self.component
|
|
258
|
+
|
|
259
|
+
@handleNotSupported
|
|
260
|
+
def getStarts(self):
|
|
261
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["starts"]["value"]
|
|
262
|
+
|
|
263
|
+
@handleNotSupported
|
|
264
|
+
def getHours(self):
|
|
265
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hours"]["value"]
|
|
266
|
+
|
|
267
|
+
@handleNotSupported
|
|
268
|
+
def getHoursLoadClass1(self):
|
|
269
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hoursLoadClassOne"]["value"]
|
|
270
|
+
|
|
271
|
+
@handleNotSupported
|
|
272
|
+
def getHoursLoadClass2(self):
|
|
273
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hoursLoadClassTwo"]["value"]
|
|
274
|
+
|
|
275
|
+
@handleNotSupported
|
|
276
|
+
def getHoursLoadClass3(self):
|
|
277
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hoursLoadClassThree"]["value"]
|
|
278
|
+
|
|
279
|
+
@handleNotSupported
|
|
280
|
+
def getHoursLoadClass4(self):
|
|
281
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hoursLoadClassFour"]["value"]
|
|
282
|
+
|
|
283
|
+
@handleNotSupported
|
|
284
|
+
def getHoursLoadClass5(self):
|
|
285
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}.statistics")["properties"]["hoursLoadClassFive"]["value"]
|
|
286
|
+
|
|
287
|
+
@handleNotSupported
|
|
288
|
+
def getActive(self):
|
|
289
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}")["properties"]["active"]["value"]
|
|
290
|
+
|
|
291
|
+
@handleNotSupported
|
|
292
|
+
def getPhase(self):
|
|
293
|
+
return self.service.getProperty(f"heating.compressors.{self.compressor}")["properties"]["phase"]["value"]
|