cyr-ius / hass-cozytouch

Cozytouch support for Home Assistant
GNU General Public License v2.0
23 stars 14 forks source link

Device not available : Atlantic Pass APC Boiler, DHW and HeatingZone #8

Open ooOO00OOoo opened 4 years ago

ooOO00OOoo commented 4 years ago

Hello

I received and plugged my Cozytouch bridge two days ago, downloaded cozytouch app, created my account on cozytouch (and my two heaters where detected). To test it, i used google home to get temperature, all is ok).

So… i wanted to use cozytouch component. I installed it within hacs (integration page). At this step, all seems to be good (logo is green in hacs integration page).

So i restarted, went to configuration > integration > add integration > Cozytouch. It asked me my user and password for Cozytouch bridge … I put user/password and had : 'User or password inccorect'

In home-assistant.log i have this error :

‘2020-05-02 04:02:35 ERROR (MainThread) [custom_components.cozytouch.config_flow] Error: Unknown device None’

I set debug mode and got this log 2020-05-03 16:52:35 DEBUG (SyncWorker_4) [cozytouchpy.client] Request : {‘userId’: ‘XXXX@XXX.com’, ‘userPassword’: ‘XXXXX’} 2020-05-03 16:52:35 DEBUG (SyncWorker_4) [cozytouchpy.client] {‘JSESSIONID’: ‘XXXXXXXXXXXXXXXXXXX’} 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.client] Request : {} 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.POD 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.HEATER 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.ELECTRECITY 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.OCCUPANCY 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.CONTACT 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] DeviceType.TEMPERATURE 2020-05-03 16:52:35 DEBUG (SyncWorker_12) [cozytouchpy.objects] None 2020-05-03 16:52:35 ERROR (MainThread) [custom_components.cozytouch.config_flow] Error: Unknown device None

could you help me please ?

palm17 commented 4 years ago

Hello,

I'm a French guy, so sorry for my bad english...

I have the same issue, with HA 108.9, and now with 109.6... I change my password for the cozytouch app on my smartphone, but it does not work... i have the same error "Utilisateur ou mot de passe incorrect". I don't know what to do. Can you help me ?

bestlibre commented 4 years ago

Do you have any special characters in your password? In this case you can try with a password without those. If possible try with a password with only alpha numeric chars (ie a-zA-Z0-9). If it works you can add others.

ooOO00OOoo commented 4 years ago

I don t have any special charactere in mine...

@palm17 je suis également français. On se tient au courant si l un de nous trouve

bestlibre commented 4 years ago

I asked that because I think I had a problem with special chars.

@palm17 can you send us a log in debug?

In @ooOO00OOoo log it seems that the login went through since you get a session id. Can you post a full log ? With only cozytouchpy and hass-cozytouch in debug ?

I'm also french. If it's too difficult to communicate in english, we can switch to french.

palm17 commented 4 years ago

Hello,

@ooOO00OOoo Cool !

@bestlibre I don t have any special character, only letters up and down, and number ; and no "-" I reset my password, but no change... et cool que tu sois également Français !

The log of the day

2020-05-16 12:15:41 DEBUG (SyncWorker_17) [cozytouchpy.client] Request : {'userId': 'xxxxxx@gmail.com', 'userPassword': 'AAAA1234aaaa'} 2020-05-16 12:15:41 DEBUG (SyncWorker_17) [cozytouchpy.client] {'JSESSIONID': 'xxxxxxxxxxxx'} 2020-05-16 12:15:41 DEBUG (SyncWorker_16) [cozytouchpy.client] Request : {} 2020-05-16 12:15:41 DEBUG (SyncWorker_16) [cozytouchpy.objects] DeviceType.POD 2020-05-16 12:15:41 DEBUG (SyncWorker_16) [cozytouchpy.objects] None 2020-05-16 12:15:41 ERROR (MainThread) [custom_components.cozytouch.config_flow] Error: Unknown device None

In the Cozytouch App on my smartphone, i have linked a boiler. I don't know if this material is compatible with HA integration.

Thanks for your help !

bestlibre commented 4 years ago

Could you get the json response from the API ? @Cyr-ius explained here how to get it.

@Cyr-ius : I think that the hass integration should be resistant to unknown device type. So instead of an exception beiing raised in objects.py it could be a error log ? Or the exception should be catch inside the loops calling the build method.

ooOO00OOoo commented 4 years ago

Bonjour @bestlibre désolé pour la réponse tardive, et merci de te pencher sur le problème avec nous. J'ai exactement la même log que @palm17 .

