Daikin binding + Homekit

Tags: #<Tag:0x00007f7453048a98> #<Tag:0x00007f74530489d0>

Good afternoon.

Did someone manage to connect Daikin binding and Apple Hotekit? Can you send the settings? The device appears in the homekit. but not active or not working properly. The problem, as far as I understand, is that inclusion in daikin is on/off by a separate switch, not in mode.

I haven’t tried Homekit, but I had it working with Google Assistant to change temperature, but I had to add a rule to synchronise the ‘assistant mode’ with power on/off and the daikin mode.

Currently the Openhab Google Assistant Thermostat integration is broken, but once it’s fixed, I plan on adding a ‘Virtual Mode’ that should help Homekit and Google Assistant (and likely Alexa) integration.

Cheers,

Paul

I have to add a fully virtual air conditioner to items? And create rules for synchronizing virtual and daikin?

I used a Virtual Mode per below:

// mode for Google Home
String ThermostatHeatingCoolingMode "Google Home Thermostat Heating/Cooling Mode" (gThermostat) [ "homekit:HeatingCoolingMode" ]

This made Google Assistant happy, noting that the mode didn’t synchronise without having a rule to detect changes. That was pretty messy, I’m hoping my new item in the binding will make things much cleaner, I just need to get around to finishing off the code/logic.

Almost tuned:
My items file

Switch DaikinACUnit_Power                "Включить"                                                 { channel="daikin:ac_unit:192_168_108_91:power" }
Number DaikinACUnit_SetPoint             "Температура [%.0f °C]"                                    { channel="daikin:ac_unit:192_168_108_91:settemp" }
String DaikinACUnit_Mode                 "Режим"                 <ac_mode>                          { channel="daikin:ac_unit:192_168_108_91:mode" }
String DaikinACUnit_Fan                  "Скорость"              <fan>                              { channel="daikin:ac_unit:192_168_108_91:fanspeed" }
Number DaikinACUnit_IndoorTemperatureF   "Внутри [%.1f °C]"                                         { channel="daikin:ac_unit:192_168_108_91:indoortemp" }
Number DaikinACUnit_OutdoorTemperatureF  "Снаружи [%.1f °C]"               [ "CurrentTemperature" ] { channel="daikin:ac_unit:192_168_108_91:outdoortemp" }

Group gThermostat "Кондиционер Зал" [ "Thermostat" ]
Number ThermostatCurrentTemp "Текущая температура Зал" (gThermostat) [ "CurrentTemperature" ]
Number ThermostatTargetTemperature "Установленная темература Зал" (gThermostat) [ "homekit:TargetTemperature" ]
String ThermostatHeatingCoolingMode (gThermostat) [ "homekit:TargetHeatingCoolingMode" ]
String ThermostatHeatingCoolingCurMode (gThermostat) [ "homekit:CurrentHeatingCoolingMode" ]

My rule file

rule "Thermostat1-Power"
when
  Item DaikinACUnit_Power changed or
  Item DaikinACUnit_Mode changed
then
  logInfo("Thermostat Zal", "openHAB Power. Info. Status: " + DaikinACUnit_Power.state.toString);
  logInfo("Thermostat Zal", "openHAB Power. Info. Mode openHAB: " + DaikinACUnit_Mode.state.toString);
  logInfo("Thermostat Zal", "openHAB Power. Info. Mode HomeKit: " + ThermostatHeatingCoolingMode.state.toString);
  
  if (DaikinACUnit_Power.state.toString == "ON") {
    if (DaikinACUnit_Mode.state.toString == "AUTO") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: Auto");
      }
    }
      
    if (DaikinACUnit_Mode.state.toString == "COLD") {
      if (ThermostatHeatingCoolingMode.state.toString != "CoolOn") {
        ThermostatHeatingCoolingMode.sendCommand("CoolOn");
        logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: CoolOn");
      }
    }
   
    if (DaikinACUnit_Mode.state.toString == "HEAT") {
      if (ThermostatHeatingCoolingMode.state.toString != "HeatOn") {
        ThermostatHeatingCoolingMode.sendCommand("HeatOn");
        logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: HeatOn");
      }
    }
   
    if (DaikinACUnit_Mode.state.toString == "DEHUMIDIFIER") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: Auto");
      }
    }
      
    if (DaikinACUnit_Mode.state.toString == "FAN") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: Auto");
      }
    }
  }
    
  if (DaikinACUnit_Power.state.toString == "OFF") {
    if (ThermostatHeatingCoolingMode.state.toString != "OFF") { 
      ThermostatHeatingCoolingMode.sendCommand("Off");
      logInfo("Thermostat Zal", "openHAB Power. Set mode HomeKit: Off");
    }
  }
