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

Support for other device types and brands #25

Closed
sjtrny opened this issue May 28, 2023 · 37 comments
Closed

Support for other device types and brands #25

sjtrny opened this issue May 28, 2023 · 37 comments

Comments

@sjtrny
Copy link

sjtrny commented May 28, 2023

Hi, I'd like to propose supporting device types (water heater etc), which use the same hardware and IoT platform. For example in Australia the EvoHeat line of residential hot water heaters use the same infrastructure.

Currently setup fails for my EvoHeat unit as requests to cloudservice/api/app/device/deviceList.json do not return any devices in object_result.

Example:

curl -v -X POST \
      -H 'Content-Type: application/json' \
      -H 'x-token: $XTOKEN$' \
      https://cloud.linked-go.com/cloudservice/api/app/device/deviceList.json

which returns

{
  "error_code" : "0",
  "error_msg" : "Success",
  "error_msg_code" : "",
  "object_result" : [ ],
  "is_reuslt_suc" : true
}

However I have discovered by sniffing the HTTP requests from the HiTemp app that the endpoint will return data when specifying the product_ids in the request body.

For example here's the CURL command that I used (with x-token removed) for my EvoHeat 270 unit

curl -v -X POST \
      -H 'Content-Type: application/json' \
      -H 'x-token: $SECRETTOKEN$' \
      -d '{"product_ids":["1245226668902080512"]}' \
      http://cloud.linked-go.com:84/cloudservice/api/app/device/deviceList.json

which returns

{
  "error_code" : "0",
  "error_msg" : "Success",
  "error_msg_code" : "",
  "object_result" : [ {
    "device_status" : "ONLINE",
    "device_name" : null,
    "is_fault" : false,
    "device_id" : "$MYDEVICEID$",
    "device_code" : "$MYDEVICECODE$",
    "product_id" : "1245226668902080512",
    "device_type" : null,
    "device_nick_name" : "$MYDEVICECODE$"
  } ],
  "is_reuslt_suc" : true
}

The HiTemp app uses HTTP over port 84 but It does also work with HTTPS on the default port i.e. (https://cloud.linked-go.com/)

@sjtrny
Copy link
Author

sjtrny commented May 28, 2023

Just tested with requesting for multiple product IDs. I guess we can just shotgun out a list of known product IDs in the request as long as the product IDs are constant.

curl -v -X POST \
      -H 'Content-Type: application/json' \
      -H 'x-token: $SECRETTOKEN$' \
      -d '{"product_ids":["1132174963097280512", "1245226668902080512"]}' \
      https://cloud.linked-go.com/cloudservice/api/app/device/deviceList.json

which returns

{
  "error_code" : "0",
  "error_msg" : "Success",
  "error_msg_code" : "",
  "object_result" : [ {
    "device_status" : "ONLINE",
    "device_name" : null,
    "is_fault" : false,
    "device_id" : "$MYDEVICEID$",
    "device_code" : "$MYDEVICECODE$",
    "product_id" : "1245226668902080512",
    "device_type" : null,
    "device_nick_name" : "$MYDEVICECODE$"
  } ],
  "is_reuslt_suc" : true
}

@sjtrny sjtrny changed the title Support for other brands Support for other device types and brands May 29, 2023
This was referenced Jun 1, 2023
@elad-bar
Copy link
Collaborator

elad-bar commented Jun 4, 2023

can you please confirm whether it's working?

thanks

@elad-bar
Copy link
Collaborator

elad-bar commented Jun 9, 2023

@sjtrny any updates?

Thanks

@sjtrny
Copy link
Author

sjtrny commented Jun 9, 2023

Nope not working. I deleted everything and installed fresh. Adding the integration proceeds successfully but no entities/devices are created. There aren't any errors in the logs though.

@elad-bar
Copy link
Collaborator

elad-bar commented Jun 9, 2023

Released v3.0.9 with your product, pls test and let me know if it works

thanks

@elad-bar
Copy link
Collaborator

@sjtrny can you pls update?

Thanks

@sjtrny
Copy link
Author

sjtrny commented Jun 14, 2023

I've updated to v3.0.10 and it kind of works.

  • Not every entity that I would expect is present
  • Some entities shown have unknown values (not updating)
  • I think some have the wrong name

I think this is because my unit is a hot water heater unit rather than a pool heater.

@elad-bar
Copy link
Collaborator

Can you share the diagnostic details?
In v3.0.10 it will include details within components, api and configuration of device, so it will be easier for me to understand

In addition, what is the expectation in terms of the name vs. actual, same for expectation from entity to be presented vs. actual

Thanks

@sjtrny
Copy link
Author

sjtrny commented Jun 14, 2023

Missing entities that I care about:

  • Disinfection target temp
  • Duration of disinfection
  • Startup point of disinfection
  • Cycle of disinfection
  • Target temp
  • Setpoint of booster
  • Booster startup delay

.. and the list goes on.

I think it would be better to have support for different device types that use different entity lists.

Even better if we could have a seperate Python package with those definitions and have the integration translate between HASS and the package as recommended by HASS docs:

One Home Assistant rule is that the integration should never interface directly with devices. Instead, it should interact with a third-party Python 3 library. This way, Home Assistant can share code with the Python community and keep the project maintainable.

@elad-bar
Copy link
Collaborator

managed to understand how to read the parameters dynamically, it seems that there are 6 types of devices that each of them consumes parameter with different IDs, I have all the mapping thanks for the tip about the password of parameters.

I will map it and most likely you will get all the entities.
I'm aware of the best practice by HA, but we are not there yet, for each code change we will still need to have release,
once I will get to more maturity of the code (instead of maintaining 2 repos).

@elad-bar
Copy link
Collaborator

can you pls post the login request (mask the email / password) from packet sniffer, I'm trying to understand the logic of choosing the parameters the app is using

thanks

@sjtrny
Copy link
Author

sjtrny commented Jun 15, 2023

Here's the login request

POST /crmservice/api/app/user/login HTTP/1.1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: 
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.3.1; Scale/3.00)
Accept-Language: en-AU;q=1
Content-Length: 121
Accept-Encoding: gzip, deflate, br

