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

Add support for "Floor Heating Airflow" #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

droscy
Copy link
Contributor

@droscy droscy commented Nov 5, 2022

No description provided.

@rploeg
Copy link

rploeg commented Nov 5, 2022

@droscy I get this message when I select the Floorheating (and any other option in the swingmode:

2022-11-05_08-42-43

@droscy
Copy link
Contributor Author

droscy commented Nov 6, 2022

Hi @rploeg, I cannot replicate your error...

Actually I don't have Floor Heating, what I did is taking the PR and replacing floorHeatingAirflow with windNice, this way the code is the same but applies to Comfort Airflow, and everything works.

Did you restarted Home Assistant after replacing the integration?

Could you enable debug log adding the following lines in configuration.yaml file?

logger:
  default: info
  logs:
    custom_components.daikin_residential: debug

Then restart HA and try again. You should see in the log file something like the following when you enable the floor heating

DEBUG (MainThread) [custom_components.daikin_residential.device] Trying to validate `floorHeatingAirflow` for fanControl with description: {'value': 'swing', 'settable': True, 'values': ['stop', 'swing', 'floorHeatingAirflow']}
DEBUG (MainThread) [custom_components.daikin_residential.device] Path: /v1/gateway-devices/XXXXXXXX/management-points/climateControl/characteristics/fanControl , options: {'method': 'PATCH', 'json': '{"value": "floorHeatingAirflow", "path": "/operationModes/heating/fanDirection/vertical/currentMode"}'}
DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER REQUEST JSON: {"value": "floorHeatingAirflow", "path": "/operationModes/heating/fanDirection/vertical/currentMode"}
DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER RESPONSE CODE: 204
DEBUG (MainThread) [custom_components.daikin_residential.device] RES IS True

@rploeg
Copy link

rploeg commented Nov 6, 2022

Yes, had rebooted. Here the logfile:

2022-11-06 09:58:36.358 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2507743344] Please provide a valid datapoint definition that exists in the data structure Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call await result File "/config/custom_components/daikin_residential/climate.py", line 247, in async_set_swing_mode await self._device.async_set_swing_mode(swing_mode) File "/config/custom_components/daikin_residential/daikin_base.py", line 292, in async_set_swing_mode await self.setValue(ATTR_HSWING_MODE, new_hMode) File "/config/custom_components/daikin_residential/daikin_base.py", line 138, in setValue return await self.set_data(cmd_set[0], cmd_set[1], cmd_set[2], value) File "/config/custom_components/daikin_residential/device.py", line 334, in set_data raise Exception( Exception: Please provide a valid datapoint definition that exists in the data structure

So I don't see directly floorheatingairflow that you mention in your example. But above is also the failed service that I see in my interface

@droscy
Copy link
Contributor Author

droscy commented Nov 6, 2022

File "/config/custom_components/daikin_residential/daikin_base.py", line 292, in async_set_swing_mode await self.setValue(ATTR_HSWING_MODE, new_hMode)

The error originates from horizontal swing (ATTR_HSWING_MODE) that you don't have, indeed your fanDirection contains only "vertical" mode

"fanDirection": {
  "vertical": {
    "currentMode": {
      "value": "stop",
      "settable": true,
      "values": [
        "stop",
        "swing",
        "floorHeatingAirflow"
      ]
    }
  }
}

Have you ever tried to set "Vertical" swing mode without the PR? If you have not, could you try?

Then, with PR applied, replace file daikin_base.py with this one and try again. Thanks.

@rploeg
Copy link

rploeg commented Nov 7, 2022

@droscy Sorry didn't had the time to go back to oirginal (time issue), so I have replaced the daikin_base.py with yours. I see this back in the logs (doesnt update):

RES IS True 2022-11-07 15:08:49.617 DEBUG (MainThread) [custom_components.daikin_residential.device] Trying to validate floorHeatingAirflowfor fanControl with description: {'value': 'stop', 'settable': True, 'values': ['stop', 'swing', 'floorHeatingAirflow']} 2022-11-07 15:08:49.617 DEBUG (MainThread) [custom_components.daikin_residential.device] Path: /v1/gateway-devices/ID/management-points/climateControl/characteristics/fanControl , options: {'method': 'PATCH', 'json': '{"value": "floorHeatingAirflow", "path": "/operationModes/heating/fanDirection/vertical/currentMode"}'} 2022-11-07 15:08:49.618 DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER REQUEST URL: https://api.prod.unicloud.edc.dknadmin.be/v1/gateway-devices/ID/management-points/climateControl/characteristics/fanControl 2022-11-07 15:08:49.618 DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER REQUEST HEADERS: {'user-agent': 'Daikin/1.6.1.4681 CFNetwork/1209 Darwin/20.2.0', 'x-api-key': 'API KEY', 'Authorization': 'Bearer KEY', 'Content-Type': 'application/json'} 2022-11-07 15:08:49.618 DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER REQUEST JSON: {"value": "floorHeatingAirflow", "path": "/operationModes/heating/fanDirection/vertical/currentMode"} 2022-11-07 15:08:49.830 DEBUG (MainThread) [custom_components.daikin_residential.daikin_api] BEARER RESPONSE CODE: 204

@droscy
Copy link
Contributor Author

droscy commented Nov 7, 2022

That log is ok, I posted exaclty the same previously (see the end of the post).
Response 204 means the cloud server processed correctly your request.
Are you sure it doesn't work?

@rploeg
Copy link

rploeg commented Nov 7, 2022

In the Daikin app the vertical airflow is still on Swing off (not Swing or FloorHeating). If I select the one of the two options in the interface I returns with an empty options:

image

If I change the swing mode to one of these modes:
image

I don't see that reflected in the app, also not after a while.

@droscy
Copy link
Contributor Author

droscy commented Nov 7, 2022

I'll try to replicate your environment and test... what's your HA version?

I need your full debug log of the integration, so please:

  1. set swing off in the app
  2. restart HA
  3. select "Floor Heating" in HA
  4. extract from the log all lines with daikin_residential

Thanks

@droscy
Copy link
Contributor Author

droscy commented Nov 7, 2022

Yes, I replicated your UI misbehaviour fooling horizontal swing of one of my unit.
Don't do any tests, I'll try to fix myself, stay tuned ;-)

