[SOLVED] OH2 - Daikin Binding Unknown wireless control state: dmnd_run = 0

Reading parameters is one thing - but how can you send commands to the AC with an incoming HTTP (get) request? Or to be precise: How can you switch the AC on/off with the “<” direction in the http.cfg?

Haven’t done my ToDo yet, but will post what you need to turn on/off and setTemp which is all I need at this time of the year :slight_smile: (note that when posting command, there MUST be the minimal set I have used below)

AC.items:

Number  DaikinACTempIn       "Inside temperature [%.1f °C]"       <temperature_inside>  {daikin="AC:tempin"}
Number  DaikinACTempOut      "Outer temperature [%.1f °C]"        <temperature_outside> {daikin="AC:tempout"}
String  NoDaikACinTempOut    "Outer temperature is not available" <temperature_outside> 
Number  DaikinACMode         "Mode"                               <ac_mode>             {daikin="AC:mode"}
Number  DaikinACFan          "Fan"                                <fan>                 {daikin="AC:fan"}

Switch vACpowerState                                                           // 1=ON, 0=OFF
Number vACsetTemp        "Target temperature [%.0f °C]"       <temperature>    //
Number vACMode           "Mode"                               <ac>

// http items
String ACpowerState                                               {http="<[ACcache:6000:REGEX(.*?pow=.*?([0-9]*).*)]"}
String ACsetTemp                                                  {http="<[ACcache:1000:REGEX(.*?stemp=.*?([0-9\\.0-9]*).*)]"}
String ACmode                                                     {http="<[ACcache:1000:REGEX(.*?mode=.*?([0-9]*).*)]"}
String ACfanRate                                                  {http="<[ACcache:1000:REGEX(.*?f_rate=.*?([AB34567]*).*)]"}
String ACfanDir                                                   {http="<[ACcache:1000:REGEX(.*?f_dir=.*?([0-9\\.0-9]*).*)]"}
String ACinDoorTemp "Inside temperature [%s °C]" <temperature>    {http="<[ACsensorCache:1000:REGEX(.*?htemp=.*?([0-9\\.0-9]*).*)]"}
String ACoutDoorTemp "Outside temperature [%s °C]" <temperature>  {http="<[ACsensorCache:1000:REGEX(.*?otemp=.*?([0-9\\.0-9]*).*)]"}

ac.rules:

var String acHost = "http://192.168.1.8:80/"
var String acCommandString = ""


// virtual AC items changed
rule 'vACpowerState'
when
    Item vACpowerState changed
then
    logInfo("vACpowerState", "vACpowerState=" + vACpowerState.state);
    //echo -e "POST &aircon/set_control_info?pow=1&mode=4&stemp=23.0&shum=0&f_rate=A&f_dir=0"
    var String newState
    if (vACpowerState.state == ON) newState="1" else newState="0"
    acCommandString = "aircon/set_control_info?pow=" + newState + "&mode=" + ACmode.state + "&stemp=" + ACsetTemp.state + "&shum=0&f_rate=" + ACfanRate.state + "&f_dir=" + ACfanDir.state     
    logInfo("vACpowerState", "acCommandString=" + acCommandString)
    logInfo("vACpowerState", "sendHttpPostRequest() returns: " + sendHttpPostRequest(acHost + acCommandString, 5000))
end      

rule 'vACsetTemp'
when
    Item vACsetTemp changed
then
    logInfo("ACsetTemp", "vACsetTemp=" + vACsetTemp.state)
    acCommandString = "aircon/set_control_info?pow=" + ACpowerState.state + "&mode=" + ACmode.state + "&stemp=" + vACsetTemp.state + ".0&shum=0&f_rate=" + ACfanRate.state + "&f_dir=" + ACfanDir.state     
    logInfo("ACsetTemp", "acCommandString=" + acCommandString)    
    logInfo("ACsetTemp", "sendHttpPostRequest() returns: " + sendHttpPostRequest(acHost + acCommandString, 5000))
end      

rule 'vDaikinACMode'
when
    Item vDaikinACMode changed
then
    logInfo("vDaikinACMode", "vDaikinACMode=" + vDaikinACMode.state)
    acCommandString = "aircon/set_control_info?pow=" + ACpowerState.state + "&mode=" + ACmode.state + "&stemp=" + vACsetTemp.state + ".0&shum=0&f_rate=" + ACfanRate.state + "&f_dir=" + ACfanDir.state     
    logInfo("ACsetTemp", "acCommandString=" + acCommandString)    
    logInfo("ACsetTemp", "sendHttpPostRequest() returns: " + sendHttpPostRequest(acHost + acCommandString, 5000))