{
  "password" : "$HASHED PASSWORD$",
  "loginSource" : "IOS",
  "appId" : "13",
  "type" : "2",
  "userName" : "$EMAIL$"
}

and the response

HTTP/1.1 200  
Date: Thu, 15 Jun 2023 10:29:10 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY

{
  "sessionid": null,
  "error_code": "0",
  "error_msg": "Success",
  "error_msg_code": "",
  "totalSize": null,
  "totalPage": null,
  "nextPage": null,
  "objectResult": {
    "userId": "$USER ID$",
    "userName": "$EMAIL$",
    "nickName": "$EMAIL$",
    "realName": null,
    "userPassword": null,
    "x-token": "$TOKEN$",
    "user_id": "$USER ID$",
    "user_name": "$EMAIL$",
    "nick_name": "$EMAIL$",
    "real_name": null,
    "user_type": "Customer",
    "accessKey": "$RANDOM KEY$"
  },
  "isReusltSuc": true
}

@sjtrny
Copy link
Author

sjtrny commented Jun 15, 2023

Not sure if this helps but here's the request to get all the params

POST /crmservice/api/app/device/getDataByCode HTTP/1.1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: $TOKEN$
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.3.1; Scale/3.00)
Accept-Language: en-AU;q=1
Content-Length: 594
Accept-Encoding: gzip, deflate, br

{
  "appId" : "13",
  "protocalCodes" : [
    "Power",
    "Mode",
    "mode_real",
    "2050",
    "M17",
    "1129",
    "1133",
    "T10",
    "T02",
    "R01",
    "2011",
    "2012",
    "2013",
    "2014",
    "M06",
    "H07",
    "L02",
    "L03",
    "L04",
    "L06",
    "L07",
    "L08",
    "L09",
    "L10",
    "L11",
    "L12",
    "L13",
    "\/01",
    "\/02",
    "D01",
    "D02",
    "D03",
    "D04",
    "D05",
    "D06",
    "D07",
    "G01",
    "G02",
    "G03",
    "G04",
    "E01",
    "E02",
    "E03",
    "E04",
    "E05",
    "H01",
    "H03",
    "H99",
    "H30",
    "H31",
    "H32",
    "N01",
    "N02",
    "N03",
    "N04",
    "N05",
    "N06",
    "N07",
    "N08",
    "N09",
    "N10",
    "N11",
    "R03",
    "R04",
    "R05",
    "R06",
    "R07",
    "R08",
    "R09",
    "R10",
    "R12",
    "R14",
    "R15",
    "R17",
    "R18",
    "R19",
    "R20",
    "T01",
    "T03",
    "T04",
    "T05",
    "T06",
    "O07",
    "O08",
    "O09",
    "H98"
  ],
  "deviceCode" : "$DEVICE CODE$"
}