immagine

@droscy
Copy link
Contributor Author

droscy commented Nov 10, 2022

@rploeg, please, try again the PR with latest commit.

@rploeg
Copy link

rploeg commented Nov 10, 2022

thanks I can confirm that it is working now.

Copy link

@trullock trullock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is clean, i've tested it and it seems to work

@trullock
Copy link

@rospogrigio can this be merged please?

@krazar
Copy link

krazar commented Feb 9, 2023

Hello,
what is blocking this PR ?

@trullock
Copy link

trullock commented Feb 9, 2023

@krazar I've included this in my fork, swap to that whilst you wait if you want

@domerich
Copy link

domerich commented Feb 21, 2023

Hi guys I tried out this fork but home assistant would not accept it.

For a n00nb, please what code or files should I use to test the floor heating?
#118

I recovered the files from the backup to make it work again

@droscy
Copy link
Contributor Author

droscy commented Feb 21, 2023

Hi @domerich, if you installed this integration manually you could simply replace every file inside custom_components/daikin_residential/ folder with files inside the same path from @trullock fork (direct link to zip file is https://github.com/trullock/daikin_residential/archive/refs/heads/master.zip) then restart Home Assistant.

If you face any problems please enable debug log adding the following code to configuration.yaml file

logger:
  default: info
  logs:
    custom_components.daikin_residential: debug

then restart Home Assistant and send us the new log file (remove sensible data from the log before sending, i.e. lines with BEARER REQUEST HEADERS)

@domerich
Copy link

Hi @domerich, if you installed this integration manually you could simply replace every file inside custom_components/daikin_residential/ folder with files inside the same path from @trullock fork (direct link to zip file is https://github.com/trullock/daikin_residential/archive/refs/heads/master.zip) then restart Home Assistant.

If you face any problems please enable debug log adding the following code to configuration.yaml file

logger:
  default: info
  logs:
    custom_components.daikin_residential: debug

then restart Home Assistant and send us the new log file (remove sensible data from the log before sending, i.e. lines with BEARER REQUEST HEADERS)

ok thanks that zip file works for me. For automations the mode cannot be selected from a drop down menu but has to be entered manually but it works. Example

service: climate.set_swing_mode
data:
  swing_mode: Floor Heating
target:
  entity_id:
    - climate.zimmer3

Unfortunatelly it is not possible to start the device with the top flap closed so it always hits my desk. I think I will just have to remove it alltogether.

@trullock
Copy link

ok thanks that zip file works for me. For automations the mode cannot be selected from a drop down menu but has to be entered manually but it works.

I think this is a HA Core limitation isnt it? Are you talking about Swing Mode? If someone can point me at the API docs that show otherwise I'll patch it accordingly

@domerich
Copy link

domerich commented Feb 21, 2023

ok thanks that zip file works for me. For automations the mode cannot be selected from a drop down menu but has to be entered manually but it works.

I think this is a HA Core limitation isnt it? Are you talking about Swing Mode? If someone can point me at the API docs that show otherwise I'll patch it accordingly

about the automations I do not know, sometimes you can choose from a drop down menu so I think this is fixable

@jwillemsen
Copy link
Contributor

Can you try https://github.com/jwillemsen/daikin_residential_altherma/releases/tag/v3.1.0, made some changes to support more swing modes today

@jwillemsen
Copy link
Contributor

I have created a PR to my forked version to add floor heating airflow, maybe you can test this, see jwillemsen/daikin_onecta#35

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

Successfully merging this pull request may close these issues.

6 participants