Actually Florian figured it out in the first place (I just provided detailed info of the problem ).
In order to publish the raw values for the unknown protocols such as those for AC units,
#define pubIRunknownPrtcl
should be set to true in config_ir.h
To add support for the specific brand and not use the raw value, the payload should be decoded. Here’s what I managed to work on about two years ago when I’ve started using OMG (just a printscreen of the excel file, as it’s not advisable to open excel files from strangers on internet ).
I started by writing down each command values from the remote and the code in hex. After splitting on individual blocks, several patterns emerge: first 10 chars are constant, field 11 is on/off indicator, 13 is for mode, etc.
In regard of the temperature field (15), the function in cell AC5 is as following:
=BIN2HEX(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1)),1)&MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1))-1,1)&MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1))-2,1)&MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DEC2BIN(A5),0,8),1,0),8,1))-3,1))
The problem is that fields 27 and 28 are the result of checksum validation. Although I applied the same steps as for temperature (conversion to bin, replacing 1 with 0 and reversing), I didn’t got to the same result so I didn’t continued and just used raw values which was much easier in HA.
You have two options to set it in HA: as a switch (recording only IR for on at say 16 degrees and off commands), then a thermostat that controls it (see below; the payloads are huge and have only included parts) or (much more complex but uses all functions of the remote) as HVAC (however, this one needs all button combinations to be recorded as raw, which are in the range of hundreds; I have both set but after HA 0.96 the HVAC component is broken so the simple thermostat is better )
- platform: mqtt
name: "AC"
command_topic: "home/GatewayOpenMQTT1/commands/IR_Raw"
qos: 0
retain: false
availability_topic: "home/GatewayOpenMQTT1/LWT"
payload_available: "Online"
payload_not_available: "Offline"
payload_on: "3106,1702,530....536,336,504"
payload_off: "3112,1694,536,1022,536....1034,526,372,504"
climate:
- platform: generic_thermostat
name: AC thermostat
heater: switch.ac
target_sensor: sensor.sn2_real_feel
min_temp: 15
max_temp: 24
target_temp: 22
cold_tolerance: 0.8
hot_tolerance: 0.8
ac_mode: true
min_cycle_duration:
seconds: 7200
initial_hvac_mode: "off"
away_temp: 28