and response

HTTP/1.1 200  
Date: Thu, 15 Jun 2023 10:29:29 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY


{
  "sessionid": null,
  "error_code": "0",
  "error_msg": "Success",
  "error_msg_code": "",
  "totalSize": null,
  "totalPage": null,
  "nextPage": null,
  "objectResult": [{
    "value": "1",
    "code": "Power"
  }, {
    "value": "3",
    "code": "Mode"
  }, {
    "value": "3",
    "code": "mode_real"
  }, {
    "value": "0000000000110000",
    "code": "2050"
  }, {
    "value": "0",
    "code": "M17"
  }, {
    "value": "0000000000000000",
    "code": "1129"
  }, {
    "value": "0000000000000000",
    "code": "1133"
  }, {
    "value": "59.5",
    "code": "T10"
  }, {
    "value": "59.0",
    "code": "T02"
  }, {
    "value": "60.0",
    "code": "R01"
  }, {
    "value": "1.3",
    "code": "2011"
  }, {
    "value": "481",
    "code": "2012"
  }, {
    "value": "1.0",
    "code": "2013"
  }, {
    "value": "281",
    "code": "2014"
  }, {
    "value": "0",
    "code": "M06"
  }, {
    "value": "0",
    "code": "H07"
  }, {
    "value": "10",
    "code": "L02"
  }, {
    "value": "5",
    "code": "L03"
  }, {
    "value": "28",
    "code": "L04"
  }, {
    "value": "0",
    "code": "L06"
  }, {
    "value": "0",
    "code": "L07"
  }, {
    "value": "0",
    "code": "L08"
  }, {
    "value": "0",
    "code": "L09"
  }, {
    "value": "0",
    "code": "L10"
  }, {
    "value": "0",
    "code": "L11"
  }, {
    "value": "0",
    "code": "L12"
  }, {
    "value": "0",
    "code": "L13"
  }, {
    "value": "0",
    "code": "/01"
  }, {
    "value": "0",
    "code": "/02"
  }, {
    "value": "-3.0",
    "code": "D01"
  }, {
    "value": "13.0",
    "code": "D02"
  }, {
    "value": "45",
    "code": "D03"
  }, {
    "value": "8.0",
    "code": "D04"
  }, {
    "value": "3.0",
    "code": "D05"
  }, {
    "value": "0",
    "code": "D06"
  }, {
    "value": "4.0",
    "code": "D07"
  }, {
    "value": "70.0",
    "code": "G01"
  }, {
    "value": "30",
    "code": "G02"
  }, {
    "value": "12",
    "code": "G03"
  }, {
    "value": "7",
    "code": "G04"
  }, {
    "value": "1",
    "code": "E01"
  }, {
    "value": "5.0",
    "code": "E02"
  }, {
    "value": "240",
    "code": "E03"
  }, {
    "value": "100",
    "code": "E04"
  }, {
    "value": "480",
    "code": "E05"
  }, {
    "value": "1",
    "code": "H01"
  }, {
    "value": "0",
    "code": "H03"
  }, {
    "value": "0",
    "code": "H99"
  }, {
    "value": "1",
    "code": "H30"
  }, {
    "value": "1",
    "code": "H31"
  }, {
    "value": "5",
    "code": "H32"
  }, {
    "value": "0",
    "code": "N01"
  }, {
    "value": "15",
    "code": "N02"
  }, {
    "value": "5.0",
    "code": "N03"
  }, {
    "value": "0",
    "code": "N04"
  }, {
    "value": "0",
    "code": "N05"
  }, {
    "value": "6",
    "code": "N06"
  }, {
    "value": "70.0",
    "code": "N07"
  }, {
    "value": "10.0",
    "code": "N08"
  }, {
    "value": "68.0",
    "code": "N09"
  }, {
    "value": "70.0",
    "code": "N10"
  }, {
    "value": "0",
    "code": "N11"
  }, {
    "value": "5.0",
    "code": "R03"
  }, {
    "value": "0",
    "code": "R04"
  }, {
    "value": "55.0",
    "code": "R05"
  }, {
    "value": "200",
    "code": "R06"
  }, {
    "value": "0",
    "code": "R07"
  }, {
    "value": "-5.0",
    "code": "R08"
  }, {
    "value": "10.0",
    "code": "R09"
  }, {
    "value": "25.0",
    "code": "R10"
  }, {
    "value": "-15.0",
    "code": "R12"
  }, {
    "value": "45.0",
    "code": "R14"
  }, {
    "value": "78.0",
    "code": "R15"
  }, {
    "value": "0",
    "code": "R17"
  }, {
    "value": "1.0",
    "code": "R18"
  }, {
    "value": "65.0",
    "code": "R19"
  }, {
    "value": "60.0",
    "code": "R20"
  }, {
    "value": "15.0",
    "code": "T01"
  }, {
    "value": "59.5",
    "code": "T03"
  }, {
    "value": "11.0",
    "code": "T04"
  }, {
    "value": "19.0",
    "code": "T05"
  }, {
    "value": "76.5",
    "code": "T06"
  }, {
    "value": "480",
    "code": "O07"
  }, {
    "value": "44",
    "code": "O08"
  }, {
    "value": "4",
    "code": "O09"
  }, {
    "value": "2",
    "code": "H98"
  }],
  "isReusltSuc": true
}

@sjtrny
Copy link
Author

sjtrny commented Jun 15, 2023

While I’m here - this integration should probably be renamed if there is support for other products. I’d suggest using the manufacturer’s name PHNIX instead.

@elad-bar
Copy link
Collaborator

it seems that your app requesting from different url (/crmservice/api/app/device/getDataByCode vs cloudservice/api/app/device/getDataByCode.json)

can you please write its name?

@sjtrny
Copy link
Author

sjtrny commented Jun 22, 2023

Hitemp. I mentioned it in the first post in this thread.

@elad-bar
Copy link
Collaborator

Missed it, will investigate it further

@elad-bar
Copy link
Collaborator

extracted all parameter list from the mobile app, but since I don't have supporting device I will need some screenshots to define you parameters correctly, can you please take a screenshot of each letter in the parameter settings (using code 022 and afterwards 066)?

thanks

@elad-bar
Copy link
Collaborator

created new beta version v3.0.11b,
please let me know if it creates all relevant entities (most likely you will still need to provide me screenshots as described below since I don't know what your parameters representing),
in addition, added section in readme to describe how I extract entities and what to do when it's not working as you wish, since it's not an official release, below is a copy of that secion:

Per product ID

Additional components are according to following mapping:

Device's Product ID Parameter
Default JSON
Hitemp 1245226668902080512 JSON
AquaTemp 1442284873216843776 JSON

Note:

If mapping for your device are incorrect, please follow the steps below before reporting an issue:

  1. Install on your mobile device packet sniffer (I'm using for Android - NetCapture)
  2. Activate the packet sniffer just for the app
  3. Open the app
  4. Login
  5. Open relevant device
  6. Open menu
  7. Click on Parameter Settings
  8. First cycle, use password for user parameters, code: 022
  9. Take screenshot of each screen (letter)
  10. Repeat steps 8 & 9 with code 066 - factory parameters
  11. Open packet sniffer app and extract requests (and responses) of login, deviceList, getDataByCode

Attach the following details to issue:

  • Mobile App name and version
  • Attach screenshots and logs as zip file or link for download
  • Attach diagnostic details from HA integration

In addition, create a discord channel for faster support and discussion - https://discord.gg/6B6fakaK

@elad-bar
Copy link
Collaborator

investigating more you device made me understand it works differently than AquaTemp,
in AquaTemp you can define and read the temperature for each of the modes, in Hitemp you have one configuration,
I think I mapped it (not released it yet), but I will need also to have request / response of changing modes, in each of the modes changing at least 1 time temperature,
once I have it, the component will work 100% for you.

@sjtrny
Copy link
Author

sjtrny commented Jun 24, 2023

I haven't tested v3.0.11b yet. Probs not worth it until parameters are mapped. Info below.

Parameter Pages

evoheat_imgs.zip

Mode Change

Mode list:

  • 0: "Intelligent mode"
  • 2: "Eco mode"
  • 3: "Hybrid mode"
  • 4: "Fast heating mode"

Request

This example sets device to mode 0 i.e. "Intelligent mode".

POST /crmservice/api/app/device/control HTTP/1.1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: $ X TOKEN $
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.5; Scale/3.00)
Accept-Language: en-AU;q=1
Content-Length: 93
Accept-Encoding: gzip, deflate, br

{
  "param" : [
    {
      "value" : "0",
      "protocolCode" : "mode_real",
      "deviceCode" : "$ DEVICE ID $"
    }
  ],
  "appId" : "13"
}

Response

HTTP/1.1 200  
Date: Sat, 24 Jun 2023 05:28:58 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY

{
  "sessionid": null,
  "error_code": "0",
  "error_msg": "Success",
  "error_msg_code": "",
  "totalSize": null,
  "totalPage": null,
  "nextPage": null,
  "objectResult": null,
  "isReusltSuc": true
}

Temp Change

I found that adjusting temperature in each mode was the same request regardless of the mode.

Request

POST /crmservice/api/app/device/control HTTP/1.1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: $ X TOKEN $
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.5; Scale/3.00)
Accept-Language: en-AU;q=1
Content-Length: 90
Accept-Encoding: gzip, deflate, br