end      


// AC settings changed from APP or IR remote (remember: IR remote does not reflect changes made by APP or OH)
rule 'ACpowerUpdate'
when
    Item ACpowerState changed
then
    if (ACpowerState.state.toString == "1") sendCommand(vACpowerState, ON) else sendCommand(vACpowerState, OFF)        	
    logInfo("ACpowerUpdate", "vACpowerState=" + vACpowerState.state)
end      

rule 'ACsetTempUpdate'
when
    Item ACsetTemp changed
then
    logInfo("ACsetTempUpdateAC", "ACsetTemp=" + ACsetTemp.state)
    postUpdate(vACsetTemp, Double::parseDouble(ACsetTemp.state.toString))
end      

.sitemap:

Text item=ac label="AC" icon="climate" {
		  Frame label="Settings"{
				Switch item=vACpowerState label="On/Off"
				Setpoint item=vACsetTemp minValue=18 maxValue=30 step=1 
				Switch item=vACMode mappings=[4="Heat", 3="Cool", 6="Fan", 0="Auto" ] //not used: 2="Dry"  
				Switch item=DaikinACFan mappings=[ 3="1", 4="2", 5="3", 6="4", 7="5", 1="Auto" ]
		  }
		  Frame label="Temperature values" {
				Text item=ACoutDoorTemp   visibility=[ACoutDoorTemp != "0.0"] 
				Text item=NoDaikACinTempOut visibility=[ACoutDoorTemp == "0.0"] labelcolor=[ACoutDoorTemp== "0.0" ="grey"]
				Text item=ACinDoorTemp 
		  }
				
	 }

In my other rules, I set the temp by: postUpdate(vACsetTemp, 20)

Feel fri to chime in for the missing mode & fan control :slight_smile:

Thank you, I will! I was afraid it has to be done using a bunch if rules.
I do even own two Daikin ACs - and have to think about how to solve it without having everything doubled.

But it‘s a shame that there exists a binding, no one takes care of.
It should be taken out of the repository if it’s not being maintained and now not even working anymore. If I would speak Java, I had solved it long ago…

LG,
Robert

New writeup: OH2: Daikin BRP069B control. Http & rule based. (since OH1 binding is currently broken)

1 Like

I’ve made a new Daikin addon for OpenHAB 2. You can get it from the eclipse marketplace by installing the Eclipse SmartHome Marketplace addon from “misc” addons and then searching for opendaikin. Alternatively you can get the jar from the CI of the pull request.

@caffineehacker

First off :+1::+1::+1: for the binding as it works like a charm.
The item defintion mentioned in Eclipse has some errors as it has text everywhere where it should be strings and numbers.

//Daikin Bureau
Switch BPower     "Power"                                                             { channel="opendaikin:ac_unit:192_168_0_238:power" }
Number BSetTemp   "Set Temp"               <temperature>                              { channel="opendaikin:ac_unit:192_168_0_238:settemp" }
Number BInTemp    "B Indoor Temp[%s °C]"   <temperature>     [ "CurrentTemperature" ] { channel="opendaikin:ac_unit:192_168_0_238:indoortemp" }
Number BOutTemp   "Outdoor Temp[%s °C]"    <temperature>                              { channel="opendaikin:ac_unit:192_168_0_238:outdoortemp" }
Number BHumidity  "Humidity"                                                          { channel="opendaikin:ac_unit:192_168_0_238:humidity" }
String BMode      "Mode"                   <heating>                                  { channel="opendaikin:ac_unit:192_168_0_238:mode" }
String BFanS      "Fan Speed"              <qualityofservice>                         { channel="opendaikin:ac_unit:192_168_0_238:fanspeed" }
String BFanD      "Fan Direction"                                                     { channel="opendaikin:ac_unit:192_168_0_238:fandir" }

Is anyone having issues with Openhab not refreshing when an option is selected.
For example when I turn on the unit with the Power switch the sitemap should refresh and shown the target temperature, fan speed etc but instead I need to manually refresh the page.

I tried this with different browsers (ios, chrome, safari etc) and they all have the issue which makes me believe it is an openhab issue. Searching revealed no recent reports of this so i wanted to check if you guys also have the issue. I am using a 2.3 snapshot.