Skip to content

Fix Daikin312 missing leader pulse - #2270

Open
naoki-mizuno wants to merge 1 commit into
crankyoldgit:masterfrom
naoki-mizuno:fix/daikin-312-leader-pulse
Open

Fix Daikin312 missing leader pulse#2270
naoki-mizuno wants to merge 1 commit into
crankyoldgit:masterfrom
naoki-mizuno:fix/daikin-312-leader-pulse

Conversation

@naoki-mizuno

Copy link
Copy Markdown
Contributor

TL;DR: Leader pulse was missing from the IR command, resulting in the AC ignoring commands after 5 minutes of off period.

While testing out the changes in #2268 I noticed that most of the times the commands were received, but if I left the AC off for 5 minutes or longer it would ignore the commands. If I use the remote to turn on the AC, it would accept all subsequent commands (even if I turn it off briefly). I’m not sure why it stops receiving commands after that period (clock going out of sync? IR receiver going into deep-sleep?) but it took me a while and a bit of signal comparison to figure it out.

@naoki-mizuno
naoki-mizuno marked this pull request as draft June 22, 2026 05:26
@naoki-mizuno

Copy link
Copy Markdown
Contributor Author

Need to fix the failing tests. It seems the RealExample in the test doesn’t contain the leader (which is probably why it wasn’t included in the original code), so I’ll collect more data from my unit and update.

@naoki-mizuno
naoki-mizuno force-pushed the fix/daikin-312-leader-pulse branch from 043c3cd to 5098b68 Compare June 22, 2026 10:49
Header previously had a 5-bit preamble; however, captured data of an
ARC472A43 remote shows leader pulse, similar to Daikin2 format.

This leads to Daikin2 and Daikin312 sharing identical structure, thus,
they are now distinguished by checking the state[4] byte (0x01 = Daikin2,
0x02 = Daikin312).