J'ai essayé le 1er lien fourni : curl -X POST -k -H 'Content-Type: application / x-www-form-urlencoded' -i 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/login' --data 'aaaaaaa@gmail.com&userPassword=aaaaaaaa' (en changeant évidement le mot de passe et login).

j'ai essayé en changeant d'email et mot de passe (juste avec des lettres sauf le @ et le '.' du mail évidement.

La réponse obtenue est la suivante : {"errorCode":"AUTHENTICATION_ERROR","error":"Missing parameter or invalid parameters combination : please provide one of [userId+userPassword, userId+ssoToken, accessToken, jwt]"}

En essayant en revanche le lien dev.duboc.pro/tahoma/api en selectionnant Cozytouch

j'arrive bien a me connecter, à avoir une réponse JSOn qui correspond bien à mon compte

bestlibre commented 4 years ago

I'm going to answer in English to allow non french people to follow. Don't hesitate to continue in french if it's easier, I will make an abstract when necessary before answering.

Can you post the json (you can change the names/location if needed). The idea is to check if there is an unknown device and to add it in the support list or at least ignore it. You can post it in a gist or in private bin.

I will check my command history to get a curl example that works for later reference.

ooOO00OOoo commented 4 years ago

Hello,

no problem to stay in english. You can find my Json answer here https://gist.github.com/ooOO00OOoo/82d834e12d1abad788f01117be17a072

I just think something. I tried the curl command on my Pi (with SSH). I have the same error as Home assitant (witch is on my PI too)

But .. with dev.duboc.pro/tahoma/api (used on my computer), i have a JSON answer.

Maybe i got this error due to my PI ? (closed port,... ???)

bestlibre commented 4 years ago

I had a problem also with the curl command from @Cyr-ius . To get a json with curl I did the following :

curl -X POST -k -i 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/login' -F 'userId=xxxxx@xxxxx' -F 'userPassword=xxxxxxx'

the response look like :

Date: Sun, 17 May 2020 12:38:11 GMT
Server: overkiz
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: application/json;charset=UTF-8
Set-Cookie: JSESSIONID=XXXXXXXXXXXXXXXXXXX; Path=/enduser-mobile-web; Secure; HttpOnly
Transfer-Encoding: chunked

{"success":true,"roles":[{"name":"ENDUSER"}]}

Then I used the JSESSIONID in the following request :

curl -X GET -k -i 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/setup' -b JSESSIONID=XXXXXXXXXXXXX
ooOO00OOoo commented 4 years ago

yes with your command i got the same answer

Date: Sun, 17 May 2020 12:46:13 GMT Server: overkiz Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/json;charset=UTF-8 Set-Cookie: JSESSIONID=XXXXXXXXXXXXXXXXXXXXXXXXXXX; Path=/enduser-mobile-we b; Secure; HttpOnly Transfer-Encoding: chunked

With tis JSESSIONID, and using your 2nd command, i got the same JSON Answer as https://gist.github.com/ooOO00OOoo/82d834e12d1abad788f01117be17a072

palm17 commented 4 years ago

Hello,

With the first command, i got exactly the same answer :

HTTP/1.1 200 Date: Sun, 17 May 2020 17:12:51 GMT Server: overkiz Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/json;charset=UTF-8 Set-Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; Path=/enduser-mobile-we b; Secure; HttpOnly Transfer-Encoding: chunked

With my JSESSIONID, and using your 2nd command, i got the same JSON Answer as

https://gist.github.com/palm17/144b96314c9ed81ff37aaccebbe6faf4

Thank u for your help !

bestlibre commented 4 years ago

I have look at your json. The problem come from unsupported devices, the message should not be "incorect login/password". I have made a pull request to add a more informative message (#10). I also have made a PR (https://github.com/Cyr-ius/cozytouchpy/pull/8) to allow the use of the integration when some devices are not supported. This is your case @ooOO00OOoo, you have an unsupported light dimer. If @Cyr-ius cannot validate the PR, you can always try to remove the dimmer light from your account if you want to try the home-assistant integration.

For @palm17 this is more complicated since the boiler is not supported. And I don't have the time to add the support know.

If you have some python knowledge, the modification have to be done both in this project and in the low level library (https://github.com/Cyr-ius/cozytouchpy).

palm17 commented 4 years ago

Thank you for your reply and the time spent looking for my problem. But i don t have python knowledge ; so, i'm waiting for a new release with the supported boiler ! Thanks for your help !

bestlibre commented 4 years ago

The PR were merged. And I have seen that a PR was also merged with preliminary support for an APC Heat Pump with sensors similar to @palm17 file. Not sure if it's exactly the same and if some work is still needed in the home-assistant integration.

cyr-ius commented 4 years ago

Thank you for your reply and the time spent looking for my problem. But i don t have python knowledge ; so, i'm waiting for a new release with the supported boiler ! Thanks for your help !

I started integrating the boiler and heating box that manages the areas What are the orders you want to place.

palm17 commented 4 years ago

Hello Cyr-ius,

I would like to control the on / off of the boiler.

For heating, the room temperature (a room thermostat is coupled to the boiler), the day / night / absence instructions, and the on / off for each zone.

For domestic hot water production, on / off, and boost. I have an independent solar water heater, but with the infos of the balloon probes and home assistant, I will be able to start the heating of the balloon thanks to the command which, I hope, you will develop !!!

In fact, I would like to be able to recover as much information and orders as possible!

I know, that's a lot, but it's a new challenge for you !!

Thank you for this development!

ooOO00OOoo commented 4 years ago

hello @bestlibre . Thanks a lot. i will try to update it . I don't have some python knowlegde, but java knowlegde.

cyr-ius commented 4 years ago

please test version 1.4.5 (with HACS , enable Beta Version on my component)

palm17 commented 4 years ago

I have installed Cozytouch via HACS : it runs ! In my configuration, at home, i have one boiler, one room sensor, one external sensor. The integration creates 4 devices and 3 entities

It is late for me. Go to bed.

Thank you for your app Cyr-ius, and your reactivity !

ooOO00OOoo commented 4 years ago

Hello,

i updated Cozytouch with the last version, and it's ok for me too, i see my 3 devices.

Thanks a lot.

cyr-ius commented 4 years ago

I have installed Cozytouch via HACS : it runs ! In my configuration, at home, i have one boiler, one room sensor, one external sensor. The integration creates 4 devices and 3 entities

* Maison (zone name in the cozytouch smartphone app)
  ----- 1 entity : room temperature

* Cozytouch (no entity, but the firmware of the bridge i think)

* All house Atlanticpassapcdhw
  ----- 1 entity : room temperature (name different than the first)

* All house Atlanticpassapcboiler
  ------ 1 entity : sensor.all_house_atlanticpassapcboiler (i don't know what is it)

It is late for me. Go to bed.

Thank you for your app Cyr-ius, and your reactivity !

In your json, I see the following equipment (widget):

cyr-ius commented 4 years ago

I consider the thermostat as a heater, both in the cozytouchpy API and in the HA plugin Can you tell me what you see?

palm17 commented 4 years ago

In your json, I see the following equipment (widget):

  • Pod --> Cozytouch Bridge (no entity , only firmware , it's OK)
  • AtlanticPassAPCBoiler -> Boiler
  • AtlanticPassAPCDHW -> Water Heater in Boiler or independent ???
  • TemperatureSensor
  • CumulativeFossilEnergyConsumptionSensor
  • CumulativeFossilEnergyConsumptionSensor
  • CumulativeFossilEnergyConsumptionSensor
  • AtlanticPassAPCHeatingZone -> Maison -> Room Thermostat
  • TemperatureSensor

I consider the thermostat as a heater, both in the cozytouchpy API and in the HA plugin Can you tell me what you see?

I don' know want you mean with "can you tell me what you see ?"

Here my screen capture :

https://www.dropbox.com/sh/35w8vk0apm0cqxs/AAD3bVSjJ-6P4CBj6Zo-2i-Ea?dl=0

Tell me if it is that you want. And if it is all that you want, or more. Thanks.

palm17 commented 4 years ago

Just an information : i have installed your last release ; all my 3 entities are unavailable. Thanks.

cyr-ius commented 4 years ago

Just an information : i have installed your last release ; all my 3 entities are unavailable. Thanks.

In latest version I ve a little bug, please selection Integration/Cozytouch/ Option : all and restart HA Only if you've a heaters If KO , please enable debug log in configuration.yaml

logger:
  default: info
  logs:
    custom_components.cozytouch: debug
    cozytouchpy: debug
palm17 commented 4 years ago

It's OK after restart HA. Now i have 1 additional entity : switch.all_house_maison. Scenario : In the app on smartphone, the heating zone is on (prog) ; When i click on the switch, after 2-3s, it returns to its initial position (on - click - off ...... on). In the app on the smartphone, the heating zone change to off -- Yeah !!!! But the sensor Atlanticpassapcboiler stands in the heating position. When i toggle off the boiler on the smarthphone app, the sensor Atlanticpassapcboiler show "stop". When i click on the switch in HA, it returns to its initial position, but nothing appends : the heating zone stays off.

For the AtlanticPassAPCDHW temperature, it's an independant heater (solar heater with independant reglation); for the boiler, only one sensor is connected : heat of the hot water tank. For the moment, the AtlanticPassAPCDHW is the same at the room sensor.

Have a nice day.

cyr-ius commented 4 years ago

It's OK after restart HA. Now i have 1 additional entity : switch.all_house_maison. Scenario : In the app on smartphone, the heating zone is on (prog) ; When i click on the switch, after 2-3s, it returns to its initial position (on - click - off ...... on). In the app on the smartphone, the heating zone change to off -- Yeah !!!! But the sensor Atlanticpassapcboiler stands in the heating position. When i toggle off the boiler on the smarthphone app, the sensor Atlanticpassapcboiler show "stop". When i click on the switch in HA, it returns to its initial position, but nothing appends : the heating zone stays off.

For the AtlanticPassAPCDHW temperature, it's an independant heater (solar heater with independant reglation); for the boiler, only one sensor is connected : heat of the hot water tank. For the moment, the AtlanticPassAPCDHW is the same at the room sensor.

Have a nice day.

OK , please test version 1.4.8 (beta) Add Heater from Heating Zone Add DHW from APC Water Heater I've add a service to select mode for a boiler. (Please look service in HA)

palm17 commented 4 years ago

I have installed 1.4.9. Now i have 5 devices and 6 entities :

And in service, i have 3 choices :

Wich mode can we use for each service (on off prog...). I try some of them, with no result.

Thank you for your time ! Have a nice day !

Edit : i did not see the card in HA ! Great ! I play with and i say you !

palm17 commented 4 years ago

After the game ;-), my findings :

-The 4 icons don't work for me - i understand it is for heat pump, but when i click on the standby button, an error "Echec d'appel du service "climate/set_hvac_mode".'CozytouchHeater' object has no attribute 'set_targeting_mode' ; -The temperature setpoint are OK ; -The ambiant temperature is OK ; -When i switch from "internal scheddle" to "eco" in the préréglage menu, in the smartphone app, it switch from "PROG." to "MANU", but with the Confort temperature, not the Eco. -When i switch to "stop" in the préréglage menu, in the smartphone app, it switch to "MANU", with the Confort temperature

For the stop menu, you put the temperature at 0,0 ? You can't put off the Zone ?

Thanks for this great work !

cyr-ius commented 4 years ago

Please check new version 1.5.1

palm17 commented 4 years ago

Hello,

I installed the new version. Now, i have only two buttons in the card : on(fire) and standby. But none works : When I click under the fire button, wich is activate (but the heater is off) I have the error "Echec de l'appel du service "climate/set_hvac_mode". Unsupported command setcoolingonoffstate". When i click under standby, nothing happens... Now, i have the outdoor temperature. Great !! For the sanitary hot water, the entity "Atlanticpassapcdhw" seems not working : when i change the temperature, i have an error "Echec de l'appel du service "water_heater/set_temperature". Unsupported state core : TargetTemperatureState ". And to finish, i have a sensor in the water tank : can you create an entity to know his value ? Thanks a lot for this integration !

cyr-ius commented 4 years ago

Please test 1.5.4.

When I look at the json, I see only 4 commands for the water heater: setComfortTargetDHWTemperature setDHWOnOffState setEcoTargetDHWTemperature setPassAPCDHWMode

In component 1.5.4, I try to use setComfortTargetDHWTemperature to set the temperature.

Since I do not have the equipment, the most practical would be to know which commands are used for what in the application.

It is possible to find out by installing Parallels Space and Http Canary by generating a certificate on its android equipment.

Parallels Space allows you to create a second space within Android to launch applications in a sandbox, and http canary is the equivalent of wireshark (this takes network traces) HTTP Canary intercept calls from the sandbox, and you see the rest api calls if we launch the application in Parallels Space.

palm17 commented 4 years ago

Hello,

I try the 1.5.6. I have the same issue than the 1.5.1 for heating.

For the water heater, sorry : in the app Android, we can't see the water temperature ; we can put only "off", "prog", and "boost" when "prog" is selected.

I try HTTP Canary and Parallels Space, but it is not simple to use for me. If you want something with this apps, tell me and i will persevere for use those.

Thanks !