Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRSamsungAc::convertFan doesn't work for kMax Fan Speed #1675

Closed
xorbital opened this issue Nov 11, 2021 · 6 comments · Fixed by #1678
Closed

IRSamsungAc::convertFan doesn't work for kMax Fan Speed #1675

xorbital opened this issue Nov 11, 2021 · 6 comments · Fixed by #1678
Assignees
Labels

Comments

@xorbital
Copy link
Contributor

Version/revision of the library used

Latest master (d896068)

Describe the bug

I was testing the new changes to the Samsung_AC protocol with a freshly compiled Tasmota(IRhvac, this is using irAC) when I noticed that setting the fan speed to Turbo/Max doesn't work - the Fan Speed gets set to Auto instead. All other fan speeds work.
Something seems to go wrong when converting the FanSpeed from irAC to irSamsungAC.

To Reproduce

  1. Send a message with ControlSamsunAC.ino with Turbo Fan Speed
  2. Send a message with CommonACControl.ino with Max Fan Speed
  3. Compare the results, the Nibble holding the Fan Speed is different

Example code used

First Step
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRac.h>
#include <IRutils.h>

const uint16_t kIrLed = 4;  // The ESP GPIO pin to use that controls the IR LED.
IRac ac(kIrLed);  // Create a A/C object using GPIO to sending messages with.

void setup() {
  Serial.begin(115200);
  delay(200);
  ac.next.protocol = decode_type_t::SAMSUNG_AC;  // Set a protocol to use.
  ac.next.model = 1;  // Some A/Cs have different models. Try just the first.
  ac.next.mode = stdAc::opmode_t::kCool;  // Run in cool mode initially.
  ac.next.celsius = true;  // Use Celsius for temp units. False = Fahrenheit
  ac.next.degrees = 25;  // 25 degrees.
  ac.next.fanspeed = stdAc::fanspeed_t::kMax;
  ac.next.swingv = stdAc::swingv_t::kOff;  // Don't swing the fan up or down.
  ac.next.swingh = stdAc::swingh_t::kOff;  // Don't swing the fan left or right.
  ac.next.light = false;  // Turn off any LED/Lights/Display that we can.
  ac.next.beep = false;  // Turn off any beep from the A/C if we can.
  ac.next.econo = false;  // Turn off any economy modes if we can.
  ac.next.filter = false;  // Turn off any Ion/Mold/Health filters if we can.
  ac.next.turbo = false;  // Don't use any turbo/powerful/etc modes.
  ac.next.quiet = false;  // Don't use any quiet/silent/etc modes.
  ac.next.sleep = -1;  // Don't set any sleep time or modes.
  ac.next.clean = false;  // Turn off any Cleaning options if we can.
  ac.next.clock = -1;  // Don't set any current time if we can avoid it.
  ac.next.power = false;  // Initially start with the unit off.
}

void loop() {
      ac.next.fanspeed = stdAc::fanspeed_t::kLow;
      ac.sendAc();  // Have the IRac class create and send a message.
      delay(2000); 
      
      ac.next.fanspeed = stdAc::fanspeed_t::kMedium;
      ac.sendAc();  // Send the message.
      delay(2000);
      
      ac.next.fanspeed = stdAc::fanspeed_t::kHigh;
      ac.sendAc();  // Send the message.
      delay(2000);
      
      ac.next.fanspeed = stdAc::fanspeed_t::kMax;
      ac.sendAc();  // Send the message.
      delay(2000);
  Serial.println("Starting from the begining again ...");
}
Second Step
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <ir_Samsung.h>

const uint16_t kIrLed = 4;  // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRSamsungAc ac(kIrLed);     // Set the GPIO used for sending messages.

void printState() {
  // Display the settings.
  Serial.println("Samsung A/C remote is in the following state:");
  Serial.printf("  %s\n", ac.toString().c_str());
}

void setup() {
  ac.begin();
  Serial.begin(115200);
  delay(2000);

  // Set up what we want to send. See ir_Samsung.cpp for all the options.
  Serial.println("Default state of the remote.");
  printState();
  Serial.println("Setting initial state for A/C.");
  ac.off();
  ac.setFan(kSamsungAcFanTurbo);
  ac.setMode(kSamsungAcCool);
  ac.setTemp(25);
  ac.setSwing(false);
  printState();
}

void loop() {
  ac.on();
  ac.send();
  printState();
  delay(3000);
  
  ac.setFan(kSamsungAcFanAuto);
  ac.send();
  printState();
  delay(3000);

  ac.setFan(kSamsungAcFanLow);
  ac.send();
  printState();
  delay(3000);

  ac.setFan(kSamsungAcFanMed);
  ac.send();
  printState();
  delay(3000);


  ac.setFan(kSamsungAcFanHigh);
  ac.send();
  printState();
  delay(3000);
  
  ac.setFan(kSamsungAcFanTurbo);
  ac.send();
  printState();
  delay(3000);
}

Expected behaviour

The code above should produce messages that are identical (short/long code aside), the nibble holding the fan speed should look like this:
1 1 1 1, but it's 0 0 0 1.

Output of raw data from IRrecvDumpV2.ino or V3 (if applicable)

Output from Code Sample 1:

Timestamp : 000549.048
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02B20F000000C001D20F0000000001F2FE619015C0 (168 Bits)
Mesg Desc.: Power: Off, Mode: 1 (Cool), Temp: 25C, Fan: 2 (Low), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: Off, Ion: Off
uint16_t rawData[349] = {716, 17838,  3068, 8896,  644, 416,  610, 1412,  612, 414,  610, 414,  612, 412,  612, 414,  612, 412,  612, 416,  612, 414,  610, 1412,  610, 416,  610, 418,  612, 1412,  612, 1410,  612, 416,  612, 1412,  612, 1436,  586, 1408,  610, 1410,  612, 1410,  612, 414,  614, 412,  612, 412,  612, 414,  612, 416,  612, 416,  612, 414,  612, 416,  612, 416,  610, 416,  612, 416,  612, 416,  612, 412,  610, 414,  612, 414,  612, 414,  612, 414,  612, 412,  612, 440,  586, 414,  610, 442,  586, 414,  612, 414,  610, 442,  588, 440,  586, 442,  586, 416,  612, 416,  610, 414,  612, 414,  612, 414,  612, 414,  612, 414,  612, 440,  584, 1410,  610, 1414,  610, 2846,  3066, 8886,  640, 1434,  586, 412,  612, 414,  612, 440,  586, 442,  586, 414,  612, 416,  610, 416,  612, 416,  610, 1412,  612, 416,  612, 442,  584, 1432,  592, 416,  610, 1412,  612, 1436,  586, 1408,  612, 1408,  612, 1408,  610, 1436,  588, 414,  612, 436,  586, 414,  612, 412,  612, 416,  610, 416,  610, 442,  586, 416,  612, 414,  612, 416,  612, 416,  612, 416,  614, 412,  612, 412,  612, 414,  612, 414,  612, 412,  612, 440,  586, 414,  612, 414,  610, 416,  612, 440,  586, 416,  612, 414,  612, 414,  612, 416,  612, 414,  612, 416,  612, 414,  610, 442,  584, 414,  612, 440,  586, 414,  612, 414,  612, 438,  586, 414,  612, 2864,  3042, 8876,  646, 1412,  610, 416,  612, 416,  612, 416,  612, 416,  610, 442,  586, 414,  610, 416,  610, 416,  610, 1436,  586, 412,  610, 440,  586, 1408,  612, 1408,  610, 1410,  612, 1412,  612, 416,  610, 1412,  610, 1412,  612, 1412,  612, 1412,  612, 1410,  612, 1412,  612, 1428,  594, 1436,  586, 412,  612, 414,  612, 412,  612, 440,  586, 1408,  612, 1408,  610, 416,  612, 416,  612, 414,  610, 416,  610, 442,  588, 1410,  610, 416,  610, 442,  586, 1412,  612, 1410,  612, 440,  586, 1408,  612, 412,  612, 1410,  610, 416,  612, 414,  612, 440,  586, 414,  612, 414,  612, 414,  610, 416,  612, 436,  590, 416,  612, 1416,  606, 1438,  586};  // SAMSUNG_AC
uint8_t state[21] = {0x02, 0xB2, 0x0F, 0x00, 0x00, 0x00, 0xC0, 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF2, 0xFE, 0x61, 0x90, 0x15, 0xC0};


Timestamp : 000551.425
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02B20F000000C001D20F0000000001F2FE619019C0 (168 Bits)
Mesg Desc.: Power: Off, Mode: 1 (Cool), Temp: 25C, Fan: 4 (Med), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: Off, Ion: Off
uint16_t rawData[349] = {714, 17834,  3074, 8878,  646, 414,  612, 1408,  612, 416,  610, 442,  586, 416,  610, 442,  586, 442,  584, 428,  600, 416,  612, 1438,  586, 416,  612, 416,  612, 1410,  612, 1410,  610, 416,  612, 1412,  612, 1434,  584, 1436,  586, 1410,  612, 1410,  610, 414,  612, 412,  610, 414,  610, 440,  586, 416,  612, 440,  586, 416,  612, 440,  586, 416,  612, 416,  612, 414,  610, 418,  612, 414,  612, 414,  612, 412,  610, 414,  612, 414,  612, 438,  588, 412,  612, 414,  612, 416,  610, 416,  612, 414,  586, 440,  612, 416,  610, 416,  612, 440,  586, 416,  612, 414,  612, 412,  610, 414,  610, 416,  612, 426,  598, 414,  612, 1410,  612, 1432,  588, 2870,  3040, 8880,  644, 1410,  612, 414,  610, 414,  612, 414,  612, 412,  610, 414,  612, 412,  612, 414,  612, 436,  592, 1410,  610, 424,  606, 414,  610, 1412,  610, 442,  586, 1412,  612, 1412,  612, 1436,  588, 1410,  612, 1412,  612, 1438,  586, 416,  610, 442,  588, 414,  610, 416,  612, 414,  612, 414,  610, 414,  612, 414,  610, 416,  610, 442,  586, 414,  612, 416,  612, 442,  586, 414,  612, 416,  610, 442,  586, 416,  610, 418,  610, 416,  612, 416,  612, 414,  612, 438,  586, 414,  610, 414,  610, 416,  612, 438,  586, 414,  612, 426,  602, 414,  612, 414,  610, 442,  586, 416,  612, 416,  612, 416,  612, 414,  610, 442,  586, 2868,  3042, 8878,  646, 1410,  612, 414,  610, 440,  586, 440,  584, 414,  610, 414,  612, 414,  612, 414,  612, 414,  612, 1410,  612, 416,  610, 416,  612, 1436,  584, 1386,  638, 1412,  612, 1412,  610, 416,  610, 1434,  588, 1434,  588, 1410,  612, 1432,  588, 1410,  612, 1408,  612, 1410,  612, 1436,  584, 416,  614, 414,  612, 414,  612, 416,  612, 1436,  588, 1412,  612, 416,  610, 414,  612, 438,  586, 414,  612, 438,  586, 1410,  612, 414,  610, 416,  612, 1410,  612, 1412,  612, 416,  596, 430,  612, 1410,  612, 1412,  610, 416,  612, 416,  610, 416,  610, 440,  586, 414,  614, 424,  598, 414,  610, 414,  612, 438,  586, 1410,  610, 1410,  612};  // SAMSUNG_AC
uint8_t state[21] = {0x02, 0xB2, 0x0F, 0x00, 0x00, 0x00, 0xC0, 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF2, 0xFE, 0x61, 0x90, 0x19, 0xC0};


