Climate IR driver for the Daikin BRCxxxx remotes?

I’ve got this working as a custom climate component using irRemoteESP8266. Dealing with the power toggling was a little tricky (The Daikin Series 17 don’t have discreet on/off so you have to toggle the state in code) but I eventually figured it out. Header file is here and the ESPHome yaml is here, in case they are useful to anyone stumbling across this later.

@hagak - can you give me any pointers on how you converted the ir codes for your project? The codes are broken out in ir_Daikin.h and ir_Daikin.cpp from the iRemoteESP8266 project (Daikin128) but translating that in to the format ESPHome needs isn’t obvious to me yet.

Ideally I’d create a custom component like you are doing for the other BRC remotes because there are some limitations to implementing Climate via Arduino libraries like I am doing here.

So from the irRemote they have my remote as having a 22 byte packet.

union Daikin176Protocol{
  uint8_t raw[kDaikin176StateLength];  ///< The state of the IR remote.
  struct {
    // Byte 0~2
    uint8_t      :8;
    uint8_t      :8;
    uint8_t      :8;
    // Byte 3
    uint8_t Id1  :1;
    uint8_t      :7;
    // Byte 4
    uint8_t      :8;
    // Byte 5
    uint8_t      :8;
    // Byte 6
    uint8_t Sum1 :8;
    // Byte 7-9
    uint8_t      :8;
    uint8_t      :8;
    uint8_t      :8;
    // Byte 10
    uint8_t Id2  :1;
    uint8_t      :7;
    // Byte 11
    uint8_t      :8;
    // Byte 12
    uint8_t         :4;
    uint8_t AltMode :3;
    uint8_t         :1;
    // Byte 13
    uint8_t ModeButton  :8;
    // Byte 14
    uint8_t Power :1;
    uint8_t       :3;
    uint8_t Mode  :3;
    uint8_t       :1;
    // Byte 15~16
    uint8_t pad2[2];
    // Byte 17
    uint8_t       :1;
    uint8_t Temp  :6;
    uint8_t       :1;
    // Byte 18
    uint8_t SwingH  :4;
    uint8_t Fan     :4;
    // Byte 19~20
    uint8_t pad3[2];
    // Byte 21
    uint8_t Sum2  :8;
  };
};

In my code i have it split into two parts with the first 7 bytes marked as the preamble cause that data is not going to change for most users (the channel id per unit will always be the same). So the data i care about is in the last 15 bytes. and they mark up exactly what each byte or nimble is used for (actually down to the bit in some cases)

If you want to get something working I recommend getting the receive part working first, easiest to simulate and test. Once that is working you now have a receiver you can use to test your transmit.

If you notice in my receive logic I am looking for the HEADER_MARK which denotes the start of the 15 bytes of the frame, again don’t care about the preamble on receive. Course I would if I used multiple channels but i don’t so I took the easy way out. On transmit the preamble is just a constant, again cause i don’t care about multiple channels. So after the preamble i start receiving data into an array until i have all the bits. Some logic in there to fail out if the frame header is invalid. Then I just parse the bytes into the different components. Once you have receive working getting transmit to work is not hard.

Thanks so much! I forgot to ask you which Daikin protocol you were using. Knowing it is 176 gives me a great reference point to modify for 128.

The tricky bit, again, is going to be the Power toggle because I believe the 176 has discrete on/off. I may need to dig around the ESPHome project because there has to be an already supported model that has the same issue right?

It has a Power bit and a Mode section, Mode probably has an Off Mode.

It does, that’s how I got it to work with the IR library e.g.

    void togglePowerOn() {
      if (this->mode == CLIMATE_MODE_OFF) {
         ac.setPowerToggle(true);
         } else {
           ac.setPowerToggle(false);
      }
    }

If I can work out how to duplicate that in ESPHome I’m good.

keep in mind every time you transmit to it you transmit EVERYTHING, so even if you tell it to be OFF you send the temperature, fan speed, etc.

So OFF is just another mode, nothing really special here compared to setting the other bits. Some modes do have special cases like FAN ONLY you need to set the temp. to a specific temp, at least that is what the remote does. You can see this in my code.

Hi there, I found this thread now as I was looking for a solution to control my Daikin AC that has also a BRC remote but different than the one supported in the daikin_brc component.

I already did some reverse engineering on my AC and have a solution working for a month now. See the story here: GitHub - BogdanDIA/Daikin_brc52A6x: Control of Daikin AC with ESPHome

The remote is BRC52A6x and the AC is R410A Split series Model FTXB50CV1B. The IR protocol is 8bytes.

Regards,
Bogdan