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

Technibel support #1259

Merged
merged 5 commits into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions examples/TurnOnTechnibelAC/TurnOnTechnibelAC.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* Copyright 2017, 2018 David Conran
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
*
* An IR LED circuit *MUST* be connected to the ESP8266 on a pin
* as specified by kIrLed below.
*
* TL;DR: The IR LED needs to be driven by a transistor for a good result.
*
* Suggested circuit:
* https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending
*
* Common mistakes & tips:
* * Don't just connect the IR LED directly to the pin, it won't
* have enough current to drive the IR LED effectively.
* * Make sure you have the IR LED polarity correct.
* See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity
* * Typical digital camera/phones can be used to see if the IR LED is flashed.
* Replace the IR LED with a normal LED if you don't have a digital camera
* when debugging.
* * Avoid using the following pins unless you really know what you are doing:
* * Pin 0/D3: Can interfere with the boot/program mode & support circuits.
* * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere.
* * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere.
* * ESP-01 modules are tricky. We suggest you use a module with more GPIOs
* for your first time. e.g. ESP-12 etc.
*/
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <IRutils.h>
#include <ir_Technibel.h>

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

void printState() {
// Display the settings.
Serial.println("Technibel A/C remote is in the following state:");
Serial.printf(" %s\n", ac.toString().c_str());
// Display the encoded IR sequence.
Serial.print("IR Code: 0x");
serialPrintUint64(ac.getRaw(), 16);
Serial.println();
}

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

// Set up what we want to send. See ir_Technibel.cpp for all the options.
Serial.println("Default state of the remote.");
printState();
Serial.println("Setting desired state for A/C.");
ac.on();
ac.setFan(kTechnibelAcFanLow);
ac.setMode(kTechnibelAcFan);
ac.setTemp(25);
ac.setSwing(false);
}

void loop() {
// Now send the IR signal.
#if SEND_TECHNIBEL_AC
Serial.println("Sending IR command to A/C ...");
ac.send();
#endif // SEND_TECHNIBEL_AC
printState();
delay(5000);
}
17 changes: 17 additions & 0 deletions examples/TurnOnTechnibelAC/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[platformio]
src_dir = .

[env]
lib_extra_dirs = ../../
lib_ldf_mode = deep+
lib_ignore = examples
framework = arduino
build_flags = ; -D_IR_LOCALE_=en-AU

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2

