cbrandlehner / homebridge-daikin-local

Supports Daikin Air Conditioners on HomeBridge
MIT License
99 stars 18 forks source link

Changing fan speed changes mode to Auto #164

Closed asdok79 closed 3 years ago

asdok79 commented 3 years ago

Describe the bug After upgrading plugin from 2021.26.1 from an older 2021 version (sorry not sure which one), the Daikin plugin no longer set the settings as expected. Changing the fan speed also changes the mode to auto and the temperature.

https://user-images.githubusercontent.com/87298565/125246549-08377480-e346-11eb-939b-2fdca650dd8e.mov

To Reproduce Information on your wifi gateway from the daikin app:

  1. Firmware version: 1.13.7
  2. If known: Model information of the wifi gateway

Information on your configuration:

  1. "accessories": [ { "accessory": "Daikin-Local", "plugin_map": { "plugin_name": "homebridge-daikin-local", "index": 0 }, "name": "Daikin Aircon", "apiroute": "https://x.x.x.x", "system": "Default", "swingMode": "3", "disableFan": false, "fanMode": "FAN", "fanName": "Daikin Fan", "defaultMode": "0", "response": 5000, "deadline": 60000, "retries": 5, "uuid": "xxxxxxxxf", "temperature_unit": "C" }, { "accessory": "Daikin-Local", "plugin_map": { "plugin_name": "homebridge-daikin-local", "index": 0 }, "name": "Daikin Elliots Room", "apiroute": "https://x.x.x.x", "system": "Default", "swingMode": "0", "disableFan": false, "fanMode": "FAN", "fanName": "Elliot Fan", "defaultMode": "0", "response": 2000, "deadline": 60000, "retries": 5, "uuid": "xxxxxxxxx", "temperature_unit": "C" }, { "accessory": "Daikin-Local", "plugin_map": { "plugin_name": "homebridge-daikin-local", "index": 0 }, "name": "Daikin Ollies Room", "apiroute": "x.x.x.x", "system": "Default", "swingMode": "3", "disableFan": false, "fanMode": "FAN", "fanName": "Ollie FAN", "defaultMode": "0", "response": 2000, "deadline": 60000, "retries": 5, "uuid": "xxxxxxx", "temperature_unit": "C"

Information from the log:

  1. [Daikin Aircon] setTargetHeaterCoolerState: received new state 1 12/07/2021, 6:51:26 pm [HOOBS 6A86@Target Heater-Cooler State] The write handler for the characteristic 'Target Heater-Cooler State' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:26 pm [HOOBS 6A86@Active] The write handler for the characteristic 'Active' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:29 pm [Daikin Aircon] HomeKit requested the AC to operate in HEAT mode. 12/07/2021, 6:51:29 pm [Daikin Aircon] setTargetHeaterCoolerState: query: ret=OK&pow=1&mode=4&adv=&stemp=21.0&shum=0&dt1=25.0&dt2=M&dt3=21.0&dt4=21.0&dt5=21.0&dt7=25.0&dh1=0&dh2=50&dh3=0&dh4=0&dh5=0&dh7=0&dhh=50&b_mode=4&b_stemp=21.0&b_shum=0&alert=255&f_rate=B&b_f_rate=B&dfr1=B&dfr2=A&dfr3=A&dfr4=B&dfr5=B&dfr6=B&dfr7=B&dfrh=A&f_dir=0&b_f_dir=0&dfd1=3&dfd2=0&dfd3=0&dfd4=0&dfd5=0&dfd6=3&dfd7=3&dfdh=0 12/07/2021, 6:51:32 pm [HOOBS 6A86@Active] The write handler for the characteristic 'Active' on the accessory 'Daikin Aircon' didn't respond at all!. Please check that you properly call the callback! 12/07/2021, 6:51:32 pm [Daikin Aircon] setFanSpeed: HomeKit requested a FAN speed of 36 Percent. 12/07/2021, 6:51:32 pm [Daikin Aircon] setActive: Power is 1, Mode is 4. Going to change power to 1. 12/07/2021, 6:51:35 pm [HOOBS 6A86@On] The write handler for the characteristic 'On' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:35 pm [HOOBS 6A86@Rotation Speed] The write handler for the characteristic 'Rotation Speed' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:41 pm [HOOBS 6A86@On] The write handler for the characteristic 'On' on the accessory 'Daikin Aircon' didn't respond at all!. Please check that you properly call the callback! 12/07/2021, 6:51:41 pm [HOOBS 6A86@Rotation Speed] The write handler for the characteristic 'Rotation Speed' on the accessory 'Daikin Aircon' didn't respond at all!. Please check that you properly call the callback! 12/07/2021, 6:51:41 pm [Daikin Aircon] setFanSpeed: HomeKit requested a FAN speed of 100 Percent. 12/07/2021, 6:51:42 pm [Daikin Aircon] setFanStatus: HomeKit requested to turn the FAN on. 12/07/2021, 6:51:44 pm [HOOBS 6A86@Rotation Speed] The write handler for the characteristic 'Rotation Speed' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:50 pm [HOOBS 6A86@Rotation Speed] The write handler for the characteristic 'Rotation Speed' on the accessory 'Daikin Aircon' didn't respond at all!. Please check that you properly call the callback! 12/07/2021, 6:51:53 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:53 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:53 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:53 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:57 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:57 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:57 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:57 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:51:58 pm [HOOBS 6A86@Active] The write handler for the characteristic 'Active' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:51:59 pm [Daikin Aircon] setActive: Power is 1, Mode is 6. Going to change power to 0. 12/07/2021, 6:52:05 pm [Daikin Aircon] setActive: Power is 0, Mode is 1. Going to change power to 0. 12/07/2021, 6:52:06 pm [HOOBS 6A86@Active] The write handler for the characteristic 'Active' on the accessory 'Daikin Aircon' was slow to respond! 12/07/2021, 6:53:02 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:53:02 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:53:04 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:53:04 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:53:04 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) 12/07/2021, 6:53:04 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Heating Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number)

Expected behavior Settings should apply as set in the Home app

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Pharaoas commented 3 years ago

hi asdok79,

I‘m not sure, that I understand your problem right. The way it‘s implemented is as followed: The daikin has for fan speed 7 settings, silent mode, auto mode, speed 1-5. The apple Slider is from 0-100%. So a mapping takes place: 0% == off, 1%-15% is silent mode, 16%-30% Auto mode, 31-40% Speed mode 1 and so on (I‘m not sure about the definite percent values, where the setting will change but this can be looked up in the code itself).

Does your experience matches the behavior I wrote? If so, it‘s not a bug but intentionally. If your experience is another please add where the behavior you noticed differentiates from the methology I explained above?

There is another very ugly thing: apple will report slider changes during sliding the slider. So it can happen (for example) that you slide from 0% (off) to 50% (Speed 2) but apple reports to the plugin: 5%, 17%, 23%, 50%, this depends on the situation i.e. how fast you move the slider, and how the sampling of apple home is. This can cause that the mode will unintentionally change to auto. We can think about a mechanism to circumvent that (But not a solution right now)

best regards Pharaoas

asdok79 commented 3 years ago

How you describe is how it used to work before the update. Now when I change the fan speed it turns off heat and changes it to auto. I attached a video in the original post to demonstrate the new behaviour. You see in the video by just increasing the fan speed to 100% the mode goes from heat to auto, and the thermostat goes from 21 degrees to 25 degrees.

Pharaoas commented 3 years ago

Hi asdok79,

First an off-topic thing: The log shows poor communication to your AC. I had same trouble, but changing the WiFi to channel 6. Improves connectivity noticeable, perhaps you give it a try (ok, harms your complete WiFi network that's the bad news)

I think your problem is related to topic #159: in line: 12/07/2021, 6:51:42 pm [Daikin Aircon] setFanStatus: HomeKit requested to turn the FAN on. Homekit will switch the FAN on but the device is already in cooling mode, so the mode will be changed to mode 6 (FAN) as you see here: 12/07/2021, 6:51:59 pm [Daikin Aircon] setActive: Power is 1, Mode is 6. Going to change power to 0. Lateron, when powering on the Device again this lead to the change to auto mode. (See description of default mode)

In the latest version this should be fixed because now FAN and AC are working independent (That was the issue in #159).

Because it's not really decidable what is better to use (two independent device or one combined) I prepared a version where you can configure that. But I have to discuss with Christian (it's his project not mine). Follow the discussion #159. I also have a fix for the NaN errors like: 12/07/2021, 6:53:02 pm [HOOBS 6A86@Daikin Aircon@Daikin Aircon@Cooling Threshold Temperature] characteristic value expected valid finite number and received "NaN" (number) hopefully this will added to one of the future versions.

Your Log looks very different from my one, are you sure to use the latest version?

best regards Pharaoas

asdok79 commented 3 years ago

I double checked and it's definitely running 2021.26.1. Perhaps the log is formatted differently because I'm using hoobs?

asdok79 commented 3 years ago

The new update has fixed the issue.