end

rule "Thermostat1-AppleMode"
when
  Item ThermostatHeatingCoolingMode changed 
then
  logInfo("Thermostat Zal", "Apple change mode. Info. Status: " + ThermostatHeatingCoolingMode.state.toString);
  logInfo("Thermostat Zal", "Apple change mode. Info. Mode power openHAB: " + DaikinACUnit_Power.state.toString);
  logInfo("Thermostat Zal", "Apple change mode. Info. Mode openHAB: " + DaikinACUnit_Mode.state.toString);
  
  if (ThermostatHeatingCoolingMode.state.toString == "Off") {
    ThermostatHeatingCoolingCurMode.sendCommand("Off");
    if (DaikinACUnit_Power.state.toString != "OFF") {
      DaikinACUnit_Power.sendCommand("OFF");
      logInfo("Thermostat Zal", "Apple change mode. Set power openHAB: OFF");
    }
  }
  
  if (ThermostatHeatingCoolingMode.state.toString == "Auto") {
    ThermostatHeatingCoolingCurMode.sendCommand("Cooling");
    if (DaikinACUnit_Power.state.toString != "ON") {
      DaikinACUnit_Power.sendCommand("ON");
      logInfo("Thermostat Zal", "Apple change mode. Set power openHAB: ON");
    }
    if (DaikinACUnit_Mode.state.toString != "AUTO" && DaikinACUnit_Mode.state.toString != "DEHUMIDIFIER" && DaikinACUnit_Mode.state.toString != "FAN") {
      DaikinACUnit_Mode.sendCommand("AUTO");
      logInfo("Thermostat Zal", "Apple change mode. Set mode openHAB: AUTO");
    }
  }
    
  if (ThermostatHeatingCoolingMode.state.toString == "HeatOn") {
    ThermostatHeatingCoolingCurMode.sendCommand("Heating");
    if (DaikinACUnit_Power.state.toString != "ON") {
      DaikinACUnit_Power.sendCommand("ON");
      logInfo("Thermostat Zal", "Apple change mode. Set power openHAB: ON");
    }
    if (DaikinACUnit_Mode.state.toString != "HEAT") {
      DaikinACUnit_Mode.sendCommand("HEAT");
      logInfo("Thermostat Zal", "Apple change mode. Set mode openHAB: HEAT");
    }
  }
  
  if (ThermostatHeatingCoolingMode.state.toString == "CoolOn") {
    ThermostatHeatingCoolingCurMode.sendCommand("Cooling");
    if (DaikinACUnit_Power.state.toString != "ON") {
      DaikinACUnit_Power.sendCommand("ON");
      logInfo("Thermostat Zal", "Apple change mode. Set power openHAB: ON");
    }
    if (DaikinACUnit_Mode.state.toString != "COLD") {
      DaikinACUnit_Mode.sendCommand("COLD");
      logInfo("Thermostat Zal", "Apple change mode. Set mode openHAB: COLD");
    }
  }
end

rule "Thermostat1-InTemp"
when
    Item DaikinACUnit_IndoorTemperatureF changed 
then
  logInfo("Thermostat Zal", "openHAB set temp in room. Info. Temp: " + DaikinACUnit_IndoorTemperatureF.state.toString);
  ThermostatCurrentTemp.sendCommand(DaikinACUnit_IndoorTemperatureF.state.toString);
end

rule "Thermostat1-Temp"
when
  Item DaikinACUnit_SetPoint changed 
