gvigroux / hon

Support of all Haier, Candy, Hoover appliances integrated in the official hOn mobile app. Direct access to all possible services and parameters
MIT License
143 stars 54 forks source link

Request: set vertical airflow in Haier airconditioning #147

Open ggieling opened 3 months ago

ggieling commented 3 months ago

We have a Haier airconditioning that allows choosing the vertical airflow direction in a few steps between horizontal (0 degrees) and vertical (downward, -90 degrees). I do not find an option to choose the vertical airflow direction. I see an option to choose vertical and or horizontal swing, but not an option to choose the vertical airflow position.

Am I overlooking some option? Or is it not present as an option?

If not present, would it be possible to add such an option? If that requires additional information from my side, I will be happy to provide it. However, I am a novice with respect to Home Assistant, so I do need quite specific instructions on how to retrieve the required infromation.

Regards, Gerben

gvigroux commented 2 months ago

There is an action called: "hOn: Set wind direction vertical" that will allow to select the vertical airflow direction. Could you please try?

ggieling commented 2 months ago

Probably, I was not clear enough in defining the problem. I can set the vertical position in 5 positions varying between very high (approximately 90 degrees = horizontal) and very low (approximately 135 degrees). However, our device has an extra position, really vertical (180 degrees) and this position I cannot find using the interface

very high very_high very low very_low vertical vertical

====== I tried to detect a difference by clicking 'get settings details' twice. Once with the direction set to auto and once with direction set to vertical using the remote control, but I do not see differences:

Get all settings ('auto')

Parameters:

screenDisplayStatus: [0 - 1] - Default: 1 echoStatus: [0 - 1] - Default: 0 tempSel: [16 - 30] - Default: 22 machMode: ['0', '1', '2', '4', '6'] - Default: 0 10degreeHeatingStatus: [0 - 1] - Default: 0 silentSleepStatus: [0 - 1] - Default: 0 muteStatus: [0 - 1] - Default: 0 rapidMode: [0 - 1] - Default: 0 selfCleaningStatus: [0 - 1] - Default: 0 windSpeed: ['1', '2', '3', '5'] - Default: 5 windDirectionVertical: ['2', '4', '5', '6', '7', '8'] - Default: 5 Update settings:

service: hon.update_settings data: parameters: >- {'screenDisplayStatus':'1','echoStatus':'0','tempSel':'22','machMode':'0','10degreeHeatingStatus':'0','silentSleepStatus':'0','muteStatus':'0','rapidMode':'0','selfCleaningStatus':'0','windSpeed':'5','windDirectionVertical':'5'} target: device_id: 4d971b402709545c0f2aa5dd18a863c4

Get all settings ('vertical')

Parameters:

screenDisplayStatus: [0 - 1] - Default: 1 echoStatus: [0 - 1] - Default: 0 tempSel: [16 - 30] - Default: 22 machMode: ['0', '1', '2', '4', '6'] - Default: 0 10degreeHeatingStatus: [0 - 1] - Default: 0 silentSleepStatus: [0 - 1] - Default: 0 muteStatus: [0 - 1] - Default: 0 rapidMode: [0 - 1] - Default: 0 selfCleaningStatus: [0 - 1] - Default: 0 windSpeed: ['1', '2', '3', '5'] - Default: 5 windDirectionVertical: ['2', '4', '5', '6', '7', '8'] - Default: 5 Update settings:

service: hon.update_settings data: parameters: >- {'screenDisplayStatus':'1','echoStatus':'0','tempSel':'22','machMode':'0','10degreeHeatingStatus':'0','silentSleepStatus':'0','muteStatus':'0','rapidMode':'0','selfCleaningStatus':'0','windSpeed':'5','windDirectionVertical':'5'} target: device_id: 4d971b402709545c0f2aa5dd18a863c4

======

Perhaps useful information To set the air conditioner into this vertical mode, we have to press the button 'extra function' on the remote until the display shows the desired modus followed by pressing the 'confirm' button to send the command

gvigroux commented 2 months ago

Thanks for the details. I will check soon

gvigroux commented 2 months ago

This is strange, the possible values for the vertical swing for your AC device are windDirectionVertical: ['2', '4', '5', '6', '7', '8'] And they are all already supported in the integration:

    AUTO = "8"
    VERY_LOW = "7"
    LOW = "6"
    MIDDLE = "5"
    HIGH = "4"
    HEALTH_LOW = "3"
    VERY_HIGH = "2"
    HEALTH_HIGH = "1"

Can you active the position through the hOn mobile app ?

ggieling commented 2 months ago

No, you can't set it in the 180 degree vertical position using the hOn mobile app. Perhaps I did not write that clear enough, but I wrote this as 'Perhaps useful information' in the original message. It can be set only using the button 'extra function' on the remote. That is why I was curious after the reading of the parameters, if it would be possible to see something. The parameter must be set in the device, question is where and how to get there?

