Skip to content

Commit

Permalink
Argo sendSensorTemp (#1858)
Browse files Browse the repository at this point in the history
When using the iFeel functionality the remote regularly sends silent (i.e. no beep) messages to the Argo unit to update the current temperature. This function adds the ability to send such messages.

On a side note, to capture normal Argo IR messages using IRrecv::decodeArgo I had to reduce kArgoBits and disable the checksum, likely because the message wasn't fully recorded. To capture these temperature messages I had to use nbits = 32.

X-Ref: #1859
  • Loading branch information
zpin authored Aug 21, 2022
1 parent bb78783 commit ff045f1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/ir_Argo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ void IRArgoAC::begin(void) { _irsend.begin(); }
void IRArgoAC::send(const uint16_t repeat) {
_irsend.sendArgo(getRaw(), kArgoStateLength, repeat);
}

/// Send current room temperature for the iFeel feature as a silent IR
/// message (no acknowledgement from the device).
/// @param[in] temp The temperature in degrees celsius.
/// @param[in] repeat Nr. of times the message will be repeated.
void IRArgoAC::sendSensorTemp(const uint8_t temp, const uint16_t repeat) {
uint8_t tempc = temp - kArgoTempDelta;
uint8_t check = 52 + tempc;
uint8_t end = 0b011;

ArgoProtocol data;
data.raw[0] = 0b10101100;
data.raw[1] = 0b11110101;
data.raw[2] = (tempc << 3) | (check >> 5);
data.raw[3] = (check << 3) | end;
for (uint8_t i = 4; i < kArgoStateLength; i++) data.raw[i] = 0x0;
uint8_t sum = IRArgoAC::calcChecksum(data.raw, kArgoStateLength);
data.raw[10] = 0b00000010;
data.Sum = sum;

_irsend.sendArgo(data.raw, kArgoStateLength, repeat);
}
#endif // SEND_ARGO

/// Verify the checksum is valid for a given state.
Expand Down
2 changes: 2 additions & 0 deletions src/ir_Argo.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class IRArgoAC {

#if SEND_ARGO
void send(const uint16_t repeat = kArgoDefaultRepeat);
void sendSensorTemp(const uint8_t temp,
const uint16_t repeat = kArgoDefaultRepeat);
/// Run the calibration to calculate uSec timing offsets for this platform.
/// @return The uSec timing offset needed per modulation of the IR Led.
/// @note This will produce a 65ms IR signal pulse at 38kHz.
Expand Down

0 comments on commit ff045f1

Please sign in to comment.