krocat / ToonHA

Home-Assistant component for Toon by Eneco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temperature not changing

Z-pi opened this issue · comments

commented

When i change the temperature of the thermostat in Home assistant. the temperature doesn't change on the thermostat. if i use the toon app the temperature does change.

Home Assistant 0.63.1

Now i'm thinking about it, i do have this issue as well. Not sure if it's every time i try to set a program or just every once in a while.

I think that the new library should not have an issue with that. There was a race condition on the api because changes are delivered as a full payload for temperature as well as thermostat state but is caught and fixed with the latest toonapilib version.

commented

Is the new version already implemented in ToonHA?

I haven't implemented the latest version into ToonHA yet, hoping to do so asap

commented

Ok great. thank you for the responses

#29 includes the newest library version, but does not fix the temperature issue. Looking at my logs i can see the following:

{
  [...]
  "errorFound" : 255,
  "otCommError" : "0",
  "currentModulationLevel" : 0,
  "haveOTBoiler" : 0
}

The "errorFound" : 255 part seems quite worrying to me.

commented

I have installed your code and it sometimes works when changing the temperature, it seems that i have more success when lowering the temperature

Hi @boltgolt and @Z-pi . Could you please try out toonapilib straight and report if this is an issue there? If this is due to the library maybe I can investigate further. If it is not then it is propably HA and we need to escalate in some way to HA developers after we have some more info.

commented

Sorry, I don't really know how to use python on a command line

Hi @Z-pi . On any linux or mac system, or windows with python installed you can follow http://toonapilib.readthedocs.io/en/latest/installation.html to install the library and then http://toonapilib.readthedocs.io/en/latest/usage.html for its basic usage. If you get stack on something specific, let me know and I will try to help you.

commented

Thank you, I have toonapilib installed and when i start it from the command prompt i get this message: Traceback (most recent call last): File "toonapilib.py", line 40, in <module> from .configuration import STATES, STATE_CACHING_SECONDS, BURNER_STATES ModuleNotFoundError: No module named '__main__.configuration'; '__main__' is not a package i don't know where is should put my password. username. consumer key and secret

This seems like the installation is broken. Which python version are you using, how did you install it and what do you mean "when I start it com the command prompt"? Could you please follow the usage documentation and report back with the whole process, obfuscating your personal details?

commented

Sorry, i just had one wrong letter in my customer key. i'm testing if there are any issues now

commented

Temperature and mode changing is not working in toonapilib print(toon.thermostat_state.name) print(toon.thermostat_state.id) print(toon.thermostat_state.temperature) print(toon.thermostat_state.dhw) print(toon.temperature) print(toon.power.value) toon.thermostat = '14' gives Home 1 2000 1 21.0 644

but the temperature is not changing, the same goes for the mode's

The assignment of the value should be a number, without quotes. Please read http://toonapilib.readthedocs.io/en/latest/usage.html carefully and report back the full interaction of what you provide with what the library reports back. It would help to enable debug logging.

import logging
logging.basicConfig(level=logging.DEBUG)
commented

Ok, here is the result with debug logging on. the temperature on the thermostat is not changing

`print(toon.thermostat_state.name)````

print(toon.thermostat_state.id)

print(toon.thermostat_state.temperature)

print(toon.thermostat_state.dhw)

print(toon.temperature)

print(toon.power.value)

toon.thermostat = 23`

gives

`c:\Users\Peter\Desktop>py hello.py

DEBUG:toonapilib.Toon:Using patched request for url https://api.toon.eu//authorize

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "GET //authorize?tenant_id=eneco&response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1&client_id=%**************** HTTP/1.1" 200 10561

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "POST //authorize/legacy HTTP/1.1" 302 0

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "POST //token HTTP/1.1" 200 258

DEBUG:toonapilib.Toon:{'access_token': '******', 'expires_in': '1799', 'refresh_token': '', 'refresh_token_expires_in': '0'}

DEBUG:toonapilib.Toon:Using patched request for url https://api.toon.eu//toon/v3/agreements

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "GET //toon/v3/agreements HTTP/1.1" 200 None

DEBUG:toonapilib.Toon:Using patched request for url https://api.toon.eu//toon/v3/336300/status

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "GET //toon/v3/336300/status HTTP/1.1" 200 None
Home
1
2000
1
21.0
787

DEBUG:toonapilib.Toon:Using patched request for url https://api.toon.eu//toon/v3/336300/thermostat

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "GET //toon/v3/336300/thermostat HTTP/1.1" 200 None

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.toon.eu

DEBUG:urllib3.connectionpool:https://api.toon.eu:443 "PUT //toon/v3/336300/thermostat HTTP/1.1" 200 None

DEBUG:toonapilib.Toon:Response received b'{\n "currentSetpoint" : 2300,\n "currentDisplayTemp" : 2100,\n "programState" : 1,\n "activeState" : -1,\n "nextProgram" : 1,\n "nextState" : 2,\n "nextTime" : 1523219400,\n "nextSetpoint" : 1500,\n "errorFound" : 255,\n "boilerModuleConnected" : 1,\n "realSetpoint" : 2000,\n "burnerInfo" : "0",\n "otCommError" : "0",\n "currentModulationLevel" : 0,\n "haveOTBoiler" : 1\n}'

DEBUG:toonapilib.Toon:Clearing state cache.`

@boltgolt according to the doc errorFound has to be 255 and indicates nothing is wrong (strangely :P)

I did not run into this specific issue, although i cannot set the temperature through HA using a google home, hence why i ran into this issue. I'll create a separate issue if I get a repeatable scenario though.

I cannot reproduce this to troubleshoot, so if people still have problems with this please re open it.