{
  "param" : [
    {
      "value" : "60.0",
      "protocolCode" : "R01",
      "deviceCode" : "$ DEVICE ID $"
    }
  ],
  "appId" : "13"
}

Response

HTTP/1.1 200  
Date: Sat, 24 Jun 2023 05:42:36 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY

{
  "sessionid": null,
  "error_code": "0",
  "error_msg": "Success",
  "error_msg_code": "",
  "totalSize": null,
  "totalPage": null,
  "nextPage": null,
  "objectResult": null,
  "isReusltSuc": true
}

@elad-bar
Copy link
Collaborator

Thanks for the details, really aligned with what I have saw, 3.0.11c (will be released soon) might be usefull gor you as result of it,
A question about mode,
What do you think will be the right mapping of modes to HA HVAC modes:
Hitemp Mode list:

0: "Intelligent mode"
2: "Eco mode"
3: "Hybrid mode"
4: "Fast heating mode"

HvacModes in HA:
https://developers.home-assistant.io/docs/core/entity/climate/#hvac-modes

In addition, can you pls post a request to change fan mode (if supported)?

@sjtrny
Copy link
Author

sjtrny commented Jun 24, 2023

Modes

It should be mapped to the Water Heater entity type not HVAC https://developers.home-assistant.io/docs/core/entity/water-heater#states

0: "Intelligent mode" -> STATE_PERFORMANCE (operation mode based on ambient air temp)
2: "Eco mode" -> STATE_HEAT_PUMP (this is heat pump only)
3: "Hybrid mode" -> STATE_ECO (heat pump + electric element backup after X amount of time if target temp not reached)
4: "Fast heating mode" -> STATE_HIGH_DEMAND (heat pump + electric element immediately)

Extra features

Change electric element state manually

  • protocolCode: "MO6"
  • value:
    • "1": ON
    • "2" OFF
POST /crmservice/api/app/device/control
HTTP / 1. 1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: $ X TOKEN $
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.5; Scale/3.00)
Accept-Language: en-AU; q=1
Accept-Encoding: gzip, deflate, br

{
"param" : [
{
"value": "1",
"protocolCode": "MO6"
"deviceCode" : "$ DEVICE CODE $"
}
],
"appld" : "13"
}

Change fan state manually

  • protocolCode: "M17"
  • value:
    • "0": OFF
    • "1": LOW
    • "2" HIGH
POST /crmservice/api/app/device/control
HTTP / 1. 1
Host: cloud.linked-go.com:449
Content-Type: application/json
Connection: keep-alive
x-token: $ X TOKEN $
Accept: application/json
User-Agent: Hitemp/1.1.6 (iPhone; iOS 16.5; Scale/3.00)
Accept-Language: en-AU; q=1
Accept-Encoding: gzip, deflate, br

{
"param" : [
{
"value": "1",
"protocolCode": "M17"
"deviceCode" : "$ DEVICE CODE $"
}
],
"appld" : "13"
}

@elad-bar
Copy link
Collaborator

Was not familiar with that entity, make more sense,
Will check it out

@elad-bar
Copy link
Collaborator

Water heater doesn't support fan speed, should it be another fan entity,
What I can do also is to create 2 entities for you device, vlimate to control as heat and off with fan control, 2nd entity will be water heater to control it modes,
What do you think will work better,
For other devices like mine, it support cooling, heating, auto according to target temp and off with fan control, climate more suitable for that kind of devices

What do you think about it?
We can keep the discussion over discord if you would like:
https://discord.gg/6B6fakaK

@sjtrny
Copy link
Author

sjtrny commented Jun 24, 2023

To be honest there’s no real reason to control the fan speed. It’s the fan speed for the condenser coils and should only be controlled by the device’s internal controller. It’s the equivalent of controlling the fan on your fridge’s condenser coils - pointless!

I think it’s just been lazily left in the app by the developer.

Similar argument applies to the electric element. You can immediately turn it on (if below target temp) by selecting fast heating mode.

Overall I’d much rather abandon those two controls and have the device correctly mapped to the water heater type.

@elad-bar
Copy link
Collaborator

not accurate (at least for me), I agree that most of the time it should be on auto state,
but when we are setting in the backyard we don't want the fan to be strong, so we make it more silent (availabel option for inverter units).

with the climate control, you can turn off or on to the specific mode you would like, or just play with them,
but i got you point

working on the support for you device

@elad-bar
Copy link
Collaborator

released v3.0.11c for testing,
I didn't add yet the water heater entity, but adjusted it for your parameters (according to all the information you have provided),
it will create all parameters as sensors and climate for your device will include just off and heat.

can you please update and let me know if it works for you?
next step will be to add the water entity

@sjtrny
Copy link
Author

sjtrny commented Jun 25, 2023

I removed the device, downloaded 3.0.11c, restarted and tried to add the device. On the login popup I get the message "Unknown error occurred".

Here's the exception

2023-06-25 10:01:14.330 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 181, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aqua_temp/config_flow.py", line 43, in async_step_user
    api = AquaTempAPI(self.hass, config_manager)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AquaTempAPI.__init__() missing 1 required positional argument: 'product_configuration_manager'

@elad-bar
Copy link
Collaborator

Version 3.0.11 was released with fix for that

@sjtrny
Copy link
Author

sjtrny commented Jun 25, 2023

I tried re-installing a few times and nothing changed.

I notice that on the Custom-component branch that the code hasn't changed i.e. the API manager constructor requires three parameters but only two are passed when creating it here.

api = AquaTempAPI(self.hass, config_manager)
    def __init__(
        self,
        hass: HomeAssistant | None,
        config_manager: AquaTempConfigManager,
        product_configuration_manager: ProductConfigurationManager,
    ):

@elad-bar
Copy link
Collaborator

you are correct, don't know how I missed it, sorry, fixing and releasing new version

thanks

@elad-bar
Copy link
Collaborator

new version v3.0.12 available with the fix

@sjtrny
Copy link
Author

sjtrny commented Jun 25, 2023

Seems to be working. Lots of entities and they look correct but haven’t checked closely.

@elad-bar
Copy link
Collaborator

ok, please let me know if it works for you,
I will work during the upcoming weekend on water heater entity and will update you with release once it's done

@sjtrny
Copy link
Author

sjtrny commented Jun 30, 2023

All seems to be working after 5 days.

@elad-bar
Copy link
Collaborator

Amazing, can you pls close that issue and open issue for supporting the water heater entity?
Will try to get to it this weekend

Thanks

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

2 participants