I have in the past also contacted Haier with this issue, I found it strange that the mobile app cannot control all functionalities of the device, especially such an important one. Unfortunately, the support staff at Haier found it completely logic that a mobile app cannot control such an important function and made clear that there was no intention at all in Haier to make the mobile app fully support there own device.

gvigroux commented 2 months ago

Your message was really clear and unfortunately we might be limited here. The only think we can do :

(the "get Settings" do not send back the actual values, just default ones)

ggieling commented 2 months ago

Activate the debug on HA for the HON integration looks at the dump: every minute, I dump the status and all parameters from the hOn server. Maybe there is a value we can use

Is that a request to me, or something that you intend to do yourself? If a request to me, please give me some detailed instructions what I have to do and where to fetch the information you need. As said, I am still a novice in the home assistant environment. It would save me quite some time searching the manual if you would give me such more detailed instructions as to how to activate the debug mode on HA for the hOn integration and where to fetch the debug information.

gvigroux commented 2 months ago

@ggieling , the request is for you :) Please add this to the configuration.yaml and restart HA

logger:
logs:
custom_components.hon: info
After go to the log page '/config/logs' and click to access all logs.
Share any of the logs starting with:

You will see after a log every 30 sec with all details about your device. You will need to go to the log section and expand the complete logs to be able to see them.

Ideally you should look at a dump before activating the option and 30 sec later to check if something is different

ggieling commented 2 months ago

I have added to configuration.yaml

logger for airco (hOn)

logger: default: warning logs: custom_components.hon: info

restarted home assistant waited one minute after restarting and did some operations with the airco using the home assistant interface. I do not see anything appearing in the log file [settings]/[logs]/[load full logs]. the only information I see about the hOn integration is the below warning

WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hon which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

If I go to the logbook in the user interface, I see the logbook reporting that the airco was switched on or of or changed operating mode (ventilator only / cooling / heating). The logbook does not report if I change anything with ventilator speed or vertical airflow.

Despite seeing some events in the logbook, the log file is completely silent about anything happening with the airconditioner. I changed the default to 'info' and restarted home assistant. With this configuration I do see a lot of messages appearing in the log, but nothing related to the Airco. It seems as if the hOn integration is not reporting to the log system at all.

gvigroux commented 2 months ago

I'm really sorry ! the level should be set to 'debug', not 'warning' or 'info'

ggieling commented 1 month ago

Silly, I could have thought that myself.

I have extracted the log information and included the raw log file below. v3.zip extract.log is the section of the log file relevant for the analysis parsed.log is the same extract file but processed to be more legible for humans the xx# files are the individual entries in the log file that make it easier to compare using diff.

The sequence used was: set a vertical position using Home Automation after approximately one minute change to horizontal using the remote control and shortly after to 180 degree vertical using the remote. ( I have to make two commands using the remote, because it can only send commands if the status in the remote itself changes. I doesn't know the actual status of the air conditioner and cannot send the command 180 degree vertical again if the last command send with the remote was 180 degree vertical, regardless of what happened in between via other interfaces). In some occasions you'll see operationSource 1 linked to WindDirectionVertical value 2. In that case, the context dump to the log file was exactly between the two remote control toggles.

In checking the context parameters I see two essential differences: 'windDirectionVertical' and 'operationSource' I assume that 'operationSource' is indicative of how the latest change was triggered, with '3' indicative of the interface used by Home Assistant and '1' indicating the Haier remote control

In some occasions you'll see operationSource 1 linked to windDirectionVertical value 2. In that case, the context dump to the log file was exactly between the two remote control toggles.

The 180 degrees vertical position is in our device linked to 'windDirectionVertical' value of '3', which in the Home Assistant interface is linked to 'Health high'.

Since the parameter used to set the device in 180 degrees vertical position seems to be the common windDirectionVertical parameter. I tried using the [Developer tools] [services] page to run through all possible vertical position values (1-8).

For two of these this produced the below error:

This error originated from a custom integration.

Logger: custom_components.hon.device Source: custom_components/hon/device.py:146 integration: hOn (documentation, issues) First occurred: 12:56:22 PM (3 occurrences) Last logged: 12:59:03 PM

Unable to update parameter [windDirectionVertical] with value [1] because not in range ['2', '4', '5', '6', '7', '8']. Use default instead. Unable to update parameter [windDirectionVertical] with value [3] because not in range ['2', '4', '5', '6', '7', '8']. Use default instead.

The complete log is included below v5.zip

Question: Where does the limitation in the windDirectionValue come from? Is this limitation created in the plugin assuming that it does not exist for this device because the original hOn app for android does not have these values for this device? Or is it the device itself reporting to Home Assistant that these values cannot be set?

Hope this helps

gvigroux commented 1 month ago

Wow, thank you for all these details! The list of possible values for the parameter windDirectionValue is coming from the server directly. So there is a high chance it will be blocked by the server.

To test, you can use the action "hOn: Send custom request" I don't filter any values so it will be sent to the server :)