In the end i noticed that IRremoteESP8266 gave me more reliable results for my Daikin rather then OMG so i decided to use the IRMQTTSERVER.ino and modified it to include ir_Daikin and the analysis of recieved message according to dumpACInfo function.
I modified it to publish a new mqtt topic ir_server/daikin and i modified that function to create a json.
I am sorry in the end i didn’t use OMG but looked easier to me to modify the IRremoteESP8266.
Next challenge is to prepare the JSON payload for ir_send to send message to IR.
In the end, here is a payload:
{"Power":"ON","Mode":0,"Temp":27,"Fan":10,"Powerful":"OFF","Quiet":"OFF","Sensor":"OFF","Eye":"ON","Mold":"OFF","Comfort":"OFF","SwingH":"OFF","SwingV":"OFF","CurrentTime":"19:18","Current Day":,"OnTime":"OFF","OffTime":"OFF"}
here is my openhab thing definition:
Thing mqtt:topic:irmqtt (mqtt:broker:localBroker) {
Channels:
Type string : irmsgsend "AC_rawstring" [stateTopic="ir_server/daikin", commandTopic="ir_server/daikin"]
Type switch : acpower "AC_power" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Power"]
Type string : acmode "AC_mode" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Mode"]
Type number : actemperature "AC_temperature" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Temp"]
Type number : acwind "AC_wind" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Fan"]
Type switch : acwindswing "AC_swing" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.SwingV"]
Type switch : acpowerful "AC_powerful" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Powerful"]
Type switch : accomfort "AC_comfort" [stateTopic="ir_server/daikin", transformationPattern="JSONPATH:$.Comfort"]
}
Here is .items
Group AC "Air conditioner"
Group g_AC “LivingRoom Daikin” [ “Thermostat”, “Celsius” ]
Switch AC_power “AC Power” (AC) { channel=“mqtt:topic:irmqtt:acpower” }
String AC_mode “AC Mode” (AC) { channel=“mqtt:topic:irmqtt:acmode” }
Number AC_set_temp “AC Temperature” (AC, g_AC) { channel=“mqtt:topic:irmqtt:actemperature” }
Number AC_windlevel “Wind” (AC) { channel=“mqtt:topic:irmqtt:acwind” }
Switch AC_windswing “Wind Swing” (AC) { channel=“mqtt:topic:irmqtt:acwindswing” }
Switch AC_powermode “Powerful” (AC) { channel=“mqtt:topic:irmqtt:acpowerful” }
Switch AC_comfort “Comfort” (AC) { channel=“mqtt:topic:irmqtt:accomfort” }
String AC_rawstring “AC Command” { channel=“mqtt:topic:irmqtt:irmsgsend” }
and this is .sitemap
Switch item=AC_power label="Power" icon="heating"
Setpoint item=AC_set_temp minValue=18 maxValue=32 step=1 icon="temperature" label="Setpoint [%.0f °C]"
Switch item=AC_mode label="Mode" icon="sofa" mappings=[0="Auto", 2="Dry", 3="Cool", 4="Heat", 6="Fan"]
Switch item=AC_windlevel label="Wind level" icon="fan" mappings=[10="Auto", 11= "Calm", 1="▂", 2="▃", 3="▄", 4="▆", 5="▇"]
Switch item=AC_windswing label="Wind swing" icon="aircon_swing"
Switch item=AC_powermode label="Power mode" icon="wind"
Switch item=AC_comfort label="Comfort" icon="econmode"