IRremoteESP8266
ir_Argo.h
Go to the documentation of this file.
1 // Copyright 2017 Schmolders
2 // Copyright 2022 crankyoldgit
3 // Copyright 2022 Mateusz Bronk (mbronk)
6 
7 // Supports:
8 // Brand: Argo, Model: Ulisse 13 DCI Mobile Split A/C [WREM2 remote]
9 // Brand: Argo, Model: Ulisse Eco Mobile Split A/C (Wifi) [WREM3 remote]
10 
11 #ifndef IR_ARGO_H_
12 #define IR_ARGO_H_
13 
14 #include <set>
15 #include <utility>
16 #ifndef UNIT_TEST
17 #include <Arduino.h>
18 #endif
19 #include "IRremoteESP8266.h"
20 #include "IRsend.h"
21 #ifdef UNIT_TEST
22 #include "IRsend_test.h"
23 #endif
24 
25 
26 // ARGO Ulisse DCI
27 
29 union ArgoProtocol {
30  uint8_t raw[kArgoStateLength];
31  struct {
32  // Byte 0
33  uint64_t Pre1 :8; // Typically 0b00110101
34  // Byte 1
35  uint64_t Pre2 :8; // Typically 0b10101111
36  // Byte 2~4
37  uint64_t :3;
38  uint64_t Mode :3;
39  uint64_t Temp :5; // straddle byte 2 and 3
40  uint64_t Fan :2;
41  uint64_t RoomTemp :5; // straddle byte 3 and 4
42  uint64_t Flap :3; // SwingV
43  uint64_t :3; // OnTimer, maybe hours
44  // Byte 5
45  uint64_t :8; // OnTimer, maybe minutes
46  // Byte 6
47  uint64_t :8; // OffTimer, maybe minutes
48  // Byte 7
49  uint64_t :3; // OffTimer, maybe hours
50  uint64_t :5; // Time
51  // Byte 8
52  uint32_t :6; // Time
53  uint32_t :1; // Timer On/Off
54  uint32_t :1; // Timer Program
55  // Byte 9
56  uint32_t :1; // Timer Program
57  uint32_t :1; // Timer 1h
58  uint32_t Night :1;
59  uint32_t Max :1;
60  uint32_t :1; // Filter
61  uint32_t Power :1;
62  uint32_t :1; // const 0
63  uint32_t iFeel :1;
64  // Byte 10~11
65  uint32_t Post :2;
66  uint32_t Sum :8; // straddle byte 10 and 11
67  uint32_t :6;
68  };
69  struct {
70  // Byte 0-1
71  uint8_t :8;
72  uint8_t :8;
73  // Byte 2-3
74  uint8_t CheckHi :3;
75  uint8_t SensorT :5;
76  uint8_t Fixed :3; // Typically 0b011
77  uint8_t CheckLo :5;
78  };
79 };
80 
91  uint8_t raw[kArgoStateLength];
92  struct {
93  // Byte 0 (same definition across the union)
94  uint8_t Pre1 :4;
95  uint8_t IrChannel :2;
96  uint8_t IrCommandType :2;
97  // Byte 1
98  uint8_t RoomTemp :5; // in Celsius, range: 4..35 (offset by -4[*C])
99  uint8_t Mode :3;
100  // Byte 2
101  uint8_t Temp :5; // in Celsius, range: 10..32 (offset by -4[*C])
102  uint8_t Fan :3;
103  // Byte3
104  uint8_t Flap :3;
105  uint8_t Power :1;
106  uint8_t iFeel :1;
107  uint8_t Night :1;
108  uint8_t Eco :1;
109  uint8_t Max :1;
110  // Byte4
111  uint8_t Filter :1;
112  uint8_t Light :1;
113  uint8_t Post1 :6;
114  // Byte5
115  uint8_t Sum :8;
116  };
117  struct {
118  // Byte 0 (same definition across the union)
119  uint8_t :8; // {Pre1 | IrChannel | IrCommandType}
120  // Byte 1
121  uint8_t SensorT :5; // in Celsius, range: 4..35 (offset by -4[*C])
122  uint8_t CheckHi :3; // Checksum (short)
123  };
124  struct Timer {
125  // Byte 0 (same definition across the union)
126  uint8_t : 8; // {Pre1 | IrChannel | IrCommandType}
127  // Byte 1
128  uint8_t IsOn : 1;
129  uint8_t TimerType : 3;
130  uint8_t CurrentTimeLo : 4;
131  // Byte 2
132  uint8_t CurrentTimeHi : 7;
133  uint8_t CurrentWeekdayLo : 1;
134  // Byte 3
135  uint8_t CurrentWeekdayHi : 2;
136  uint8_t DelayTimeLo : 6;
137  // Byte 4
138  uint8_t DelayTimeHi : 5;
139  uint8_t TimerStartLo : 3;
140  // Byte 5
141  uint8_t TimerStartHi : 8;
142  // Byte 6
143  uint8_t TimerEndLo : 8;
144  // Byte 7
145  uint8_t TimerEndHi : 3;
146  uint8_t TimerActiveDaysLo : 5; // Bitmap (LSBit is Sunday)
147  // Byte 8
148  uint8_t TimerActiveDaysHi : 2; // Bitmap (LSBit is Sunday)
149  uint8_t Post1 : 1; // Unknown, always 1
150  uint8_t Checksum : 5;
151  } timer;
152  struct Config {
153  uint8_t :8; // Byte 0 {Pre1 | IrChannel | IrCommandType}
154  uint8_t Key :8; // Byte 1
155  uint8_t Value :8; // Byte 2
156  uint8_t Checksum :8; // Byte 3
157  } config;
158 };
159 
160 // Constants (WREM-2). Store MSB left.
161 const uint8_t kArgoHeatBit = 0b00100000;
162 const uint8_t kArgoPreamble1 = 0b10101100;
163 const uint8_t kArgoPreamble2 = 0b11110101;
164 const uint8_t kArgoPost = 0b00000010;
165 
166 // Constants (generic)
167 const uint16_t kArgoFrequency = 38000; // Hz
168 // Temp
169 const uint8_t kArgoTempDelta = 4;
170 const uint8_t kArgoMaxRoomTemp = 35; // Celsius
171 const uint8_t kArgoMinTemp = 10; // Celsius delta +4
172 const uint8_t kArgoMaxTemp = 32; // Celsius
173 const uint8_t kArgoMaxChannel = 3;
174 
175 
182 enum class argoIrMessageType_t : uint8_t {
183  AC_CONTROL = 0b00,
184  IFEEL_TEMP_REPORT = 0b01,
185  TIMER_COMMAND = 0b10, // WREM-3 only (WREM-2 has it under AC_CONTROL)
186  CONFIG_PARAM_SET = 0b11 // WREM-3 only
187 };
188 
192 enum class argoMode_t : uint8_t {
193  COOL = 0b001,
194  DRY = 0b010,
195  HEAT = 0b011,
196  FAN = 0b100,
197  AUTO = 0b101
198 };
199 
200 // Raw mode definitions for WREM-2 remote
201 // (not wraped into a ns nor enum for backwards-compat.)
202 const uint8_t kArgoCool = 0b000;
203 const uint8_t kArgoDry = 0b001;
204 const uint8_t kArgoAuto = 0b010;
205 const uint8_t kArgoOff = 0b011;
206 const uint8_t kArgoHeat = 0b100;
207 const uint8_t kArgoHeatAuto = 0b101;
208 // ?no idea what mode that is
209 const uint8_t kArgoHeatBlink = 0b110;
210 
214 enum class argoFan_t : uint8_t {
215  FAN_AUTO = 0b000,
216  FAN_LOWEST = 0b001,
217  FAN_LOWER = 0b010,
218  FAN_LOW = 0b011,
219  FAN_MEDIUM = 0b100,
220  FAN_HIGH = 0b101,
221  FAN_HIGHEST = 0b110
222 };
223 
224 // Raw fan speed definitions for WREM-2 remote
225 // (not wraped into a ns nor enum for backwards-compat.)
226 const uint8_t kArgoFanAuto = 0; // 0b00
227 const uint8_t kArgoFan1 = 1; // 0b01
228 const uint8_t kArgoFan2 = 2; // 0b10
229 const uint8_t kArgoFan3 = 3; // 0b11
230 
234 enum class argoFlap_t : uint8_t {
235  FLAP_AUTO = 0,
236  FLAP_1 = 1, // Highest
237  FLAP_2 = 2,
238  FLAP_3 = 3,
239  FLAP_4 = 4,
240  FLAP_5 = 5,
241  FLAP_6 = 6, // Lowest
242  FLAP_FULL = 7
243 };
244 
245 // Raw Flap/SwingV definitions for WREM-2 remote
246 // (not wraped into a ns nor enum for backwards-compat.)
247 const uint8_t kArgoFlapAuto = 0;
248 const uint8_t kArgoFlap1 = 1;
249 const uint8_t kArgoFlap2 = 2;
250 const uint8_t kArgoFlap3 = 3;
251 const uint8_t kArgoFlap4 = 4;
252 const uint8_t kArgoFlap5 = 5;
253 const uint8_t kArgoFlap6 = 6;
254 const uint8_t kArgoFlapFull = 7;
255 
256 // Legacy defines. (Deprecated)
257 #define ARGO_COOL_ON kArgoCoolOn
258 #define ARGO_COOL_OFF kArgoCoolOff
259 #define ARGO_COOL_AUTO kArgoCoolAuto
260 #define ARGO_COOL_HUM kArgoCoolHum
261 #define ARGO_HEAT_ON kArgoHeatOn
262 #define ARGO_HEAT_AUTO kArgoHeatAuto
263 #define ARGO_HEAT_BLINK kArgoHeatBlink
264 #define ARGO_MIN_TEMP kArgoMinTemp
265 #define ARGO_MAX_TEMP kArgoMaxTemp
266 #define ARGO_FAN_AUTO kArgoFanAuto
267 #define ARGO_FAN_3 kArgoFan3
268 #define ARGO_FAN_2 kArgoFan2
269 #define ARGO_FAN_1 kArgoFan1
270 #define ARGO_FLAP_AUTO kArgoFlapAuto
271 #define ARGO_FLAP_1 kArgoFlap1
272 #define ARGO_FLAP_2 kArgoFlap2
273 #define ARGO_FLAP_3 kArgoFlap3
274 #define ARGO_FLAP_4 kArgoFlap4
275 #define ARGO_FLAP_5 kArgoFlap5
276 #define ARGO_FLAP_6 kArgoFlap6
277 #define ARGO_FLAP_FULL kArgoFlapFull
278 
279 
282 enum class argoTimerType_t : uint8_t {
283  NO_TIMER = 0b000,
284  DELAY_TIMER = 0b001,
285  SCHEDULE_TIMER_1 = 0b010,
286  SCHEDULE_TIMER_2 = 0b011,
287  SCHEDULE_TIMER_3 = 0b100
288 };
289 
292 enum class argoWeekday : uint8_t {
293  SUNDAY = 0b000,
294  MONDAY = 0b001,
295  TUESDAY = 0b010,
296  WEDNESDAY = 0b011,
297  THURSDAY = 0b100,
298  FRIDAY = 0b101,
299  SATURDAY = 0b110
300 };
301 
302 
303 
313 template <typename ARGO_PROTOCOL_T>
315 #ifndef UNIT_TEST // A less cloggy way of expressing FRIEND_TEST(...)
316 
317  protected:
318 #else
319 
320  public:
321 #endif
322  explicit IRArgoACBase(const uint16_t pin, const bool inverted = false,
323  const bool use_modulation = true);
324 
325  public:
326 #if SEND_ARGO
327  void send(const uint16_t repeat = kArgoDefaultRepeat);
332  int8_t calibrate(void) { return _irsend.calibrate(); }
333 #endif // SEND_ARGO
334 
335  void begin(void);
336  void on(void);
337  void off(void);
338 
339  void setPower(const bool on);
340  bool getPower(void) const;
341 
342  void setTemp(const uint8_t degrees);
343  uint8_t getTemp(void) const;
344 
345  void setSensorTemp(const uint8_t degrees);
346  uint8_t getSensorTemp(void) const;
347 
348  void setFan(const argoFan_t fan);
349  void setFanEx(const argoFan_t fan) { setFan(fan); }
350  argoFan_t getFanEx(void) const;
351 
352  void setFlap(const argoFlap_t flap);
353  void setFlapEx(const argoFlap_t flap) { setFlap(flap); }
354  argoFlap_t getFlapEx(void) const;
355 
356  void setMode(const argoMode_t mode);
357  void setModeEx(const argoMode_t mode) { setMode(mode); }
358  argoMode_t getModeEx(void) const;
359 
360  void setMax(const bool on);
361  bool getMax(void) const;
362 
363  void setNight(const bool on);
364  bool getNight(void) const;
365 
366  void setiFeel(const bool on);
367  bool getiFeel(void) const;
368 
369  void setMessageType(const argoIrMessageType_t msgType);
371  static argoIrMessageType_t getMessageType(const uint8_t state[],
372  const uint16_t length);
373 
374  uint8_t* getRaw(void);
375  uint16_t getRawByteLength() const;
376  static uint16_t getStateLengthForIrMsgType(argoIrMessageType_t type);
377  void setRaw(const uint8_t state[], const uint16_t length);
378 
379  static bool validChecksum(const uint8_t state[], const uint16_t length);
380 
381  static argoMode_t convertMode(const stdAc::opmode_t mode);
382  static argoFan_t convertFan(const stdAc::fanspeed_t speed);
383  static argoFlap_t convertSwingV(const stdAc::swingv_t position);
385 
386  protected:
387  void _stateReset(ARGO_PROTOCOL_T *state, argoIrMessageType_t messageType
389  void stateReset(argoIrMessageType_t messageType
391  void _checksum(ARGO_PROTOCOL_T *state);
392  void checksum(void);
393  static uint16_t getRawByteLength(const ARGO_PROTOCOL_T& raw,
395  static uint8_t calcChecksum(const uint8_t state[], const uint16_t length);
396  static uint8_t getChecksum(const uint8_t state[], const uint16_t length);
397 
398  static stdAc::opmode_t toCommonMode(const argoMode_t mode);
399  static stdAc::fanspeed_t toCommonFanSpeed(const argoFan_t speed);
400  static stdAc::swingv_t toCommonSwingV(const uint8_t position);
402 
403  // Attributes
404  ARGO_PROTOCOL_T _;
407 
408 #ifndef UNIT_TEST
409 
410  protected:
412 #else
413 
414  public:
416  IRsendTest _irsend;
417 #endif
419 };
420 
422 class IRArgoAC : public IRArgoACBase<ArgoProtocol> {
423  public:
424  explicit IRArgoAC(const uint16_t pin, const bool inverted = false,
425  const bool use_modulation = true);
426 
427  #if SEND_ARGO
428  void sendSensorTemp(const uint8_t degrees,
429  const uint16_t repeat = kArgoDefaultRepeat);
430  #endif // SEND_ARGO
431 
432  String toString(void) const;
433  stdAc::state_t toCommon(void) const;
434 
436  void setMode(const uint8_t mode);
437  uint8_t getMode(void) const;
438 
440  void setFan(const uint8_t fan);
441  uint8_t getFan(void) const;
442 
444  void setFlap(const uint8_t flap);
445  uint8_t getFlap(void) const;
446 };
447 
449 class IRArgoAC_WREM3 : public IRArgoACBase<ArgoProtocolWREM3> {
450  public:
451  explicit IRArgoAC_WREM3(const uint16_t pin, const bool inverted = false,
452  const bool use_modulation = true);
453 
454  #if SEND_ARGO
455  void sendSensorTemp(const uint8_t degrees,
456  const uint16_t repeat = kArgoDefaultRepeat);
457  #endif // SEND_ARGO
458 
459  argo_ac_remote_model_t getModel(void) const;
460 
461 
462  argoFan_t getFan(void) const;
463  argoFlap_t getFlap(void) const;
464  argoMode_t getMode(void) const;
465 
466  void setEco(const bool on);
467  bool getEco(void) const;
468 
469  void setFilter(const bool on);
470  bool getFilter(void) const;
471 
472  void setLight(const bool on);
473  bool getLight(void) const;
474 
475  void setChannel(const uint8_t channel);
476  uint8_t getChannel(void) const;
477 
478  void setConfigEntry(const uint8_t paramId, const uint8_t value);
479  std::pair<uint8_t, uint8_t> getConfigEntry(void) const;
480 
481  void setCurrentTimeMinutes(uint16_t currentTimeMinutes);
482  uint16_t getCurrentTimeMinutes(void) const;
483 
484  void setCurrentDayOfWeek(argoWeekday dayOfWeek);
485  argoWeekday getCurrentDayOfWeek(void) const;
486 
487  void setTimerType(const argoTimerType_t timerType);
488  argoTimerType_t getTimerType(void) const;
489 
490  void setDelayTimerMinutes(const uint16_t delayMinutes);
491  uint16_t getDelayTimerMinutes(void) const;
492 
493  void setScheduleTimerStartMinutes(const uint16_t startTimeMinutes);
494  uint16_t getScheduleTimerStartMinutes(void) const;
495  // uint16_t getTimerXStartMinutes(void) const
496 
497  void setScheduleTimerStopMinutes(const uint16_t stopTimeMinutes);
498  uint16_t getScheduleTimerStopMinutes(void) const;
499  // uint16_t getTimerXStopMinutes(void) const;
500 
501 
502  void setScheduleTimerActiveDays(const std::set<argoWeekday>& days);
503  std::set<argoWeekday> getScheduleTimerActiveDays(void) const;
504  uint8_t getTimerActiveDaysBitmap(void) const;
505 
508 
509  String toString(void) const;
510  stdAc::state_t toCommon(void) const;
511 
512  static bool hasValidPreamble(const uint8_t state[], const uint16_t length);
513 
514  public:
515 #if DECODE_ARGO
516  static bool isValidWrem3Message(const uint8_t state[], const uint16_t nbits,
517  bool verifyChecksum = true);
518 #endif
519 };
520 
521 #endif // IR_ARGO_H_
ArgoProtocolWREM3::RoomTemp
uint8_t RoomTemp
argoIrMessageType_t
Definition: ir_Argo.h:98
argoMode_t::AUTO
@ AUTO
ArgoProtocol::Sum
uint32_t Sum
Definition: ir_Argo.h:66
IRArgoACBase::getChecksum
static uint8_t getChecksum(const uint8_t state[], const uint16_t length)
Retrieve the checksum value from transmitted state.
Definition: ir_Argo.cpp:436
IRArgoAC::setFan
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Argo.cpp:751
ArgoProtocolWREM3::Fan
uint8_t Fan
Definition: ir_Argo.h:102
ArgoProtocolWREM3::config
struct ArgoProtocolWREM3::Config config
IRArgoACBase::_
ARGO_PROTOCOL_T _
The raw protocol data.
Definition: ir_Argo.h:404
IRArgoACBase::getFanEx
argoFan_t getFanEx(void) const
-Ex for backw. compat w/ IRArgoAC
Definition: ir_Argo.cpp:659
kArgoHeatBlink
const uint8_t kArgoHeatBlink
Definition: ir_Argo.h:209
ArgoProtocolWREM3::Timer::CurrentWeekdayHi
uint8_t CurrentWeekdayHi
Definition: ir_Argo.h:135
ArgoProtocolWREM3::Timer::TimerType
uint8_t TimerType
Definition: ir_Argo.h:129
IRArgoAC_WREM3::getModel
argo_ac_remote_model_t getModel(void) const
Get device model.
Definition: ir_Argo.cpp:1545
IRArgoACBase::toCommonCommand
static stdAc::ac_command_t toCommonCommand(const argoIrMessageType_t command)
Convert a native message type into its stdAc equivalent.
Definition: ir_Argo.cpp:1189
argoFlap_t::FLAP_4
@ FLAP_4
IRArgoAC_WREM3::sendSensorTemp
void sendSensorTemp(const uint8_t degrees, const uint16_t repeat=kArgoDefaultRepeat)
Send current room temperature for the iFeel feature as a silent IR message (no acknowledgement from t...
Definition: ir_Argo.cpp:527
IRArgoAC_WREM3::setDelayTimerMinutes
void setDelayTimerMinutes(const uint16_t delayMinutes)
Set delay timer delay in minutes (10-minute increments only) Max is 1190 (19h50m)
Definition: ir_Argo.cpp:1444
stdAc::swingv_t
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:74
IRArgoAC::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Argo.cpp:758
IRArgoACBase::getTemp
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Argo.cpp:647
IRArgoACBase::setFanEx
void setFanEx(const argoFan_t fan)
Definition: ir_Argo.h:349
ArgoProtocol::Pre1
uint64_t Pre1
Definition: ir_Argo.h:33
ArgoProtocolWREM3::Timer::CurrentTimeHi
uint8_t CurrentTimeHi
Definition: ir_Argo.h:132
kArgoMaxTemp
const uint8_t kArgoMaxTemp
Definition: ir_Argo.h:172
kArgoDefaultRepeat
const uint16_t kArgoDefaultRepeat
Definition: IRremoteESP8266.h:1166
IRArgoAC::setFlap
void setFlap(const uint8_t flap)
Set the flap position. i.e. Swing. (WREM2)
Definition: ir_Argo.cpp:789
argoWeekday::THURSDAY
@ THURSDAY
IRArgoAC_WREM3::setCurrentTimeMinutes
void setCurrentTimeMinutes(uint16_t currentTimeMinutes)
Set current clock (as minutes, counted from 0:00) E.g. 13:38 becomes 818 (13*60+38)
Definition: ir_Argo.cpp:1387
IRArgoACBase::toCommonMode
static stdAc::opmode_t toCommonMode(const argoMode_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Argo.cpp:1209
IRArgoAC::toString
String toString(void) const
Convert the current internal state into a human readable string (WREM2).
Definition: ir_Argo.cpp:1317
IRArgoAC_WREM3::setChannel
void setChannel(const uint8_t channel)
Set the IR channel on which to communicate.
Definition: ir_Argo.cpp:966
stdAc::fanspeed_t
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
ArgoProtocolWREM3::iFeel
uint8_t iFeel
Definition: ir_Argo.h:106
argoFan_t::FAN_LOWEST
@ FAN_LOWEST
IRArgoAC_WREM3::getEco
bool getEco(void) const
Get the status of Economy function.
Definition: ir_Argo.cpp:946
IRArgoACBase::stateReset
void stateReset(argoIrMessageType_t messageType=argoIrMessageType_t::AC_CONTROL)
Reset the internals of the object to a known good state.
Definition: ir_Argo.cpp:413
IRArgoACBase::getRawByteLength
uint16_t getRawByteLength() const
Get actual raw state byte length for the current state.
Definition: ir_Argo.cpp:258
kArgoFlap2
const uint8_t kArgoFlap2
Definition: ir_Argo.h:249
argoFan_t::FAN_LOWER
@ FAN_LOWER
IRArgoAC_WREM3::getFlap
argoFlap_t getFlap(void) const
Definition: ir_Argo.cpp:927
ArgoProtocolWREM3::Timer::TimerEndHi
uint8_t TimerEndHi
Definition: ir_Argo.h:145
IRArgoAC::getFlap
uint8_t getFlap(void) const
Get the flap position. i.e. Swing. (WREM2)
Definition: ir_Argo.cpp:798
ArgoProtocol::Night
uint32_t Night
Definition: ir_Argo.h:58
IRArgoACBase::_length
uint16_t _length
Definition: ir_Argo.h:405
argoMode_t::HEAT
@ HEAT
IRArgoAC_WREM3::setLight
void setLight(const bool on)
Turn on/off the device Lights (LED)
Definition: ir_Argo.cpp:958
IRArgoACBase::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Argo.h:332
IRArgoAC_WREM3::getScheduleTimerActiveDays
std::set< argoWeekday > getScheduleTimerActiveDays(void) const
Get the days when shedule timer shall be active (as set)
Definition: ir_Argo.cpp:1530
kArgoFlap4
const uint8_t kArgoFlap4
Definition: ir_Argo.h:251
IRArgoACBase::getMax
bool getMax(void) const
Is the Max (i.e. Turbo) setting on?
Definition: ir_Argo.cpp:630
IRArgoAC_WREM3::getConfigEntry
std::pair< uint8_t, uint8_t > getConfigEntry(void) const
Get the config entry previously set.
Definition: ir_Argo.cpp:986
IRArgoACBase::setFan
void setFan(const argoFan_t fan)
Set the desired fan mode (WREM3).
Definition: ir_Argo.cpp:731
argoMode_t
argoMode_t
A/C operation mode.
Definition: ir_Argo.h:192
argoFan_t::FAN_HIGHEST
@ FAN_HIGHEST
argoFlap_t::FLAP_6
@ FLAP_6
kArgoHeatBit
const uint8_t kArgoHeatBit
Definition: ir_Argo.h:161
IRArgoACBase::convertMode
static argoMode_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Argo.cpp:1062
ArgoProtocol::CheckLo
uint8_t CheckLo
Definition: ir_Argo.h:77
IRArgoACBase::validChecksum
static bool validChecksum(const uint8_t state[], const uint16_t length)
Verify the checksum is valid for a given state.
Definition: ir_Argo.cpp:474
ArgoProtocolWREM3::Mode
uint8_t Mode
Definition: ir_Argo.h:99
IRArgoAC_WREM3::setEco
void setEco(const bool on)
Turn on/off the Economy mode (lowered power mode)
Definition: ir_Argo.cpp:942
argoIrMessageType_t::CONFIG_PARAM_SET
@ CONFIG_PARAM_SET
IRsend.h
argoTimerType_t::SCHEDULE_TIMER_2
@ SCHEDULE_TIMER_2
ArgoProtocolWREM3::IrCommandType
uint8_t IrCommandType
0..3 range
Definition: ir_Argo.h:96
kArgoPreamble2
const uint8_t kArgoPreamble2
Definition: ir_Argo.h:163
kArgoFlap3
const uint8_t kArgoFlap3
Definition: ir_Argo.h:250
IRArgoAC_WREM3::getFan
argoFan_t getFan(void) const
Definition: ir_Argo.cpp:926
ArgoProtocolWREM3::Temp
uint8_t Temp
argoMode_t
Definition: ir_Argo.h:101
IRArgoAC_WREM3::setScheduleTimerActiveDays
void setScheduleTimerActiveDays(const std::set< argoWeekday > &days)
Set the days when the schedule timer shall be active.
Definition: ir_Argo.cpp:1518
argoFlap_t::FLAP_AUTO
@ FLAP_AUTO
kArgoPost
const uint8_t kArgoPost
Definition: ir_Argo.h:164
IRsend
Class for sending all basic IR protocols.
Definition: IRsend.h:237
IRArgoAC_WREM3::setTimerType
void setTimerType(const argoTimerType_t timerType)
Set timer type.
Definition: ir_Argo.cpp:1426
IRArgoACBase::getModeEx
argoMode_t getModeEx(void) const
-Ex for backw. compat w/ IRArgoAC
Definition: ir_Argo.cpp:811
kArgoMaxChannel
const uint8_t kArgoMaxChannel
Definition: ir_Argo.h:173
IRsend::calibrate
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
argoFlap_t::FLAP_3
@ FLAP_3
stdAc::ac_command_t
ac_command_t
Tyoe of A/C command (if the remote uses different codes for each)
Definition: IRsend.h:90
ArgoProtocolWREM3::Timer::TimerStartHi
uint8_t TimerStartHi
Definition: ir_Argo.h:141
kArgoStateLength
const uint16_t kArgoStateLength
Definition: IRremoteESP8266.h:1158
String
std::string String
Definition: IRremoteESP8266.h:1521
ArgoProtocolWREM3::Timer
Definition: ir_Argo.h:124
argoMode_t::DRY
@ DRY
kArgoFan1
const uint8_t kArgoFan1
Definition: ir_Argo.h:227
IRArgoAC_WREM3::setScheduleTimerStopMinutes
void setScheduleTimerStopMinutes(const uint16_t stopTimeMinutes)
Set schedule timer off time (time when the device should turn off) (10-minute increments only)
Definition: ir_Argo.cpp:1491
argoWeekday::TUESDAY
@ TUESDAY
IRArgoACBase::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const argoFan_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Argo.cpp:1224
argoFlap_t::FLAP_1
@ FLAP_1
IRArgoACBase::setMessageType
void setMessageType(const argoIrMessageType_t msgType)
Set the message type of the next command (setting this resets state)
Definition: ir_Argo.cpp:1003
kArgoOff
const uint8_t kArgoOff
Definition: ir_Argo.h:205
ArgoProtocol::Flap
uint64_t Flap
Definition: ir_Argo.h:42
argoFan_t::FAN_LOW
@ FAN_LOW
IRArgoACBase::getNight
bool getNight(void) const
Get the status of Night mode. i.e. Sleep.
Definition: ir_Argo.cpp:938
ArgoProtocolWREM3::Max
uint8_t Max
a.k.a. Turbo
Definition: ir_Argo.h:109
ArgoProtocolWREM3::Sum
uint8_t Sum
Unknown, always 0b110000 (TempScale?)
Definition: ir_Argo.h:115
kArgoFlapFull
const uint8_t kArgoFlapFull
Definition: ir_Argo.h:254
ArgoProtocolWREM3::Timer::CurrentTimeLo
uint8_t CurrentTimeLo
Definition: ir_Argo.h:130
ArgoProtocol::Mode
uint64_t Mode
Definition: ir_Argo.h:38
ArgoProtocolWREM3::Timer::TimerStartLo
uint8_t TimerStartLo
Definition: ir_Argo.h:139
IRArgoAC_WREM3::hasValidPreamble
static bool hasValidPreamble(const uint8_t state[], const uint16_t length)
Check if raw ARGO state starts with valid WREM3 preamble.
Definition: ir_Argo.cpp:1662
IRArgoACBase::getiFeel
bool getiFeel(void) const
Get the status of iFeel mode.
Definition: ir_Argo.cpp:998
IRremoteESP8266.h
argoWeekday::SUNDAY
@ SUNDAY
IRArgoACBase::getSensorTemp
uint8_t getSensorTemp(void) const
Get the currently stored value for the room temperature setting.
Definition: ir_Argo.cpp:1032
IRArgoACBase
Base class for handling common support for Argo remote protocols (functionality is shared across WREM...
Definition: ir_Argo.h:314
ArgoProtocolWREM3::Filter
uint8_t Filter
Definition: ir_Argo.h:111
kArgoFrequency
const uint16_t kArgoFrequency
Definition: ir_Argo.h:167
kArgoDry
const uint8_t kArgoDry
Definition: ir_Argo.h:203
IRArgoAC::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Argo.cpp:1239
argoIrMessageType_t::TIMER_COMMAND
@ TIMER_COMMAND
IRArgoACBase::convertFan
static argoFan_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Argo.cpp:1082
IRArgoAC_WREM3
Supports Argo A/C SAC-WREM3 IR remote protocol.
Definition: ir_Argo.h:449
ArgoProtocolWREM3::Timer::Checksum
uint8_t Checksum
Definition: ir_Argo.h:150
IRArgoACBase::getPower
bool getPower(void) const
Get the power setting from the internal state.
Definition: ir_Argo.cpp:604
kArgoAuto
const uint8_t kArgoAuto
Definition: ir_Argo.h:204
IRArgoAC_WREM3::toString
String toString(void) const
Convert the current internal state into a human readable string (WREM3).
Definition: ir_Argo.cpp:1564
ArgoProtocolWREM3::Config::Key
uint8_t Key
Definition: ir_Argo.h:154
IRArgoAC_WREM3::getTimerType
argoTimerType_t getTimerType(void) const
Get currently set timer type.
Definition: ir_Argo.cpp:1436
ArgoProtocolWREM3::Timer::Post1
uint8_t Post1
Definition: ir_Argo.h:149
ArgoProtocol::Temp
uint64_t Temp
Definition: ir_Argo.h:39
ArgoProtocol::Power
uint32_t Power
Definition: ir_Argo.h:61
ArgoProtocolWREM3::Light
uint8_t Light
Definition: ir_Argo.h:112
IRArgoACBase::_stateReset
void _stateReset(ARGO_PROTOCOL_T *state, argoIrMessageType_t messageType=argoIrMessageType_t::AC_CONTROL)
IRArgoACBase::setMode
void setMode(const argoMode_t mode)
Set the desired operation mode.
Definition: ir_Argo.cpp:887
argoTimerType_t::DELAY_TIMER
@ DELAY_TIMER
ArgoProtocolWREM3::Config::Value
uint8_t Value
Definition: ir_Argo.h:155
IRArgoACBase::_messageType
argoIrMessageType_t _messageType
Definition: ir_Argo.h:406
IRArgoAC_WREM3::setFilter
void setFilter(const bool on)
Turn on/off the Filter mode (not supported by Argo Ulisse)
Definition: ir_Argo.cpp:950
argoMode_t::FAN
@ FAN
kArgoFlap1
const uint8_t kArgoFlap1
Definition: ir_Argo.h:248
ArgoProtocol::raw
uint8_t raw[kArgoStateLength]
The state in native IR code form.
Definition: ir_Argo.h:30
ArgoProtocol::Pre2
uint64_t Pre2
Definition: ir_Argo.h:35
IRArgoACBase::setPower
void setPower(const bool on)
Set the internal state to have the desired power.
Definition: ir_Argo.cpp:589
IRArgoACBase::setNight
void setNight(const bool on)
Turn on/off the Night mode. i.e. Sleep.
Definition: ir_Argo.cpp:933
ArgoProtocolWREM3::Flap
uint8_t Flap
argoFan_t
Definition: ir_Argo.h:104
ArgoProtocolWREM3::SensorT
uint8_t SensorT
Definition: ir_Argo.h:121
argoFlap_t::FLAP_5
@ FLAP_5
IRArgoAC_WREM3::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Argo.cpp:1268
argoWeekday
argoWeekday
Day type to set (for argoIrMessageType_t::TIMER_COMMAND)
Definition: ir_Argo.h:292
ArgoProtocolWREM3::Timer::IsOn
uint8_t IsOn
Definition: ir_Argo.h:128
ArgoProtocolWREM3::Config::Checksum
uint8_t Checksum
Definition: ir_Argo.h:156
argoTimerType_t::SCHEDULE_TIMER_3
@ SCHEDULE_TIMER_3
ArgoProtocolWREM3::Timer::DelayTimeLo
uint8_t DelayTimeLo
Definition: ir_Argo.h:136
IRArgoAC_WREM3::getMode
argoMode_t getMode(void) const
Definition: ir_Argo.cpp:928
IRArgoACBase::setMax
void setMax(const bool on)
Control the current Max setting. (i.e. Turbo)
Definition: ir_Argo.cpp:623
ArgoProtocol::Fan
uint64_t Fan
Definition: ir_Argo.h:40
ArgoProtocolWREM3::IrChannel
uint8_t IrChannel
Preamble: 0b1011 kArgoWrem3Preamble.
Definition: ir_Argo.h:95
ArgoProtocol::SensorT
uint8_t SensorT
Definition: ir_Argo.h:75
IRArgoACBase::setTemp
void setTemp(const uint8_t degrees)
Set the temperature.
Definition: ir_Argo.cpp:636
IRArgoACBase::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Argo.cpp:125
ArgoProtocolWREM3::Timer::CurrentWeekdayLo
uint8_t CurrentWeekdayLo
Definition: ir_Argo.h:133
ArgoProtocol::CheckHi
uint8_t CheckHi
Definition: ir_Argo.h:74
ArgoProtocol::Post
uint32_t Post
Definition: ir_Argo.h:65
IRArgoACBase::setRaw
void setRaw(const uint8_t state[], const uint16_t length)
Set the raw state of the object.
Definition: ir_Argo.cpp:556
ArgoProtocol::Max
uint32_t Max
Definition: ir_Argo.h:59
ArgoProtocol::RoomTemp
uint64_t RoomTemp
Definition: ir_Argo.h:41
ArgoProtocolWREM3::Power
uint8_t Power
SwingV argoFlap_t.
Definition: ir_Argo.h:105
ArgoProtocolWREM3::raw
uint8_t raw[kArgoStateLength]
The state in native IR code form.
Definition: ir_Argo.h:91
IRArgoACBase::off
void off(void)
Set the internal state to have the power off.
Definition: ir_Argo.cpp:568
ArgoProtocolWREM3::Timer::TimerEndLo
uint8_t TimerEndLo
Definition: ir_Argo.h:143
IRArgoACBase::getRaw
uint8_t * getRaw(void)
Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.
Definition: ir_Argo.cpp:546
argoIrMessageType_t
argoIrMessageType_t
IR message type (determines the payload part of IR command)
Definition: ir_Argo.h:182
kArgoMinTemp
const uint8_t kArgoMinTemp
Definition: ir_Argo.h:171
IRArgoACBase::setSensorTemp
void setSensorTemp(const uint8_t degrees)
Set the value for the current room temperature.
Definition: ir_Argo.cpp:1018
IRArgoAC_WREM3::getChannel
uint8_t getChannel(void) const
Get the currently set transmission channel.
Definition: ir_Argo.cpp:972
ArgoProtocolWREM3::Pre1
uint8_t Pre1
Definition: ir_Argo.h:94
ArgoProtocol::Fixed
uint8_t Fixed
Definition: ir_Argo.h:76
IRArgoACBase::_irsend
IRsend _irsend
instance of the IR send class
Definition: ir_Argo.h:411
argoWeekday::SATURDAY
@ SATURDAY
IRArgoAC_WREM3::setCurrentDayOfWeek
void setCurrentDayOfWeek(argoWeekday dayOfWeek)
Set current day of week.
Definition: ir_Argo.cpp:1401
IRArgoAC_WREM3::getTimerActiveDaysBitmap
uint8_t getTimerActiveDaysBitmap(void) const
Get the days when shedule timer shall be active (as bitmap)
Definition: ir_Argo.cpp:1512
ArgoProtocolWREM3::Config
Definition: ir_Argo.h:152
IRArgoAC_WREM3::getCurrentTimeMinutes
uint16_t getCurrentTimeMinutes(void) const
Retrieve current time.
Definition: ir_Argo.cpp:1395
IRArgoACBase::convertSwingV
static argoFlap_t convertSwingV(const stdAc::swingv_t position)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Argo.cpp:1105
IRArgoACBase::setiFeel
void setiFeel(const bool on)
Turn on/off the iFeel mode.
Definition: ir_Argo.cpp:993
argoFlap_t
argoFlap_t
Flap position (swing-V)
Definition: ir_Argo.h:234
argoWeekday::FRIDAY
@ FRIDAY
IRArgoACBase::getStateLengthForIrMsgType
static uint16_t getStateLengthForIrMsgType(argoIrMessageType_t type)
Get byte length of raw WREM-3 message based on IR cmd type.
Definition: ir_Argo.cpp:160
argoWeekday::WEDNESDAY
@ WEDNESDAY
ArgoProtocolWREM3
Native representation of A/C IR message for WREM-3 remote.
Definition: ir_Argo.h:90
kArgoFan2
const uint8_t kArgoFan2
Definition: ir_Argo.h:228
kArgoCool
const uint8_t kArgoCool
Definition: ir_Argo.h:202
argoFan_t::FAN_AUTO
@ FAN_AUTO
argoFlap_t::FLAP_FULL
@ FLAP_FULL
IRArgoACBase::checksum
void checksum(void)
Update the checksum for the internal state.
Definition: ir_Argo.cpp:365
ArgoProtocolWREM3::Post1
uint8_t Post1
Definition: ir_Argo.h:113
kArgoHeatAuto
const uint8_t kArgoHeatAuto
Definition: ir_Argo.h:207
argoFan_t::FAN_MEDIUM
@ FAN_MEDIUM
ArgoProtocol
Native representation of a Argo A/C message for WREM-2 remote.
Definition: ir_Argo.h:29
IRArgoAC_WREM3::setScheduleTimerStartMinutes
void setScheduleTimerStartMinutes(const uint16_t startTimeMinutes)
Set schedule timer on time (time when the device should turn on) (10-minute increments only)
Definition: ir_Argo.cpp:1467
IRArgoACBase::calcChecksum
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length)
Calculate the checksum for a given state (WREM-3).
Definition: ir_Argo.cpp:291
ArgoProtocolWREM3::CheckHi
uint8_t CheckHi
Definition: ir_Argo.h:122
argoTimerType_t::NO_TIMER
@ NO_TIMER
IRArgoAC_WREM3::isValidWrem3Message
static bool isValidWrem3Message(const uint8_t state[], const uint16_t nbits, bool verifyChecksum=true)
Detects if an ARGO protocol message is a WREM-3 sub-type (model)
Definition: ir_Argo.cpp:1768
ArgoProtocolWREM3::Eco
uint8_t Eco
Definition: ir_Argo.h:108
kArgoHeat
const uint8_t kArgoHeat
Definition: ir_Argo.h:206
ArgoProtocolWREM3::timer
struct ArgoProtocolWREM3::Timer timer
IRArgoAC_WREM3::getCurrentDayOfWeek
argoWeekday getCurrentDayOfWeek(void) const
Get current day of week.
Definition: ir_Argo.cpp:1410
ArgoProtocolWREM3::Night
uint8_t Night
Definition: ir_Argo.h:107
IRArgoAC_WREM3::getLight
bool getLight(void) const
Get status of device lights.
Definition: ir_Argo.cpp:962
IRArgoAC::getMode
uint8_t getMode(void) const
Get the current operation mode.
Definition: ir_Argo.cpp:924
IRArgoACBase::convertCommand
static argoIrMessageType_t convertCommand(const stdAc::ac_command_t command)
Convert a stdAc::ac_command_t enum into its native message type.
Definition: ir_Argo.cpp:1043
kArgoFlap5
const uint8_t kArgoFlap5
Definition: ir_Argo.h:252
IRArgoAC::IRArgoAC
IRArgoAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Argo.cpp:110
argoFan_t::FAN_HIGH
@ FAN_HIGH
kArgoTempDelta
const uint8_t kArgoTempDelta
Definition: ir_Argo.h:169
IRArgoACBase::setModeEx
void setModeEx(const argoMode_t mode)
Definition: ir_Argo.h:357
argoFlap_t::FLAP_2
@ FLAP_2
IRArgoACBase::getFlapEx
argoFlap_t getFlapEx(void) const
-Ex for backw. compat w/ IRArgoAC
Definition: ir_Argo.cpp:767
argoWeekday::MONDAY
@ MONDAY
kArgoFlap6
const uint8_t kArgoFlap6
Definition: ir_Argo.h:253
IRArgoACBase::setFlap
void setFlap(const argoFlap_t flap)
Set the desired flap mode.
Definition: ir_Argo.cpp:774
IRArgoAC_WREM3::getScheduleTimerStopMinutes
uint16_t getScheduleTimerStopMinutes(void) const
Get schedule timer OFF time.
Definition: ir_Argo.cpp:1505
ArgoProtocolWREM3::Timer::DelayTimeHi
uint8_t DelayTimeHi
Definition: ir_Argo.h:138
IRArgoAC_WREM3::getDelayTimerMinutes
uint16_t getDelayTimerMinutes(void) const
Get current delay timer value.
Definition: ir_Argo.cpp:1457
IRArgoAC_WREM3::setConfigEntry
void setConfigEntry(const uint8_t paramId, const uint8_t value)
Set the config data to send Valid only for argoIrMessageType_t::CONFIG_PARAM_SET message.
Definition: ir_Argo.cpp:978
argoTimerType_t
argoTimerType_t
Timer type to set (for argoIrMessageType_t::TIMER_COMMAND)
Definition: ir_Argo.h:282
IRArgoAC_WREM3::getScheduleTimerStartMinutes
uint16_t getScheduleTimerStartMinutes(void) const
Get schedule timer ON time.
Definition: ir_Argo.cpp:1481
argoMode_t::COOL
@ COOL
IRArgoACBase::_checksum
void _checksum(ARGO_PROTOCOL_T *state)
IRArgoACBase::getMessageType
argoIrMessageType_t getMessageType(void) const
Get the message type.
Definition: ir_Argo.cpp:1010
ArgoProtocol::iFeel
uint32_t iFeel
Definition: ir_Argo.h:63
IRArgoACBase::setFlapEx
void setFlapEx(const argoFlap_t flap)
Definition: ir_Argo.h:353
argoFan_t
argoFan_t
Fan speed.
Definition: ir_Argo.h:214
argoTimerType_t::SCHEDULE_TIMER_1
@ SCHEDULE_TIMER_1
IRArgoAC::sendSensorTemp
void sendSensorTemp(const uint8_t degrees, const uint16_t repeat=kArgoDefaultRepeat)
Send current room temperature for the iFeel feature as a silent IR message (no acknowledgement from t...
Definition: ir_Argo.cpp:505
kArgoFlapAuto
const uint8_t kArgoFlapAuto
Definition: ir_Argo.h:247
argo_ac_remote_model_t
argo_ac_remote_model_t
Argo A/C model numbers.
Definition: IRsend.h:226
IRArgoACBase::send
void send(const uint16_t repeat=kArgoDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Argo.cpp:484
ArgoProtocolWREM3::Timer::TimerActiveDaysLo
uint8_t TimerActiveDaysLo
Definition: ir_Argo.h:146
IRArgoAC_WREM3::getFilter
bool getFilter(void) const
Get status of the filter function.
Definition: ir_Argo.cpp:954
stdAc::state_t
Structure to hold a common A/C state.
Definition: IRsend.h:114
kArgoFan3
const uint8_t kArgoFan3
Definition: ir_Argo.h:229
IRArgoAC
Supports Argo A/C SAC-WREM2 IR remote protocol.
Definition: ir_Argo.h:422
kArgoPreamble1
const uint8_t kArgoPreamble1
Definition: ir_Argo.h:162
argoIrMessageType_t::AC_CONTROL
@ AC_CONTROL
IRArgoACBase::toCommonSwingV
static stdAc::swingv_t toCommonSwingV(const uint8_t position)
Convert a native flap mode into its stdAc equivalent (WREM3).
Definition: ir_Argo.cpp:1162
kArgoFanAuto
const uint8_t kArgoFanAuto
Definition: ir_Argo.h:226
ArgoProtocolWREM3::Timer::TimerActiveDaysHi
uint8_t TimerActiveDaysHi
Definition: ir_Argo.h:148
argoIrMessageType_t::IFEEL_TEMP_REPORT
@ IFEEL_TEMP_REPORT
IRArgoAC::setMode
void setMode(const uint8_t mode)
Set the desired operation mode.
Definition: ir_Argo.cpp:905
kArgoMaxRoomTemp
const uint8_t kArgoMaxRoomTemp
Definition: ir_Argo.h:170
IRArgoAC_WREM3::IRArgoAC_WREM3
IRArgoAC_WREM3(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Argo.cpp:119
IRArgoACBase::on
void on(void)
Set the internal state to have the power on.
Definition: ir_Argo.cpp:564
IRArgoACBase::IRArgoACBase
IRArgoACBase(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Argo.cpp:101
stdAc::opmode_t
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49