Skip to content

Commit a95b3f5

Browse files
committed
vicare: connected to new Vissmann API. Old one is deprecated.
1 parent dedc956 commit a95b3f5

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

vicare/__init__.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@
3434
# Necessary python package for funktion "generate_code_verifier":
3535
from authlib.common.security import generate_token
3636

37-
AUTHORIZE_URL = 'https://iam.viessmann.com/idp/v3/authorize'
38-
TOKEN_URL = 'https://iam.viessmann.com/idp/v3/token'
37+
#AUTHORIZE_URL = 'https://iam.viessmann.com/idp/v3/authorize'
38+
AUTHORIZE_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/authorize'
39+
#TOKEN_URL = 'https://iam.viessmann.com/idp/v3/token'
40+
TOKEN_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/token'
41+
#API_URL = 'https://api.viessmann.com'
42+
API_URL = 'https://api.viessmann-climatesolutions.com'
43+
3944

4045
class Vicare(SmartPlugin):
41-
PLUGIN_VERSION = '1.9.5'
46+
PLUGIN_VERSION = '1.9.6'
4247

4348
def __init__(self, sh):
4449
"""
@@ -390,7 +395,9 @@ def checkErrors(self, response):
390395

391396

392397
def pollInstallationId(self):
393-
url = f"https://api.viessmann.com/iot/v1/equipment/installations"
398+
#old url = f"https://api.viessmann.com/iot/v1/equipment/installations"
399+
url = f"{API_URL}/iot/v1/equipment/installations"
400+
394401
response = self.pollUrlInterface(url)
395402

396403
if response is None:
@@ -423,7 +430,9 @@ def pollInstallationId(self):
423430
self.logger.info(f"InstallationId is {self.installationId}")
424431

425432
def pollSerial(self):
426-
url = f"https://api.viessmann.com/iot/v1/equipment/gateways"
433+
#old url = f"https://api.viessmann.com/iot/v1/equipment/gateways"
434+
url = f"{API_URL}/iot/v1/equipment/gateways"
435+
427436
response = self.pollUrlInterface(url)
428437

429438
if response is None:
@@ -457,7 +466,9 @@ def pollDevices(self):
457466
self.logger.debug(f"pollSerial, invalid installationId, aborting!")
458467
return
459468

460-
url = f"https://api.viessmann.com/iot/v1/equipment/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices"
469+
#old url = f"https://api.viessmann.com/iot/v1/equipment/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices"
470+
url = f"{API_URL}/iot/v1/equipment/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices"
471+
461472
response = self.pollUrlInterface(url)
462473

463474
if response is None:
@@ -538,7 +549,9 @@ def pollFeatures(self):
538549
self.logger.debug(f"pollFeatures, invalid deviceId, aborting!")
539550
return
540551

541-
url = f"https://api.viessmann.com/iot/v2/features/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices/{self.deviceId}/features"
552+
#old url = f"https://api.viessmann.com/iot/v2/features/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices/{self.deviceId}/features"
553+
url = f"{API_URL}/iot/v2/features/installations/{self.installationId}/gateways/{self.gatewaySerial}/devices/{self.deviceId}/features"
554+
542555
response = self.pollUrlInterface(url)
543556
if response is None:
544557
return

vicare/plugin.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ plugin:
77
en: 'Plugin to connect the Viessmann backend with SmartHomeNG'
88
maintainer: aschwith
99
tester: 'n/a'
10-
state: ready
10+
state: develop
1111
keywords: Viessmann, ViCare, Vitocontrol
1212
#documentation:
1313
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1916122-support-thread-f%C3%BCr-das-viessmann-plugin
1414

15-
version: 1.9.5 # Plugin version
16-
sh_minversion: 1.9.0 # minimum shNG version to use this plugin
15+
version: 1.9.6 # Plugin version
16+
sh_minversion: '1.9.0' # minimum shNG version to use this plugin
1717
#sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
1818
multi_instance: False # plugin supports multi instance
1919
restartable: True

0 commit comments

Comments
 (0)