Timestamp : 000553.803
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02B20F000000C001D20F0000000001E2FE61901BC0 (168 Bits)
Mesg Desc.: Power: Off, Mode: 1 (Cool), Temp: 25C, Fan: 5 (High), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: Off, Ion: Off
uint16_t rawData[349] = {720, 17830,  3076, 8884,  640, 434,  590, 1414,  610, 416,  612, 440,  586, 418,  610, 442,  586, 442,  586, 416,  612, 414,  612, 1412,  612, 416,  612, 442,  584, 1438,  586, 1412,  612, 416,  612, 1412,  610, 1410,  610, 1410,  612, 1410,  610, 1436,  586, 416,  612, 442,  586, 440,  584, 440,  588, 438,  590, 440,  586, 440,  586, 416,  612, 416,  610, 442,  586, 414,  612, 416,  612, 412,  610, 414,  612, 414,  612, 414,  612, 412,  612, 414,  612, 440,  584, 414,  610, 416,  612, 442,  588, 414,  610, 416,  612, 414,  612, 432,  592, 416,  612, 416,  612, 414,  612, 440,  586, 440,  586, 414,  612, 412,  612, 412,  612, 1432,  588, 1410,  612, 2870,  3042, 8884,  640, 1410,  610, 414,  610, 440,  586, 432,  594, 438,  586, 440,  584, 440,  586, 414,  614, 414,  610, 1412,  612, 442,  586, 416,  612, 1410,  612, 416,  612, 1438,  584, 1438,  588, 1410,  612, 1412,  614, 1436,  586, 1412,  610, 414,  610, 414,  610, 414,  612, 440,  584, 442,  586, 416,  612, 414,  612, 416,  612, 416,  612, 442,  586, 440,  586, 440,  586, 440,  586, 416,  610, 416,  612, 440,  584, 416,  612, 416,  610, 442,  586, 442,  584, 414,  612, 438,  586, 414,  612, 414,  612, 414,  610, 440,  586, 436,  590, 414,  610, 416,  610, 416,  610, 416,  610, 442,  588, 414,  612, 414,  612, 414,  612, 442,  586, 2866,  3042, 8880,  642, 1436,  586, 412,  612, 414,  612, 414,  612, 412,  612, 416,  614, 414,  610, 416,  614, 414,  610, 1412,  610, 442,  584, 416,  610, 416,  610, 1412,  612, 1412,  610, 1438,  584, 414,  612, 1436,  584, 1410,  612, 1408,  612, 1410,  612, 1408,  610, 1436,  586, 1410,  612, 1410,  612, 440,  586, 418,  610, 416,  610, 418,  612, 1412,  612, 1412,  612, 414,  612, 438,  586, 414,  612, 412,  612, 414,  612, 1434,  586, 414,  610, 414,  612, 1436,  586, 1412,  610, 1438,  584, 442,  586, 1410,  614, 1436,  586, 442,  566, 462,  586, 416,  612, 414,  612, 414,  612, 440,  584, 414,  612, 438,  586, 414,  612, 1408,  612, 1436,  586};  // SAMSUNG_AC
uint8_t state[21] = {0x02, 0xB2, 0x0F, 0x00, 0x00, 0x00, 0xC0, 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE2, 0xFE, 0x61, 0x90, 0x1B, 0xC0};


