This library can make Arduino/NodeMCU communicate with Toshiba/Carrier HVAC System via serial communication through wifi adapter port. You can use this library to implement the smart home system, control your HVAC remoteless via internet or LAN, automation, etc.
- ESP8266
- ESP32
- ATmega328P (Arduino Uno R3, Arduino Nano)
- Toshiba Seiya
- Toshiba Shorai
- Carrier X Inverter (42TVAA)
- Carrier X Inverter Plus 2024 (42TVAB)
- Carrier Color Smart (42TVCA)
- Power ("off", "on")
- Setpoint (17-30c)
- Mode ("auto", "cool", "heat", "dry", "fan_only")
- Fan mode ("quiet", "lvl_1", "lvl_2", "lvl_3", "lvl_4", "lvl_5", "auto")
- Swing (vertical) ("fix", "v_swing", "h_swing", "vh_swing", "fix_pos_1", "fix_pos_2", "fix_pos_3", "fix_pos_4", "fix_pos_5", )
- Pure ("off", "on")
- Power select ("50%", "75%", "100%")
- Operation ("normal", "high_power", "silent_1", "eco", "eight_deg", "silent_2", "fireplace_1", "fireplace_2")
- Front panel WiFi LED ("off", "on")
- Room temperature
- Outside temperature
- On/off timer status ("off", "on")
- CDU status (run, stop)
See images here
Note: If using ESP8266 or ESP32 please always use with TTL level shifter (5V to 3.3V TTL)
#include <ToshibaCarrierHvac.h>
- Hardware serial
ToshibaCarrierHvac hvac(&Serial);
- Software serial
ToshibaCarrierHvac hvac(D5, D6); // RX, TX
void loop() {
hvac.handleHvac();
}
- Settings structure
struct hvacSettings {
const char* state;
uint8_t setpoint;
const char* mode;
const char* swing;
const char* fanMode;
const char* pure;
const char* powerSelect;
const char* operation;
const char* wifiLed;
};
- Status structure
struct hvacStatus {
int8_t roomTemperature;
int8_t outsideTemperature;
const char* offTimer;
const char* onTimer;
bool running;
};
- Get all current status from structure
hvacStatus newStatus = hvac.getStatus;
- Get all current settings from structure
hvacSettings newSettings = hvac.getSettings;
- Get only one function
hvac.getState();
hvac.getSetpoint();
hvac.getMode();
hvac.getFanMode();
hvac.getSwing();
hvac.getPure();
hvac.getOffTimer();
hvac.getOnTimer();
hvac.getPowerSelect();
hvac.getOperation();
- Apply a preset
hvacSettings myPreset {
"on", // State ["off", "on"]
25, // Setpoint [16-30c]
"cool", // Mode ["auto", "cool", "heat", "dry", "fan_only"]
"on", // Swing ["off", "on"]
"lvl_3", // Fan mode ["quiet", "lvl_1", "lvl_2", "lvl_3", "lvl_4", "lvlL_5", "auto"]
"off", // Pure ["off", "on"]
"100%", // Power select ["50%", "75%", "100%"]
"normal" // Operation ["normal", "high_power", "silent_1", "eco", "silent_2"]
};
hvac.applyPreset(myPreset);
- Set only one function
hvac.setState("on");
hvac.setSetpoint(25);
hvac.setMode("cool");
hvac.setfanMode("lvl_3");
hvac.setSwing("off");
hvac.setPure("on");
hvac.setPowerSelect("100%");
hvac.setOperation("normal");
- Boolean status (true or false)
hvac.isConnected();
hvac.isCduRunning();
Set your callback function in setup. See more example in UseCallback.ino
void hvacCallback(hvacStatus newStatus) {
if (newStatus.roomTemperature > 30) hvac.setState("on");
}
void setup() {
hvac.setStatusUpdatedCallback(hvacCallback);
}
This will callback when any status updated and return structure of current status (acStatus).
hvac.setStatusUpdatedCallback(YourCallbackFunction);
This will callback when any setting updated and return structure of current settings (acSettings).
hvac.setSettingsUpdatedCallback(YourCallbackFunction);
This will callback when any status or any settings updated but doesn't return anything.
hvac.setUpdateCallback(YourCallbackFunction);
This will callback when any status or any setting updated and return name of updated function.
hvac.setWhichFunctionUpdatedCallback(YourCallbackFunction);
The custom packet size must be 8 to 17 bytes. This function just send your packet without checking anything so please carefully use.
byte myPacket[] = {2, 0, 3, 144, 0, 0, 9, 1, 48, 1, 0, 0, 0, 2, 163, 65, 76};
hvac.sendCustomPacket(myPacket, sizeof(myPacket));
Use KiCad to design a prototype board. The cost of components and PCB is around $2.5/pices.
- Send custom packet
- Prototype board
- Callback function for debug