[env:esp32dev]
platform = espressif32
board = esp32dev
11 changes: 11 additions & 0 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "ir_Sanyo.h"
#include "ir_Sharp.h"
#include "ir_Tcl.h"
#include "ir_Technibel.h"
#include "ir_Teco.h"
#include "ir_Toshiba.h"
#include "ir_Trotec.h"
Expand Down Expand Up @@ -251,6 +252,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_TCL112AC
case decode_type_t::TCL112AC:
#endif
#if SEND_TECO
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
case decode_type_t::TECHNIBEL_AC:
#endif
#if SEND_TECO
case decode_type_t::TECO:
#endif
Expand Down Expand Up @@ -3177,6 +3181,13 @@ namespace IRAcUtils {
return ac.toString();
}
#endif // DECODE_VESTEL_AC
#if DECODE_TECHNIBEL_AC
case decode_type_t::TECHNIBEL_AC: {
IRTechnibelAc ac(0);
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
ac.setRaw(result->value); // TechnibelAc uses value instead of state.
return ac.toString();
}
#endif // DECODE_TECHNIBEL_AC
#if DECODE_VOLTAS
case decode_type_t::VOLTAS: {
IRVoltas ac(kGpioUnused);
Expand Down
4 changes: 4 additions & 0 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
DPRINTLN("Attempting Carrier 64bit decode");
if (decodeCarrierAC64(results, offset)) return true;
#endif // DECODE_CARRIER_AC64
#if DECODE_TECHNIBEL_AC
DPRINTLN("Attempting Technibel AC decode");
if (decodeTechnibelAc(results, offset)) return true;
#endif // DECODE_TECHNIBEL_AC
#if DECODE_CORONA_AC
DPRINTLN("Attempting CoronaAc decode");
if (decodeCoronaAc(results, offset)) return true;
Expand Down
6 changes: 6 additions & 0 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ class IRrecv {
const uint16_t nbits = kMultibracketsBits,
const bool strict = true);
#endif // DECODE_MULTIBRACKETS
#if DECODE_TECHNIBEL_AC
bool decodeTechnibelAc(decode_results *results,
uint16_t offset = kStartOffset,
const uint16_t nbits = kTechnibelAcBits,
const bool strict = true);
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
#endif // DECODE_TECHNIBEL_AC
#if DECODE_CORONA_AC
bool decodeCoronaAc(decode_results *results, uint16_t offset = kStartOffset,
const uint16_t nbits = kCoronaAcBitsShort,
Expand Down
12 changes: 11 additions & 1 deletion src/IRremoteESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,13 @@
#define SEND_MULTIBRACKETS _IR_ENABLE_DEFAULT_
#endif // SEND_MULTIBRACKETS

#ifndef DECODE_TECHNIBEL_AC
#define DECODE_TECHNIBEL_AC _IR_ENABLE_DEFAULT_
#endif // DECODE_TECHNIBEL_AC
#ifndef SEND_TECHNIBEL_AC
#define SEND_TECHNIBEL_AC _IR_ENABLE_DEFAULT_
#endif // SEND_TECHNIBEL_AC

#ifndef DECODE_CORONA_AC
#define DECODE_CORONA_AC _IR_ENABLE_DEFAULT_
#endif // DECODE_CORONA_AC
Expand Down Expand Up @@ -835,8 +842,9 @@ enum decode_type_t {
VOLTAS, // 90
METZ,
TRANSCOLD,
TECHNIBEL_AC,
// Add new entries before this one, and update it to point to the last entry.
kLastDecodeType = TRANSCOLD,
kLastDecodeType = TECHNIBEL_AC,
};

// Message lengths & required repeat values
Expand Down Expand Up @@ -893,6 +901,8 @@ const uint16_t kDaikin216Bits = kDaikin216StateLength * 8;
const uint16_t kDaikin216DefaultRepeat = kNoRepeat;
const uint16_t kDelonghiAcBits = 64;
const uint16_t kDelonghiAcDefaultRepeat = kNoRepeat;
const uint16_t kTechnibelAcBits = 56;
const uint16_t kTechnibelAcDefaultRepeat = kNoRepeat;
const uint16_t kDenonBits = 15;
const uint16_t kDenon48Bits = 48;
const uint16_t kDenonLegacyBits = 14;
Expand Down
6 changes: 6 additions & 0 deletions src/IRsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
return 48;
case MAGIQUEST:
case VESTEL_AC:
case TECHNIBEL_AC:
return 56;
case AMCOR:
case CARRIER_AC64:
Expand Down Expand Up @@ -976,6 +977,11 @@ bool IRsend::send(const decode_type_t type, const uint64_t data,
sendSymphony(data, nbits, min_repeat);
break;
#endif
#if SEND_TECHNIBEL_AC
case TECHNIBEL_AC:
sendTechnibelAc(data, nbits, min_repeat);
break;
#endif
#if SEND_TECO
case TECO:
sendTeco(data, nbits, min_repeat);
Expand Down
4 changes: 4 additions & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ class IRsend {
const uint16_t nbits = kMultibracketsBits,
const uint16_t repeat = kMultibracketsDefaultRepeat);
#endif
#if SEND_TECHNIBEL_AC
void sendTechnibelAc(uint64_t data, uint16_t nbits = kTechnibelAcBits,
uint16_t repeat = kTechnibelAcDefaultRepeat);
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
#endif
#if SEND_CORONA_AC
void sendCoronaAc(const uint8_t data[],
const uint16_t nbytes = kCoronaAcStateLength,
Expand Down
1 change: 1 addition & 0 deletions src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,6 @@ const PROGMEM char *kAllProtocolNamesStr =
D_STR_VOLTAS "\x0"
D_STR_METZ "\x0"
D_STR_TRANSCOLD "\x0"
D_STR_TECHNIBEL_AC "\x0"
///< New protocol strings should be added just above this line.
"\x0"; ///< This string requires double null termination.
Loading