Test case for real example has been updated with data captured using a
Moes UFO-R11 IR blaster/receiver. This receiver encodes data in Tuya
format, which has been converted to marks/spaces using the Sensus
converter tool (https://pasthev.github.io/sensus/).

Assisted-by: Claude (Anthropic)
@naoki-mizuno
naoki-mizuno force-pushed the fix/daikin-312-leader-pulse branch from 5098b68 to 787148b Compare June 22, 2026 11:15
@naoki-mizuno
naoki-mizuno marked this pull request as ready for review June 22, 2026 11:21
@naoki-mizuno

Copy link
Copy Markdown
Contributor Author

As described in the updated commit message, I updated the test case with the signal that I captured using a ARC472A43 remote. The original test data did not have this and instead had a 5-bit preamble. All data that I captured had the leader pulse, so I’m not sure why the original data didn’t have it included. Maybe it was catching the trailing zeros of the leader?

Notes:

  • I made the leader required, like how it’s treated in other format variants
  • The IR receiver I have at hand is a Moes UFO-R11, which records in Tuya format. I decoded this FastLZ-compressed then base64-encoded string using the Sensus converter tool. I’ve added several captures below (encoded string that was captured, and the decoded timing list).

Included as the RealExample test data. Captured when AC was off (remote was in off state). Cool button was pressed.
State/settings: mode: cool 25.5, fan: breeze, swingv: highest, swingh: sensor auto, light: bright, beep: quiet, announce: on

DQ8n6GKyDdYGrwEsBa8B4AMB4AcPQAHAE0AHQANAAUAH4AcDwAFAF+AbAQLnAa9gAeATL8AjwAHAK0AHQANAAcAH4AsB4Ac/4AMB4AMb4AML4ANPQBdAD8ADQA/AAcALQBvgCwHgAxfgAyvAF0ATQAvAB0ABQA/gBwFAE+ADA8ABQDdAAUAb4AMBQBdAE0ADwAHgAwvAAUAn4A8B4AMbQAvgAz9AC0ATwAHgAwtAAeADD0ArQAPgAwFAD8ADAS2K4nmH4BcBQM9Ar8ABQAvAA8AB4A8PQDvgDwHgExvgA09AC+ADAeADN+ADC+AFAeAJGUBHQAPgGwFAPUArQAPgCwFAH+AHAcArQAfgCx9AAUAbwAFAI0APQAPAAUATwAHAC+ADH+APC0ABQBtAA0ABwDsHrwGvAa8BrwE=
# Converted
9999, 25320, 3506, 1750, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 1324, 431, 1324, 431, 1324, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 1324, 431, 1324, 431, 487, 431, 431, 431, 431, 431, 487, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 487, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 487, 431, 1324, 431, 487, 431, 1324, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 487, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 487, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 1324, 431, 35373, 3506, 1750, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 1324, 431, 1324, 431, 1324, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 1324, 431, 487, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 487, 431, 1324, 431, 1324, 431, 431, 431, 431, 431, 487, 431, 431, 431, 431, 431, 487, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 1324, 431, 431, 431, 431, 431, 431, 431, 1324, 431, 1324, 431, 431, 431, 487, 431, 431, 431, 431, 431, 431, 431

Captured when AC was in cool mode. Temperature button (down) was pressed.
State/settings: mode: cool 25.0, fan breeze, swingv: highest, swingh: sensor auto, light: bright, beep: quiet, announce: on

EBUn7mKzDdYGzQE1Bc0BzQGWIAFABQHNAUAPQAeAAYAJATUF4AEHAzUFzQFAAUAHATUFgA8BNQVAAwKWAc1gAQWWATUFzQFAAQKWAc0gAUAF4AcDQAHAEwPNATUFwAvgAwdAAeADD4ALwCsCNQXNIAMFlgHNAZYBwAdAC+ABA0AB4AMP4A8LAs0BliABQAXAA+ADTwI1Bc0gAwOWAc0B4AcDQAGAE+ANH+ANF0ArQAMAzWABAZYBgAvgBwdAAQGWAcADQCPgAwOAF0ABgAtAG8ALAM0gAQCWIAFAE0ADQA1AA4ALAs0BliABQAXgFQNAAeAFI4A/AZYBQAMHNQXNAc0BlgHgJwMBNQWAA0A3wAsBRopChwGWAUAPQBeAAwHNAYAPQAHAEwGWAYATgAcFNQXNAc0BQAfgCQNAF0ADQBtAB+AFA0AB4AcTwA9AAcAL4AUH4AFLAc0BQAvAAwHNAeABA0ATwA9AC0ADwA8AzWABQAfgCwMCzQGWIAFABQDNYAEBlgFAO0ADwAtABwDNYAFAB+AXA0AB4AkjQE9AAwDNYAFAB+AVA0ArQAPgFyfAH8ArwAfAF+ADB+AHG0APQAPgAyPgBwvgAx/gFwvgAx8LzQGWAc0BlgHNAZYB
# Converted
10005, 25326, 3507, 1750, 461, 1333, 461, 461, 406, 406, 461, 406, 461, 1333, 461, 406, 461, 461, 461, 461, 406, 461, 461, 1333, 406, 461, 461, 1333, 406, 1333, 461, 461, 461, 1333, 461, 1333, 406, 1333, 461, 1333, 461, 1333, 406, 461, 461, 461, 406, 1333, 461, 461, 461, 406, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 461, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 1333, 461, 1333, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 406, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 461, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 461, 461, 406, 1333, 406, 461, 406, 1333, 406, 461, 406, 1333, 406, 461, 461, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 1333, 406, 1333, 406, 461, 406, 461, 461, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 461, 406, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 461, 461, 406, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 406, 1333, 406, 1333, 406, 35398, 3507, 1750, 406, 1333, 406, 461, 406, 461, 406, 461, 461, 1333, 406, 461, 461, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 1333, 406, 1333, 461, 461, 406, 1333, 406, 1333, 406, 1333, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 461, 1333, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 406, 406, 461, 406, 461, 461, 461, 406, 1333, 406, 1333, 406, 461, 406, 1333, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 461, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 1333, 406, 461, 406, 1333, 406, 461, 406, 461, 406, 461, 406, 461, 406, 461, 406

Captured when AC was in cool mode. Off button was pressed.
State/settings: mode: cool 25.0, fan: breeze, swingv: highest, swingh: sensor auto, light: bright, beep: quiet, announce: on

EEonCGOcDdgGygE3BcoBkgHK4AABQA/AAYAXAZIBwBNAB0ADQAEBNwWAFwE3BeABA4ABgBcEygGSAcogAYAF4AcBgBXABQM3BZIBwA1AAUANAcoBgAUBygHgBQeAKwHKAUAHBTcFygHKAeABB0AL4AMDwB/gAxOAC0ABwAvgCQcENwWSAcpgAUAHAZIBgA8BkgGAA0ABwAuAB+AFHwKSAcpgAQGSAeAJF4ATwBcCNwXKIAMFkgHKAZIBgAcBygGABwGSAeADA0ATAjcFyiADQAcDkgHKAeADAwfKATcFygHKAeADEwOSATcFQAMGygHKAZIByiABATcFgAcBygFAB8ADQAHgCwvAE8AHAcoBgD+AD+ADC8AT4A8HQCvAA0AjQAvAB0ALAWCKQocBkgFACwDKYAFABwGSAYAPAZIB4AMDBTcFygHKAUAHgAPgAQsEygE3BZLgAAMBygGAAwc3BcoBygGSAYADQAHAC+AHB0AB4AcT4AsPQAEDkgE3BeABA0APgAMBygFAFwHKAYADQAtAA4APQAHAC+AdB0A7QAMAyiABgAdAC+APA0AB4A8b4AEXQEdAA+ADE+ATC0ArCDcFygHKAZIBymABQAfgEQMDNwWSAUAfwAdAC+AHA+AHG0APQAPAJwP6AZIBwAvAB+ADH+APC+ALKwv6AZIB+gGSAfoBkgE=
# Converted
10058, 25352, 3484, 1752, 458, 1335, 458, 402, 458, 458, 458, 458, 458, 1335, 458, 458, 458, 458, 458, 402, 458, 458, 402, 1335, 458, 458, 458, 1335, 458, 1335, 458, 458, 458, 1335, 402, 1335, 458, 1335, 458, 1335, 458, 1335, 458, 458, 458, 458, 402, 1335, 458, 458, 402, 458, 458, 402, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 402, 458, 458, 402, 458, 458, 402, 1335, 402, 458, 402, 458, 458, 458, 458, 402, 458, 458, 402, 458, 458, 458, 402, 458, 458, 458, 402, 458, 458, 1335, 402, 458, 458, 1335, 402, 1335, 458, 458, 402, 1335, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 458, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 458, 402, 1335, 458, 1335, 402, 458, 402, 1335, 402, 458, 458, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 458, 1335, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 458, 1335, 458, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 458, 458, 402, 458, 458, 1335, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 458, 1335, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 1335, 402, 458, 402, 1335, 402, 458, 402, 1335, 402, 1335, 402, 35424, 3484, 1752, 402, 1335, 402, 458, 458, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 458, 458, 402, 1335, 402, 1335, 402, 458, 402, 1335, 402, 1335, 458, 1335, 402, 1335, 402, 1335, 402, 458, 402, 458, 402, 1335, 458, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 1335, 402, 1335, 402, 1335, 402, 458, 402, 458, 402, 458, 458, 1335, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 458, 458, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 458, 458, 402, 458, 458, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 1335, 402, 458, 402, 458, 402, 506, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 458, 402, 458, 402, 1335, 402, 458, 402, 458, 402, 506, 402, 506, 402, 506, 402

@NiKiZe

NiKiZe commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Does this change make the original captures to being unknown? That would potentially be a breaking change.
Would be good if we could get verification from others using the devices in supported that it still works, or if there is a need for different protocols?

@naoki-mizuno

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look.

Does this change make the original captures to being unknown?

Not necessarily. As far as I tested, it was only the leader pulse that was missing from the original captures and all other parts were working. The IR signal based on the original captures are accepted by the AC (only issue is that the AC stops responding to signals after a few hours of silence). This is the reason why I don’t think my unit is using a different protocol.

Still, it would be nice to get some help verifying that this (and perhaps also #2268) doesn’t break anything. Pinging @carl09 and @AntonWert who were involved in #2246 and #1829 for adding Daikin 312 protocol support.

As a side note, I’ve been using IR signals generated with the changes in this PR and also #2268 for over a month now and had no issues.

@carl09

carl09 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Hi @naoki-mizuno

I tested out your changes on my AC units and they work perfectly. Thank you for your effort on fixing this up

@naoki-mizuno

Copy link
Copy Markdown
Contributor Author

@carl09 Thank you very much for testing it out! I appreciate your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants