Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no more connection to PyViCare PT2 fuelcell #320

Open
SPITZGITHUB opened this issue Jun 9, 2023 · 0 comments
Open

no more connection to PyViCare PT2 fuelcell #320

SPITZGITHUB opened this issue Jun 9, 2023 · 0 comments

Comments

@SPITZGITHUB
Copy link

I got via Python values from the fuelcell for to controll the fuelcell since some years with and without connection. But since mid of may I have more problems.
I found a solution when I read the issue: pip install pyvicare' doesn't work anymore on Raspberry PI #311 and with the help form crazyfx1. Now it runs again but always in midnight the connection was lost for 1 oder 2 hours.

But since 08.06.2023 at 18:07 I lost the connection to PyViCare.
Here the script with runs years for to collect values from the fuelcell.

**import sys
import logging
from PyViCare.PyViCare import PyViCare

client_id = ""
email = ""
password = ""

vicare = PyViCare()
vicare.initWithCredentials(email, password, client_id, "token.save")
device = vicare.devices[0]
t = device.asFuelCell()
circuit = t.circuits[0] #select heating circuit
burner = t.getBurner(0)
Komma =";"
ZW = str(t.getDomesticHotWaterStorageTemperature())
Wert = ZW + Komma
ZW = str(t.getOutsideTemperature())
Wert = Wert + ZW + Komma
ZW = str(circuit.getSupplyTemperature())
Wert = Wert + ZW + Komma
ZW = str(t.getReturnTemperature())
Wert = Wert + ZW + Komma
ZW = str(t.getDomesticHotWaterDesiredTemperature())
Wert = Wert + ZW + Komma
ZW = str(t.getDomesticHotWaterConfiguredTemperature())
Wert = Wert + ZW + Komma
ZW = str(burner.getActive())
Wert = Wert + ZW + Komma
ZW = str(t.getOneTimeCharge())
Wert = Wert + ZW + Komma
ZW = str(circuit.getDesiredTemperatureForProgram("reduced"))
Wert = Wert + ZW + Komma
ZW = str(circuit.getDesiredTemperatureForProgram("normal"))
Wert = Wert + ZW + Komma
ZW = str(circuit.getDesiredTemperatureForProgram("comfort"))
Wert = Wert + ZW + Komma
ZW = circuit.getActiveProgram()
Wert = Wert + ZW + Komma
ZW = str(burner.getStarts())
Wert = Wert + ZW + Komma
ZW = str(burner.getHours())
Wert = Wert + ZW + Komma
ZW = str(t.getHydraulicSeparatorTemperature())
Wert = Wert + ZW + Komma
print(Wert)**

When I run this script I got the following errors:

Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 7.27.0 -- An enhanced Interactive Python.
runfile('Y:/Hausautomation/Raspberry/sicherungen/iobroker-data/python/BSZ_Werte_holen_ohne_Flow.py', wdir='Y:/Hausautomation/Raspberry/sicherungen/iobroker-data/python')
Traceback (most recent call last):
File "Y:\Hausautomation\Raspberry\sicherungen\iobroker-data\python\BSZ_Werte_holen_ohne_Flow.py", line 11, in
vicare.initWithCredentials(email, password, client_id, "token.save")
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\PyViCare\PyViCare.py", line 26, in initWithCredentials
self.initWithExternalOAuth(ViCareOAuthManager(
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\PyViCare\PyViCare.py", line 31, in initWithExternalOAuth
self.__loadInstallations()
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\PyViCare\PyViCare.py", line 43, in __loadInstallations
installations = self.oauth_manager.get(
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\PyViCare\PyViCareAbstractOAuthManager.py", line 37, in get
response = self.__oauth.get(f"{API_BASE_URL}{url}", timeout=31).json()
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\authlib\integrations\requests_client\oauth2_session.py", line 109, in request
return super(OAuth2Session, self).request(
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\requests\sessions.py", line 528, in request
prep = self.prepare_request(req)
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\requests\sessions.py", line 456, in prepare_request
p.prepare(
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\requests\models.py", line 320, in prepare
self.prepare_auth(auth, url)
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\requests\models.py", line 556, in prepare_auth
r = auth(self)
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\authlib\integrations\requests_client\oauth2_session.py", line 24, in call
self.ensure_active_token()
File "C:\Users\Peter.conda\envs\spyder\lib\site-packages\authlib\integrations\requests_client\oauth2_session.py", line 21, in ensure_active_token
raise InvalidTokenError()
InvalidTokenError: token_invalid:

I have deleted the token.save but no success.

Can you help me to reconnect to the fuelcell?

Greetings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant