yenoiwesa/homebridge-daikin-airbase

Unable to change temperature via automation

Closed this issue · 6 comments

In the Home app I am able to manually change the temperature. If I attempt to change the temperature and not the heat/cooling mode via an automation using a scene or controlling the accessory directly, it doesn't work. If temperature change occurs with a mode change, it is successful.

In HomeBridge logs I can see the command being issued:

[6/6/2021, 10:51:27 PM] [Daikin Airbase] Set HeaterCooler heating threshold temperature success: 16
[6/6/2021, 10:51:27 PM] [Daikin Airbase] Set HeaterCooler target heater/cooler state success: 1

The Home app briefly displays what the automation has attempted to do, but evenly refreshes to show what the previous set temperature.

This also occurs with a power state change. If prior to turning the a/c off the unit it was in heating mode and temperature set to 20. When the automation turns it back on, the temperature is still set to 20, even though the automation was meant to set it to heating mode and temperature 16.

Hi @paulgab,

I have used automations to turn on the aircon in the past without a problem, I know other users have too.
Let's try to debug your problem.

Could you start your Homebridge server in debug mode so that we can see debug traces (I am especially interested in the requests sent to the Airbase over the network). Use the console argument -D to start Homebridge in debug mode.

If you could then run your automation again and let me know what happens in the logs around these lines that you shared.

Thanks.

Start state, heating 20C, fan auto

Applying scene, heating 16C:

[6/7/2021, 8:46:33 PM] [Daikin Airbase] Set HeaterCooler heating threshold temperature with value: 16
[6/7/2021, 8:46:33 PM] [Daikin Airbase] Set HeaterCooler active state with value: 1
[6/7/2021, 8:46:33 PM] [Daikin Airbase] Set HeaterCooler target heater/cooler state with value: 1
[6/7/2021, 8:46:33 PM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/get_control_info With Values: undefined Response: {
  power: 1,
  mode: 1,
  targetTemperature: 20,
  modeTargetTemperature: { '1': 20, '2': 23, '3': 20 },
  fanRate: 0,
  fanAirside: 0,
  fanAuto: 0,
  fanDirection: 0
}
[6/7/2021, 8:46:33 PM] [Daikin Airbase] Set HeaterCooler active state success: 1
[6/7/2021, 8:46:34 PM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/set_control_info?pow=1&mode=1&stemp=20&f_rate=0&f_airside=0&f_auto=0&f_dir=0 With Values: {
  power: 1,
  mode: 1,
  targetTemperature: 20,
  modeTargetTemperature: { '1': 16, '2': 23, '3': 20 },
  fanRate: 0,
  fanAirside: 0,
  fanAuto: 0,
  fanDirection: 0,
  priority: 1
} Response: null
[6/7/2021, 8:46:34 PM] [Daikin Airbase] Set HeaterCooler heating threshold temperature success: 16
[6/7/2021, 8:46:34 PM] [Daikin Airbase] Set HeaterCooler target heater/cooler state success: 1

Home show the change was successful until it polls for an update:

[6/7/2021, 8:48:29 PM] [Daikin Airbase] Polling for Aircon state
[6/7/2021, 8:48:29 PM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/get_control_info With Values: undefined Response: {
  power: 1,
  mode: 1,
  targetTemperature: 20,
  modeTargetTemperature: { '1': 20, '2': 23, '3': 20 },
  fanRate: 0,
  fanAirside: 0,
  fanAuto: 0,
  fanDirection: 0
}
[6/7/2021, 8:48:29 PM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/get_sensor_info With Values: undefined Response: { indoorTemperature: 20, outdoorTemperature: 5 }

Thanks for the logs @paulgab, I can see what is happening. The plugin expects the (multiple) commands from HomeKit to arrive in a specific order, and then it tries to merge them together to send just one request to the Airbase module (because the Airbase module cannot take multiple requests successfully in a short timeframe, it drops the consecutive ones).

So what happens here is that the targetTemperature is actually being reused from the value it got while fetching current values with get_control_info, because the Set HeaterCooler target heater/cooler takes precedence in the plugin's implementation (I mark that request as taking priority during the merging of values). It's a caching and prioritising issue.

I will try to produce a change that could fix that, I will ask you to test it and let me know.

Can you please update the plugin to use this version that has a patch:

npm install -g yenoiwesa/homebridge-daikin-airbase#91aea2b497ec84da27fb34bccbf4e74e0fc4d4fc

(omit the -g if you don't have a global install)

...and let me know if you have better results running your automation please?

The patched version has fixed the issue.

[6/8/2021, 8:09:37 AM] [Daikin Airbase] Set HeaterCooler heating threshold temperature with value: 16
[6/8/2021, 8:09:37 AM] [Daikin Airbase] Set HeaterCooler active state with value: 1
[6/8/2021, 8:09:37 AM] [Daikin Airbase] Set HeaterCooler target heater/cooler state with value: 1
[6/8/2021, 8:09:37 AM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/get_control_info With Values: undefined Response: {
 power: 1,
 mode: 1,
 targetTemperature: 20,
 modeTargetTemperature: { '1': 20, '2': 23, '3': 20 },
 fanRate: 0,
 fanAirside: 0,
 fanAuto: 0,
 fanDirection: 0
}
[6/8/2021, 8:09:37 AM] [Daikin Airbase] Set HeaterCooler active state success: 1
[6/8/2021, 8:09:38 AM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/set_control_info?pow=1&mode=1&stemp=16&f_rate=0&f_airside=0&f_auto=0&f_dir=0 With Values: {
 power: 1,
 mode: 1,
 targetTemperature: 16,
 modeTargetTemperature: { '1': 16, '2': 23, '3': 20 },
 fanRate: 0,
 fanAirside: 0,
 fanAuto: 0,
 fanDirection: 0,
 priority: 2
} Response: null
[6/8/2021, 8:09:38 AM] [Daikin Airbase] Set HeaterCooler heating threshold temperature success: 16
[6/8/2021, 8:09:38 AM] [Daikin Airbase] Set HeaterCooler target heater/cooler state success: 1
[6/8/2021, 8:09:38 AM] [Daikin Airbase] Sent: http://192.168.0.132/skyfi/aircon/get_sensor_info With Values: undefined Response: { indoorTemperature: 19, outdoorTemperature: 5 }

Thanks

Hi @paulgab, that's great to hear!

I just released version 3.0.2 of the plugin with the patch included. I suggest you move to that final release version rather than staying on the patch version:

npm install -g homebridge-daikin-airbase@latest

Cheers!