Timestamp : 000556.176
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02B20F000000C001D20F000000000102FF619011C0 (168 Bits)
Mesg Desc.: Power: Off, Mode: 1 (Cool), Temp: 25C, Fan: 0 (Auto), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: Off, Ion: Off
uint16_t rawData[349] = {692, 17860,  3070, 8884,  638, 416,  612, 1408,  588, 440,  612, 416,  612, 414,  612, 416,  612, 440,  586, 416,  610, 418,  608, 1438,  586, 416,  612, 416,  612, 1410,  612, 1412,  612, 434,  592, 1412,  586, 1434,  612, 1408,  612, 1436,  584, 1410,  610, 416,  612, 412,  612, 414,  612, 414,  610, 416,  610, 442,  586, 416,  612, 416,  610, 416,  610, 416,  610, 418,  612, 414,  612, 414,  612, 440,  586, 438,  588, 414,  612, 428,  596, 416,  610, 414,  612, 414,  610, 416,  612, 414,  610, 444,  586, 440,  584, 444,  584, 416,  610, 416,  610, 416,  610, 414,  612, 414,  610, 416,  612, 414,  610, 416,  610, 416,  610, 1436,  586, 1426,  596, 2868,  3040, 8886,  640, 1410,  604, 446,  586, 414,  612, 440,  586, 414,  610, 414,  610, 440,  588, 414,  612, 440,  586, 1410,  612, 424,  602, 416,  612, 1412,  610, 416,  612, 1410,  612, 1414,  612, 1436,  586, 1410,  610, 1438,  586, 1410,  612, 416,  612, 416,  610, 416,  612, 440,  584, 414,  612, 414,  610, 416,  610, 416,  612, 416,  612, 440,  586, 440,  586, 442,  584, 418,  612, 442,  586, 414,  612, 416,  610, 416,  612, 414,  612, 414,  610, 416,  612, 438,  584, 416,  610, 414,  610, 440,  586, 440,  586, 414,  610, 414,  612, 414,  612, 442,  586, 416,  612, 416,  610, 416,  610, 440,  588, 416,  610, 418,  610, 416,  612, 2866,  3040, 8882,  642, 1412,  612, 414,  612, 440,  586, 414,  610, 414,  612, 414,  612, 440,  586, 414,  610, 416,  610, 1412,  610, 416,  612, 416,  612, 442,  586, 440,  588, 416,  610, 416,  610, 1412,  612, 1410,  612, 1410,  612, 1436,  586, 1408,  612, 1410,  610, 1412,  610, 1412,  610, 1432,  592, 416,  586, 440,  610, 416,  610, 438,  590, 1412,  596, 1426,  610, 416,  612, 414,  612, 440,  584, 414,  610, 414,  612, 1408,  612, 414,  612, 438,  586, 1436,  584, 1412,  612, 442,  586, 416,  610, 416,  612, 1412,  610, 418,  612, 416,  612, 416,  610, 414,  610, 416,  612, 438,  586, 414,  612, 414,  612, 412,  610, 1410,  614, 1408,  612};  // SAMSUNG_AC
uint8_t state[21] = {0x02, 0xB2, 0x0F, 0x00, 0x00, 0x00, 0xC0, 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0xFF, 0x61, 0x90, 0x11, 0xC0};

Output from Code Sample 2:

Timestamp : 000699.995
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001D20F0000000001A2FE71901FF0 (168 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 7 (Turbo), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[349] = {718, 17828,  3072, 8892,  620, 468,  586, 1412,  612, 414,  612, 442,  584, 418,  610, 416,  610, 416,  586, 466,  586, 414,  610, 1436,  586, 414,  612, 440,  586, 1410,  612, 414,  612, 414,  612, 1410,  610, 1412,  610, 1414,  612, 1436,  586, 1412,  612, 414,  610, 418,  612, 414,  610, 416,  612, 414,  610, 414,  612, 414,  612, 414,  610, 416,  612, 438,  586, 436,  586, 416,  610, 416,  612, 416,  610, 416,  610, 416,  610, 416,  610, 416,  610, 442,  586, 416,  610, 414,  612, 412,  612, 414,  612, 412,  612, 414,  612, 414,  610, 440,  586, 414,  610, 442,  584, 416,  612, 416,  610, 416,  612, 1436,  586, 1412,  612, 1412,  612, 1410,  610, 2872,  3042, 8880,  644, 1412,  612, 416,  612, 416,  610, 416,  612, 416,  612, 416,  612, 440,  586, 416,  612, 442,  586, 1412,  610, 442,  584, 440,  586, 1412,  612, 414,  614, 1410,  612, 1412,  610, 1410,  612, 1408,  612, 1408,  612, 1408,  612, 414,  610, 414,  612, 414,  610, 442,  588, 414,  612, 416,  610, 424,  602, 442,  584, 416,  612, 414,  612, 428,  598, 418,  612, 412,  610, 416,  612, 414,  614, 436,  588, 412,  612, 414,  612, 414,  612, 414,  612, 416,  610, 416,  612, 416,  612, 416,  610, 416,  612, 442,  584, 416,  610, 416,  612, 440,  586, 412,  610, 414,  610, 414,  610, 414,  612, 414,  610, 414,  612, 440,  584, 2866,  3042, 8882,  642, 1436,  586, 416,  612, 416,  612, 416,  612, 414,  612, 416,  610, 438,  592, 414,  610, 414,  612, 1436,  584, 414,  610, 414,  610, 440,  586, 1410,  612, 414,  610, 1414,  612, 416,  612, 1412,  612, 1412,  612, 1410,  612, 1412,  610, 1412,  612, 1410,  614, 1436,  586, 1410,  612, 412,  612, 414,  610, 414,  612, 1434,  586, 1410,  612, 1408,  612, 414,  612, 416,  612, 414,  612, 440,  584, 416,  610, 1412,  612, 416,  610, 416,  610, 1414,  610, 1410,  612, 1434,  584, 1412,  614, 1408,  612, 1410,  610, 414,  612, 412,  612, 414,  612, 414,  612, 416,  612, 422,  604, 416,  610, 1412,  614, 1410,  614, 1410,  612, 1410,  612};  // SAMSUNG_AC
uint8_t state[21] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xA2, 0xFE, 0x71, 0x90, 0x1F, 0xF0};


Timestamp : 000703.298
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001D2FE719011F0 (112 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 0 (Auto), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[233] = {674, 17878,  3068, 8880,  646, 416,  610, 1410,  612, 416,  610, 416,  612, 416,  610, 418,  612, 414,  612, 416,  612, 416,  612, 1412,  610, 442,  588, 426,  598, 1412,  610, 442,  586, 420,  606, 1412,  610, 1410,  612, 1410,  612, 1410,  612, 1408,  612, 414,  610, 416,  612, 438,  586, 440,  588, 440,  584, 442,  584, 416,  612, 442,  584, 418,  610, 444,  584, 416,  610, 416,  612, 412,  610, 432,  592, 416,  612, 412,  612, 414,  610, 414,  610, 440,  586, 414,  610, 416,  612, 442,  586, 416,  612, 416,  610, 418,  612, 416,  610, 442,  586, 442,  584, 414,  610, 440,  586, 414,  614, 412,  612, 1408,  612, 1414,  606, 1410,  612, 1436,  584, 2866,  3042, 8880,  644, 1438,  588, 414,  612, 414,  610, 416,  610, 426,  604, 442,  586, 416,  610, 442,  586, 438,  586, 1434,  586, 414,  610, 414,  610, 1410,  610, 414,  612, 1412,  598, 1452,  584, 416,  610, 1438,  586, 1412,  610, 1412,  612, 1436,  584, 1412,  612, 1410,  610, 1412,  612, 1410,  612, 440,  586, 440,  586, 440,  586, 1420,  600, 1434,  588, 1408,  614, 412,  612, 416,  610, 416,  612, 442,  586, 416,  612, 1412,  612, 416,  610, 416,  612, 1438,  586, 1410,  612, 414,  610, 440,  586, 438,  586, 1410,  610, 416,  610, 414,  612, 414,  612, 414,  610, 416,  610, 418,  610, 442,  584, 1412,  612, 1410,  612, 1438,  586, 1436,  584};  // SAMSUNG_AC
uint8_t state[14] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xD2, 0xFE, 0x71, 0x90, 0x11, 0xF0};


Timestamp : 000706.604
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001C2FE719015F0 (112 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 2 (Low), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[233] = {672, 17872,  3074, 8878,  646, 414,  612, 1410,  612, 414,  610, 416,  612, 412,  612, 412,  612, 414,  612, 414,  610, 416,  612, 1410,  610, 418,  610, 416,  610, 1414,  610, 416,  612, 416,  612, 1410,  612, 1408,  612, 1410,  612, 1410,  612, 1408,  612, 414,  610, 414,  612, 414,  612, 432,  594, 416,  610, 416,  612, 424,  604, 414,  610, 416,  610, 416,  612, 416,  610, 416,  610, 414,  612, 438,  586, 414,  612, 414,  612, 414,  610, 414,  612, 420,  604, 440,  586, 416,  612, 416,  612, 414,  610, 442,  586, 416,  610, 442,  586, 416,  612, 416,  612, 416,  610, 416,  612, 414,  612, 442,  586, 1412,  612, 1410,  612, 1410,  612, 1412,  612, 2864,  3042, 8884,  638, 1414,  610, 416,  612, 416,  610, 418,  612, 416,  610, 416,  612, 416,  610, 420,  606, 442,  586, 1412,  612, 414,  612, 414,  612, 416,  610, 442,  584, 1434,  590, 1412,  612, 440,  586, 1410,  612, 1410,  612, 1410,  612, 1410,  612, 1434,  586, 1410,  612, 1412,  612, 1410,  610, 442,  586, 416,  614, 440,  586, 1412,  612, 1412,  612, 1412,  612, 416,  612, 438,  588, 414,  610, 414,  612, 438,  584, 1410,  612, 412,  612, 412,  614, 1408,  612, 1412,  610, 416,  612, 1412,  610, 418,  612, 1436,  586, 440,  588, 416,  612, 416,  612, 440,  584, 414,  614, 412,  612, 412,  612, 1408,  612, 1408,  614, 1408,  612, 1410,  610};  // SAMSUNG_AC
uint8_t state[14] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xC2, 0xFE, 0x71, 0x90, 0x15, 0xF0};


Timestamp : 000709.910
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001C2FE719019F0 (112 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 4 (Med), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[233] = {674, 17872,  3074, 8884,  640, 416,  612, 1410,  612, 416,  612, 440,  586, 436,  592, 442,  562, 466,  586, 416,  612, 442,  586, 1412,  612, 414,  610, 416,  610, 1412,  610, 418,  610, 418,  610, 1412,  610, 1436,  588, 1408,  612, 1410,  612, 1410,  610, 414,  610, 414,  610, 416,  610, 414,  612, 414,  612, 416,  610, 416,  612, 414,  612, 416,  610, 416,  610, 416,  612, 416,  612, 412,  612, 440,  586, 438,  586, 414,  612, 438,  586, 414,  610, 426,  600, 414,  612, 442,  586, 416,  610, 416,  612, 414,  610, 416,  612, 440,  584, 416,  610, 444,  584, 416,  610, 414,  610, 414,  612, 412,  612, 1408,  612, 1410,  612, 1408,  612, 1410,  612, 2866,  3040, 8886,  614, 1436,  612, 416,  610, 418,  610, 416,  612, 414,  610, 416,  612, 416,  612, 416,  610, 440,  584, 1412,  612, 440,  586, 414,  612, 426,  598, 414,  612, 1410,  612, 1412,  612, 440,  584, 1438,  586, 1412,  612, 1432,  590, 1412,  610, 1412,  612, 1412,  588, 1436,  612, 1436,  586, 440,  586, 412,  612, 412,  612, 1410,  612, 1410,  612, 1408,  612, 414,  610, 416,  612, 416,  610, 442,  584, 442,  586, 1410,  610, 416,  612, 416,  612, 1412,  612, 1408,  612, 440,  586, 414,  612, 1434,  584, 1410,  612, 414,  610, 414,  612, 440,  586, 414,  612, 416,  610, 442,  586, 442,  586, 1412,  612, 1410,  610, 1412,  610, 1438,  586};  // SAMSUNG_AC
uint8_t state[14] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xC2, 0xFE, 0x71, 0x90, 0x19, 0xF0};


Timestamp : 000713.218
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001B2FE71901BF0 (112 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 5 (High), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[233] = {668, 17878,  3068, 8882,  642, 414,  610, 1410,  612, 414,  612, 414,  610, 414,  612, 414,  610, 414,  612, 414,  610, 442,  586, 1410,  610, 416,  612, 416,  610, 1412,  610, 416,  612, 416,  610, 1412,  612, 1410,  610, 1412,  612, 1412,  612, 1412,  612, 416,  610, 416,  610, 416,  610, 418,  610, 442,  570, 428,  612, 414,  610, 416,  610, 418,  612, 414,  612, 414,  610, 416,  610, 416,  612, 414,  612, 416,  612, 416,  612, 416,  610, 416,  614, 414,  610, 416,  610, 414,  612, 414,  612, 412,  612, 412,  610, 428,  596, 416,  612, 414,  612, 414,  610, 442,  584, 416,  610, 442,  586, 416,  612, 1438,  584, 1412,  612, 1436,  586, 1410,  610, 2870,  3040, 8886,  638, 1412,  610, 414,  612, 414,  610, 414,  612, 440,  586, 414,  610, 416,  612, 414,  612, 416,  588, 1436,  612, 414,  612, 416,  612, 1412,  610, 1412,  610, 442,  586, 1412,  612, 414,  610, 1436,  586, 1408,  612, 1410,  612, 1408,  586, 1460,  586, 1410,  610, 1410,  610, 1422,  600, 416,  610, 416,  612, 416,  610, 1438,  586, 1412,  612, 1412,  612, 416,  610, 414,  612, 414,  610, 414,  612, 414,  612, 1410,  610, 416,  612, 414,  610, 1436,  586, 1412,  612, 1412,  612, 416,  612, 1412,  588, 1436,  612, 440,  584, 416,  610, 418,  612, 412,  612, 412,  612, 414,  612, 412,  612, 1410,  612, 1410,  614, 1408,  612, 1410,  610};  // SAMSUNG_AC
uint8_t state[14] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xB2, 0xFE, 0x71, 0x90, 0x1B, 0xF0};


Timestamp : 000716.526
Library   : v2.7.20

Protocol  : SAMSUNG_AC
Code      : 0x02920F000000F001A2FE71901FF0 (112 Bits)
Mesg Desc.: Power: On, Mode: 1 (Cool), Temp: 25C, Fan: 7 (Turbo), Swing(V): Off, Swing(H): Off, Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Econo: Off, Breeze: Off, Light: On, Ion: Off
uint16_t rawData[233] = {670, 17878,  3070, 8880,  646, 414,  610, 1410,  612, 412,  610, 416,  612, 412,  610, 414,  612, 412,  612, 412,  610, 416,  610, 1412,  612, 416,  612, 442,  584, 1414,  612, 422,  606, 416,  610, 1412,  612, 1410,  612, 1410,  610, 1410,  610, 1412,  610, 414,  612, 414,  610, 414,  612, 438,  584, 432,  596, 442,  584, 422,  606, 416,  612, 416,  610, 416,  610, 416,  612, 416,  612, 414,  612, 436,  586, 416,  612, 414,  612, 412,  612, 414,  610, 440,  586, 414,  612, 414,  610, 442,  588, 414,  612, 416,  612, 416,  610, 442,  584, 416,  610, 416,  612, 414,  612, 412,  610, 438,  588, 414,  610, 1410,  612, 1408,  610, 1410,  610, 1410,  612, 2866,  3042, 8884,  638, 1412,  610, 440,  588, 416,  610, 442,  586, 442,  586, 416,  610, 416,  610, 418,  612, 414,  612, 1408,  612, 414,  610, 430,  596, 414,  610, 1410,  612, 440,  586, 1412,  612, 414,  612, 1410,  612, 1412,  612, 1412,  612, 1438,  584, 1412,  614, 1428,  592, 1414,  612, 1408,  612, 414,  610, 416,  610, 414,  612, 1408,  612, 1408,  614, 1408,  610, 440,  586, 416,  612, 416,  612, 442,  586, 416,  610, 1412,  612, 414,  612, 440,  586, 1412,  612, 1408,  612, 1410,  612, 1410,  612, 1424,  598, 1408,  612, 414,  610, 414,  610, 414,  612, 416,  612, 416,  610, 416,  612, 414,  612, 1410,  610, 1412,  612, 1436,  586, 1412,  612};  // SAMSUNG_AC
uint8_t state[14] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x01, 0xA2, 0xFE, 0x71, 0x90, 0x1F, 0xF0};

What brand/model IR demodulator are you using?

It says "LFN", I can't find the exact model. I'm using this device to capture the codes. I'm sure it's not a VS1838b.

Circuit diagram and hardware used (if applicable)

See link above

I have followed the steps in the Troubleshooting Guide & read the FAQ

Yes

Has this library/code previously worked as expected for you?

No, this specific thing didn't

Other useful information

I've looked at ir_Samsung.cpp and found the spot where the fan speed is converted, so I changed the switch to return kSamsungAcFanTurbo in all cases - now all of them are set to auto, so there's no issue in this part, it needs to be somewhere else.

@crankyoldgit crankyoldgit self-assigned this Nov 12, 2021
@crankyoldgit
Copy link
Owner

I tracked this down to setPowerful():

// Turning off Powerful mode sets fan speed to Auto if we were in Turbo mode
if (_.Fan == kSamsungAcFanTurbo) setFan(kSamsungAcFanAuto);

In short, setTurbo(false) deliberately removes that fan speed because it isn't supposed to be available in normal operation afaik.
Defaulting to "auto" is just the best guess at what the previous non-turbo fan speed was in use. i.e. it's a safe default.

Per your code:

  ac.next.fanspeed = stdAc::fanspeed_t::kMax;
  ac.sendAc();  // Send the message.

In order to unlock the kSamsungAcFanTurbo fan speed, it needs to be in turbo mode per se.
e.g.

  ac.next.turbo = true;
  ac.sendAc();  // Send the message.

I can probably change the conversion routines, to make stdAc::fanspeed_t::kMax <=> kSamsungAcFanHigh if you think that will help with the confusion.

@xorbital
Copy link
Contributor Author

xorbital commented Nov 12, 2021

Ah, I see.
Well, I could send a picture of the remote, and maybe my unit is a bit different, so I could just change the code on my end and recompile.
For me, pressing the Fan buttion cycles through the speeds, them being Auto, then 1/4 bars, 2/4 bars, 3/4 bars and then (nothing really special about it) 4/4 bars.
"Turbo mode" or "Fast mode" is only available in Heat/Cool mode and sets the temp. to 16°C (Cool Mode) or 30°C (Heat Mode) for 30min and then automatically falls back to the temperature that was transmitted, so it's just for initially cooling/heating the room quickly, and the fan speed isn't reserved for this mode.

Maybe other units are different with the turbo fan speed only available while in turbo mode, that's not the case for me though, it's just another fan speed setting.
If my unit is the outsider here where the 4/4 fan speed setting is special in being not special, feel free to close this issue, I'll just change the line on my side.
Thank you for pointing it out :)

@crankyoldgit
Copy link
Owner

So, is the highest "normal" (non-turbo) speed for the fan the kSamsungAcFanTurbo value?

const uint8_t kSamsungAcFanAuto = 0;
const uint8_t kSamsungAcFanLow = 2;
const uint8_t kSamsungAcFanMed = 4;
const uint8_t kSamsungAcFanHigh = 5;
const uint8_t kSamsungAcFanAuto2 = 6;
const uint8_t kSamsungAcFanTurbo = 7;

Can you achieve that speed from the real remote? If so, then I can undo that bit of logic.

@xorbital
Copy link
Contributor Author

Yes, exactly, I might have been unclear before, Turbo/Fast mode is to heat/cool quickly, it sets temp high/low and the fan to 4/4.
The Turbo fan speed is nothing special, just the highest fan speed [4/4] you can set at any mode (excl. dry mode).
I've removed the previously mentioned code and I can now control my A/C almost perfectly, all fan speeds are at my disposal now via irAC

crankyoldgit added a commit that referenced this issue Nov 13, 2021
Per user feedback, it seems the highest fan speed is just a normal fan speed, not locked behind `setPowerful(true)` as previous thought.

Fixes #1675
@crankyoldgit
Copy link
Owner

PR #1678 should fix it as discussed.

crankyoldgit added a commit that referenced this issue Nov 13, 2021
…#1678)

Per user feedback, it seems the highest fan speed is just a normal fan speed, not locked behind `setPowerful(true)` as previous thought.

Fixes #1675
crankyoldgit added a commit that referenced this issue Nov 19, 2021
_v2.8.0 (20211119)_

**[Bug Fixes]**
- Fix compilation issue when using old 8266 Arduino Frameworks. (#1639 #1640)
- Fix potential security issue with `scrape_supported_devices.py` (#1616 #1619)

**[Features]**
- SAMSUNG_AC
  - Change `clean` setting to a toggle. (#1676 #1677)
  - Highest fan speed is available without Powerful setting. (#1675 #1678)
  - Change `beep` setting to a toggle. (#1669 #1671)
  - Fix Beep for AR12TXEAAWKNEU (#1668 #1669)
  - Add support for Horizontal Swing & Econo (#1277 #1667)
  - Add support for On, Off, & Sleep Timers (#1277 #1662)
  - Fix power control. Clean-up code & bitmaps from Checksum changes. (#1277 #1648 #1650)
- HAIER_AC176/HAIER_AC_YRW02
  - Add support A/B unit setting (#1672)
  - Add support degree Fahrenheit (#1659)
  - Add support `Lock` function (#1652)
  - Implement horizontal swing feature (#1641)
  - Implement Quiet setting. (#1634 #1635)
- Basic support for Airton Protocol (#1670 #1681)
- HAIER_AC176: Add Turbo and Quiet settings (#1634)
- Gree: Add `SwingH` & `Econo` control. (#1587 #1653)
- MIRAGE
  - Add experimental detailed support. (#1573 #1615)
  - Experimental detailed support for KKG29A-C1 remote. (#1573 #1660)
- ELECTRA_AC: Add support for "IFeel" & Sensor settings. (#1644 #1645)
- Add Russian translation (#1649)
- Add Swedish translation (#1627)
- Reduce flash space used. (#1633)
- Strings finally in Flash! (#1493 #1614 #1623)
- Add support for Rhoss Idrowall MPCV 20-30-35-40 A/C protocol (#1630)
- Make `IRAc::opmodeToString()` output nicer for humans. (#1613)
- TCL112AC/TEKNOPOINT: Add support for `GZ055BE1` model (#1486 #1602)
- Support for Arris protocol. (#1598)
- SharpAc: Allow position control of SwingV (#1590 #1594)

**[Misc]**
- HAIER_AC176/HAIER_AC_YRW02
  - Replace some magic numbers with constants (#1679)
  - Small fix `Quiet` and `Turbo` test (#1674)
  - Fix `IRHaierAC176::getTemp()` return value description (#1663)
- Security Policy creation and changes. (#1616 #1617 #1618 #1621 #1680)
- IRrecvDumpV2/3: Update PlatformIO envs for missing languages (#1661)
- IRMQTTServer
  - Use the correct string for Fan mode in Home Assistant. (#1610 #1657)
  - Move a lot of the strings/text to flash. (#1638)
- Minor code style improvements. (#1656)
- Update Supported Devices
  - HAIER_AC176 (#1673)
  - LG A/C (#1651 #1655)
  - Symphony (#1603 #1605)
  - Epson (#1574 #1601)
  - GREE (#1587 #1588)
  - SharpAc (#1590 #1591)
- Add extra tests for LG2 protocol (#1654)
- Fix parameter expansion in several macros.
- Move some strings to `IRtext.cpp` & `locale/default.h` (#1637)
- RHOSS: Move include and defines to their correct places (#1636)
- Make makefile only build required files when running `run-%` target (#1632)
- Update Portuguese translation (#1628)
- Add possibility to run specific test case (#1625)
- Change `googletest` library ignore (#1626)
- Re-work "Fan Only" strings & matching. (#1610)
- Address `C0209` pylint warnings. (#1608)
crankyoldgit added a commit that referenced this issue Nov 19, 2021
## _v2.8.0 (20211119)_

**[Bug Fixes]**
- Fix compilation issue when using old 8266 Arduino Frameworks. (#1639 #1640)
- Fix potential security issue with `scrape_supported_devices.py` (#1616 #1619)

**[Features]**
- SAMSUNG_AC
  - Change `clean` setting to a toggle. (#1676 #1677)
  - Highest fan speed is available without Powerful setting. (#1675 #1678)
  - Change `beep` setting to a toggle. (#1669 #1671)
  - Fix Beep for AR12TXEAAWKNEU (#1668 #1669)
  - Add support for Horizontal Swing & Econo (#1277 #1667)
  - Add support for On, Off, & Sleep Timers (#1277 #1662)
  - Fix power control. Clean-up code & bitmaps from Checksum changes. (#1277 #1648 #1650)
- HAIER_AC176/HAIER_AC_YRW02
  - Add support A/B unit setting (#1672)
  - Add support degree Fahrenheit (#1659)
  - Add support `Lock` function (#1652)
  - Implement horizontal swing feature (#1641)
  - Implement Quiet setting. (#1634 #1635)
- Basic support for Airton Protocol (#1670 #1681)
- HAIER_AC176: Add Turbo and Quiet settings (#1634)
- Gree: Add `SwingH` & `Econo` control. (#1587 #1653)
- MIRAGE
  - Add experimental detailed support. (#1573 #1615)
  - Experimental detailed support for KKG29A-C1 remote. (#1573 #1660)
- ELECTRA_AC: Add support for "IFeel" & Sensor settings. (#1644 #1645)
- Add Russian translation (#1649)
- Add Swedish translation (#1627)
- Reduce flash space used. (#1633)
- Strings finally in Flash! (#1493 #1614 #1623)
- Add support for Rhoss Idrowall MPCV 20-30-35-40 A/C protocol (#1630)
- Make `IRAc::opmodeToString()` output nicer for humans. (#1613)
- TCL112AC/TEKNOPOINT: Add support for `GZ055BE1` model (#1486 #1602)
- Support for Arris protocol. (#1598)
- SharpAc: Allow position control of SwingV (#1590 #1594)

**[Misc]**
- HAIER_AC176/HAIER_AC_YRW02
  - Replace some magic numbers with constants (#1679)
  - Small fix `Quiet` and `Turbo` test (#1674)
  - Fix `IRHaierAC176::getTemp()` return value description (#1663)
- Security Policy creation and changes. (#1616 #1617 #1618 #1621 #1680)
- IRrecvDumpV2/3: Update PlatformIO envs for missing languages (#1661)
- IRMQTTServer
  - Use the correct string for Fan mode in Home Assistant. (#1610 #1657)
  - Move a lot of the strings/text to flash. (#1638)
- Minor code style improvements. (#1656)
- Update Supported Devices
  - HAIER_AC176 (#1673)
  - LG A/C (#1651 #1655)
  - Symphony (#1603 #1605)
  - Epson (#1574 #1601)
  - GREE (#1587 #1588)
  - SharpAc (#1590 #1591)
- Add extra tests for LG2 protocol (#1654)
- Fix parameter expansion in several macros.
- Move some strings to `IRtext.cpp` & `locale/default.h` (#1637)
- RHOSS: Move include and defines to their correct places (#1636)
- Make makefile only build required files when running `run-%` target (#1632)
- Update Portuguese translation (#1628)
- Add possibility to run specific test case (#1625)
- Change `googletest` library ignore (#1626)
- Re-work "Fan Only" strings & matching. (#1610)
- Address `C0209` pylint warnings. (#1608)
@crankyoldgit
Copy link
Owner

FYI, the changes mentioned above have now been included in the new v2.8.0 release of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants