Apoc182 / local_daikin

A home assistant integration for integrating Daikin air conditioners running firmware version 2.8.0 to Home Assistant.
16 stars 3 forks source link

Compatibility #16

Open serimi89 opened 1 month ago

serimi89 commented 1 month ago

Hey there and thanks for this amazing project! The community is always stronger :)

I own multiple devices and have tried it on three different set ups without success:

BRP069A8x - FW 4_0_3 BRP069C8x - FW 1_30_0 BRP069C4x - FW 1_31_0

All of these units are not accessible via local API, just cloud, so in theory they should be compatible with your work. So I am wondering if I am doing something wrong?

  1. Installed your repo via HACS

  2. added below to configuration.yaml

    climate:
    - platform: local_daikin
    ip_address: 192.168.1.69
  3. restarted

  4. checked for any new climate entities

Thanks for your help!

Seb

Apoc182 commented 1 month ago

Hi @serimi89 !

Just to confirm a few things:

  1. Are your devices using firmware version 2.8.0? You can find this information in the "mobile controller" app.
  2. The ip_address for each device is also listed in the app I believe, but you can also find this in your router's settings. You list multiple ips like so:
local_daikin:
  ip_address:
    - x.x.x.x
    - x.x.x.y
    etc.

If you can answer these questions, we can get to the bottom of it!

Apoc182 commented 1 month ago

Just letting you know, I have updated the readme to be more clear.

serimi89 commented 1 month ago

Hi @serimi89 !

Just to confirm a few things:

  1. Are your devices using firmware version 2.8.0? You can find this information in the "mobile controller" app.

I listed the firmware version above - none is on 2.8.0, however they all work with the cloud API (no local api) so I was wondering if your solution might work. At the moment it doesn't seem so - is there any other way then your integration to confirm this?

note: all my adaptors are on the latest firmware (expect for one which is on 1.30.0 => should be 1.31.0)

  1. The ip_address for each device is also listed in the app I believe, but you can also find this in your router's settings. You list multiple ips like so:
local_daikin:
  ip_address:
    - x.x.x.x
    - x.x.x.y
    etc.

yeah I know my addresses and added them as you pointed out 😄

If you can answer these questions, we can get to the bottom of it!

Apoc182 commented 1 month ago

Thanks for that.

It is designed for 2.8.0 specifically. I did it to solve the fact that the unit I just got could not be communicated with by Home Assistant. This being said, if you can provide the logs for the issue, I might be able to work it out.

chrisp250 commented 1 month ago

I did the MQTT implementation of 2.8.0 that was floating around daikin_mqtt, but then GitHub restricted my account and the repository went dark. My account was just reinstated and I was wondering where you got the detail for the API. I had seen in a few places the detail for the main parameters and controls of the unit, but you are the first one I see to have the energy and time usage counters implemented in your code. Do you have a link for the API detail? Thank you

Apoc182 commented 1 month ago

.

Hi Chrisp.

I developed this through trial and error. I had the app on my phone and I used a VPN service to monitor the requests and responses. I would every hour or so take a recording of the responses and a screenshot of the state of the app and infer from that what was changing and what each value meant. ChatGPT was quite helpful here.

I was provided with this after having implemented most of the features:

https://github.com/Apoc182/local_daikin/wiki/Translated-Daikin-Documentation

Thanks.

Apoc182 commented 1 month ago

.

Hi Chrisp.

I developed this through trial and error. I had the app on my phone and I used a VPN service to monitor the requests and responses. I would every hour or so take a recording of the responses and a screenshot of the state of the app and infer from that what was changing and what each value meant. ChatGPT was quite helpful here.

I was provided with this after having implemented most of the features:

https://github.com/Apoc182/local_daikin/wiki/Translated-Daikin-Documentation

Thanks.

Further:

https://github.com/Apoc182/local_daikin/pull/1

I didn't actually find that attribute, @martinp23 did.

chrisp250 commented 1 month ago

.

Hi Chrisp. I developed this through trial and error. I had the app on my phone and I used a VPN service to monitor the requests and responses. I would every hour or so take a recording of the responses and a screenshot of the state of the app and infer from that what was changing and what each value meant. ChatGPT was quite helpful here. I was provided with this after having implemented most of the features: https://github.com/Apoc182/local_daikin/wiki/Translated-Daikin-Documentation Thanks.

Further:

1

I didn't actually find that attribute, @martinp23 did.

Thanks for that. I reversed engineered a lot of it too, but I was stuck with the energy detail because my phone app doesn't handle any of the running counters, just the basic operation. @martinp23 would you have a link to more detail on the API?

serimi89 commented 1 month ago

Thanks for that.

It is designed for 2.8.0 specifically. I did it to solve the fact that the unit I just got could not be communicated with by Home Assistant. This being said, if you can provide the logs for the issue, I might be able to work it out.

the only related logs I could find in HA are:

2024-06-10 23:13:37.023 ERROR (MainThread) [homeassistant.components.climate] Error while setting up local_daikin platform for climate File "/config/custom_components/local_daikin/climate.py", line 153, in async_setup_platform File "/config/custom_components/local_daikin/climate.py", line 220, in initialize_unique_id

Apoc182 commented 1 month ago

Thanks for that.

It is designed for 2.8.0 specifically. I did it to solve the fact that the unit I just got could not be communicated with by Home Assistant. This being said, if you can provide the logs for the issue, I might be able to work it out.

the only related logs I could find in HA are:

2024-06-10 23:13:37.023 ERROR (MainThread) [homeassistant.components.climate] Error while setting up local_daikin platform for climate File "/config/custom_components/local_daikin/climate.py", line 153, in async_setup_platform File "/config/custom_components/local_daikin/climate.py", line 220, in initialize_unique_id

There should be some more information than this in the log. It should say what the exception was. Can you send the entire log file?

Christianb233 commented 1 month ago

Hello @Apoc182 I think I have quite the same situations with my 3 splits ; BRP069C4x - Firmware 1_31_0 BRP069C4x - Firmware 1_31_0 BRP069B4x - Firmware 1_14_88

On error on the IP of a BRP069C4x - Firmware 1_31_0 (under 192.168.1.47) is : Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/local_daikin/climate.py", line 156, in async_setup_platform await obj.initialize_unique_id(hass) File "/config/custom_components/local_daikin/climate.py", line 223, in initialize_unique_id response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://192.168.1.47/dsiot/multireq

Hoping that it will bring you more information so as to try to work on it :-)

serimi89 commented 1 month ago

Thanks for that. It is designed for 2.8.0 specifically. I did it to solve the fact that the unit I just got could not be communicated with by Home Assistant. This being said, if you can provide the logs for the issue, I might be able to work it out.

the only related logs I could find in HA are:

2024-06-10 23:13:37.023 ERROR (MainThread) [homeassistant.components.climate] Error while setting up local_daikin platform for climate File "/config/custom_components/local_daikin/climate.py", line 153, in async_setup_platform File "/config/custom_components/local_daikin/climate.py", line 220, in initialize_unique_id

There should be some more information than this in the log. It should say what the exception was. Can you send the entire log file?

ha, same here @Christianb233 😄

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:356
integration: Climate
First occurred: 10:48:01 (1 occurrences)
Last logged: 10:48:01

Error while setting up local_daikin platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/local_daikin/climate.py", line 156, in async_setup_platform
    await obj.initialize_unique_id(hass)
  File "/config/custom_components/local_daikin/climate.py", line 223, in initialize_unique_id
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://192.168.0.206/dsiot/multireq
Apoc182 commented 1 month ago

Looks like the API endpoints are different for your firmware version unfortunately. I probably won't be able to do anything about it as I don't have one to test on, but anyone else is welcome to try.

serimi89 commented 1 month ago

Have been sniffing around, but cant seem to find anything useful that goes / requests directly from the unit, but cloud is busy, as expected. How are the commands send back to the AC though? Happy to dig deeper, you think any of these lines might be interesting? daikin

martinp23 commented 1 month ago

.

Hi Chrisp. I developed this through trial and error. I had the app on my phone and I used a VPN service to monitor the requests and responses. I would every hour or so take a recording of the responses and a screenshot of the state of the app and infer from that what was changing and what each value meant. ChatGPT was quite helpful here. I was provided with this after having implemented most of the features: https://github.com/Apoc182/local_daikin/wiki/Translated-Daikin-Documentation Thanks.

Further:

1

I didn't actually find that attribute, @martinp23 did.

Thanks for that. I reversed engineered a lot of it too, but I was stuck with the energy detail because my phone app doesn't handle any of the running counters, just the basic operation. @martinp23 would you have a link to more detail on the API?

Hi Chrisp,

I had seen a hint that it should be possible to extract energy data from general searching. An API call to "/dsiot/edge/adr_0100." dumps a block called i_power, example below:

{'pn': 'i_power', 'pt': 1, 'pch': [{'pn': 'week_power', 'pt': 1, 'pch': [{'pn': 'today_runtime', 'pt': 3, 'pv': 359, 'md': {'pt': 'i'}}, {'pn': 'datas', 'pt': 3, 'pv': [6400, 5400, 1900, 7100, 5400, 4800, 6300], 'md': {'pt': 'l<i>'}}]}, {'pn': 'year_power', 'pt': 1, 'pch': [{'pn': 'previous_year', 'pt': 3, 'pv': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'md': {'pt': 'l<i>'}}, {'pn': 'this_year', 'pt': 3, 'pv': [0, 0, 0, 0, 150, 149], 'md': {'pt': 'l<i>'}}]}]}]}

It looks like today_runtime is in minutes; week_power is a list of daily total power use in Wh (the last list element increments while the system is on); year_power seems to be in kWh.

All of this is pretty tentative though. I compared to whole-house power monitoring and it looked okay, but I don't have my own separate measurements for the AC circuit alone.

Martin

fredrike commented 4 weeks ago

Have been sniffing around, but cant seem to find anything useful that goes / requests directly from the unit, but cloud is busy, as expected. How are the commands send back to the AC though? Happy to dig deeper, you think any of these lines might be interesting? daikin

Hi,

I'm the developer of the official Daikin Integration for HomeAssistant and it seems like your device on 192.168.0.206 are running the old implementation (with a call to /common/get_remote_method: https://github.com/fredrike/pydaikin/blob/5a33ef07a1a8823c8055dfb22f800d42666cb855/pydaikin/daikin_brp069.py#L68

Tazzzounet commented 2 weeks ago

@serimi89 @chrisp250

If it's still helpful.

I Have also a BRP069C4x Fw 1.31. In fact daikin with the new firmware has deleted local API Access. To only way to get access is to use Onecta and their cloud.

You can do this with this project https://github.com/jwillemsen/daikin_onecta

I just test it, it's working (but via Cloud)