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

Add HVAC Actions #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Tested with M5Stack NanoC6 and Tesla firmwares 2024.26.3.1.
- [x] Set charging amps
- [x] Set charging limit (percent)
- [x] Turn on/off charging
- [x] Turn on/off HVAC
- [x] Turn on/off steering heat
- [x] BLE information sensors
- [x] Asleep / awake
- [x] Doors locked / unlocked
Expand Down
14 changes: 14 additions & 0 deletions components/tesla_ble_vehicle/tesla_ble_vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,12 @@ namespace esphome
case SET_CHARGING_LIMIT:
action_str = "setChargingLimit";
break;
case SET_HVAC_SWITCH:
action_str = "setHVACSwitch";
break;
case SET_HVAC_STEERING_HEATER_SWITCH:
action_str = "setHVACSteeringHeatSwitch";
break;
default:
action_str = "setChargingParameters";
break;
Expand All @@ -1259,6 +1265,14 @@ namespace esphome
return_code = tesla_ble_client_->buildChargingSetLimitMessage(
static_cast<int32_t>(param), message_buffer, &message_length);
break;
case SET_HVAC_SWITCH:
return_code = tesla_ble_client_->buildHVACMessage(
static_cast<bool>(param), message_buffer, &message_length);
break;
case SET_HVAC_STEERING_HEATER_SWITCH:
return_code = tesla_ble_client_->buildHVACSteeringHeaterMessage(
static_cast<bool>(param), message_buffer, &message_length);
break;
default:
ESP_LOGE(TAG, "Invalid action: %d", static_cast<int>(action));
return 1;
Expand Down
4 changes: 3 additions & 1 deletion components/tesla_ble_vehicle/tesla_ble_vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ typedef enum BLE_CarServer_VehicleAction_E
{
SET_CHARGING_SWITCH,
SET_CHARGING_AMPS,
SET_CHARGING_LIMIT
SET_CHARGING_LIMIT,
SET_HVAC_SWITCH,
SET_HVAC_STEERING_HEATER_SWITCH
} BLE_CarServer_VehicleAction;

namespace esphome
Expand Down
Loading