then
  logInfo("Thermostat Zal", "openHAB set temp. Info. Temp: " + DaikinACUnit_SetPoint.state.toString);
  logInfo("Thermostat Zal", "openHAB set temp. Info. Apple Temp: " + ThermostatTargetTemperature.state.toString);
  
  if (DaikinACUnit_SetPoint.state != ThermostatTargetTemperature.state) {
    ThermostatTargetTemperature.sendCommand(DaikinACUnit_SetPoint.state.toString);
    logInfo("Thermostat Zal", "openHAB set temp. New Apple Temp: " + DaikinACUnit_SetPoint.state.toString);
  }
end

rule "Thermostat1-AppleTemp"
when
  Item ThermostatTargetTemperature changed 
then
  logInfo("Thermostat Zal", "Apple set temp. Info. Temp: " + ThermostatTargetTemperature.state.toString);
  logInfo("Thermostat Zal", "Apple set temp. Info. openHAB Temp: " + DaikinACUnit_SetPoint.state.toString);

  if (ThermostatTargetTemperature.state != DaikinACUnit_SetPoint.state) {
    DaikinACUnit_SetPoint.sendCommand(ThermostatTargetTemperature.state.toString);
    logInfo("Thermostat Zal", "Apple set temp. New openHAB Temp: " + ThermostatTargetTemperature.state.toString);
  }
end

rule "Thermostat1-Start"
when
  System started
then
  logInfo("Thermostat Zal", "Boot set params. Info. Status openHAB: " + DaikinACUnit_Power.state.toString);
  logInfo("Thermostat Zal", "Boot set params. Info. Mode openHAB: " + DaikinACUnit_Mode.state.toString);
  logInfo("Thermostat Zal", "Boot set params. Info. Set Temp openHAB: " + DaikinACUnit_SetPoint.state.toString);
  logInfo("Thermostat Zal", "Boot set params. Info. Inroom Temp openHAB: " + DaikinACUnit_IndoorTemperatureF.state.toString);
  
  if (DaikinACUnit_Power.state.toString == "ON") {
    if (DaikinACUnit_Mode.state.toString == "AUTO") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: Auto");
      }
    }
      
    if (DaikinACUnit_Mode.state.toString == "COLD") {
      if (ThermostatHeatingCoolingMode.state.toString != "CoolOn") {
        ThermostatHeatingCoolingMode.sendCommand("CoolOn");
        logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: CoolOn");
      }
    }
   
    if (DaikinACUnit_Mode.state.toString == "HEAT") {
      if (ThermostatHeatingCoolingMode.state.toString != "HeatOn") {
        ThermostatHeatingCoolingMode.sendCommand("HeatOn");
        logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: HeatOn");
      }
    }
   
    if (DaikinACUnit_Mode.state.toString == "DEHUMIDIFIER") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: Auto");
      }
    }
      
    if (DaikinACUnit_Mode.state.toString == "FAN") {
      if (ThermostatHeatingCoolingMode.state.toString != "Auto") {
        ThermostatHeatingCoolingMode.sendCommand("Auto");
        logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: Auto");
      }
    }
  }
    
  if (DaikinACUnit_Power.state.toString == "OFF") {
    if (ThermostatHeatingCoolingMode.state.toString != "OFF") { 
      ThermostatHeatingCoolingMode.sendCommand("Off");
      logInfo("Thermostat Zal", "Boot set params. Set mode HomeKit: Off");
    }
  }
  
  ThermostatCurrentTemp.sendCommand(DaikinACUnit_IndoorTemperatureF.state.toString);
  
  if (DaikinACUnit_SetPoint.state != ThermostatTargetTemperature.state) {
    ThermostatTargetTemperature.sendCommand(DaikinACUnit_SetPoint.state.toString);
    logInfo("Thermostat Zal", "Boot set params. New Apple Temp: " + DaikinACUnit_SetPoint.state.toString);
  }
end

I can control Daikin from openHAB, iPhone and Siri.

One problem left:
I can not control temperature from apple app(From Siri I can).

What can be a problem?