Flashed Tuya BAC-006 GB WiFi Thermostat flashed over the air using tuya-cloudcutter
I reused some configuration from the U3 version of the BHT-006 Wi-Fi thermostat I found here: [FLASHED] Tuya BHT-006 WiFi Thermostat
bk72xx:
board: cb3s
framework:
version: dev
logger:
baud_rate: 0
level: debug
api:
services:
- service: write
variables:
command: string
then:
- uart.write:
data: !lambda |-
std::string hexString = command;
std::vector<uint8_t> byteArray;
// Loop through the hex string, two characters at a time
for (size_t i = 0; i < hexString.length(); i += 2) {
// Extract two characters representing a byte
std::string byteString = hexString.substr(i, 2);
// Convert the byte string to a uint8_t value
uint8_t byteValue = static_cast<uint8_t>(
stoi(byteString, nullptr, 16));
// Add the byte to the byte array
byteArray.push_back(byteValue);
}
return byteArray;
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret wifi_password
captive_portal:
web_server:
uart:
rx_pin: RX1
tx_pin: TX1
baud_rate: 9600
debug:
direction: BOTH
dummy_receiver: false
after:
delimiter: "\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
time:
- id: time_provider
platform: homeassistant
on_time_sync:
- logger.log: "Synchronized system clock"
on_time:
- seconds: 0
then:
- uart.write: [0x55, 0xaa, 0x00, 0x21, 0x00, 0x00, 0x20] #0x21 (Send weather data)
- uart.write: [0x55, 0xaa, 0x00, 0x20, 0x00, 0x02, 0x01, 0x00, 0x22] # 0x20 (Enable weather services) 0x01 (success) 0x00 (no error)
- uart.write: [0x55, 0xaa, 0x00, 0x34, 0x00, 0x02, 0x03, 0x00, 0x38] # 0x34 (Proactively request weather data) 0x03 (subcommand) 0x00 (success)
- logger.log: "Disabling weather requests"
tuya:
time_id: time_provider
climate:
- platform: tuya
name: "Thermostat"
supports_cool: true
icon: mdi:heating-coil
switch_datapoint: 1
target_temperature_datapoint: 16
current_temperature_datapoint: 24
active_state:
datapoint : 2
heating_value: 1
cooling_value: 0
fanonly_value: 2
preset:
eco:
datapoint: 4
fan_mode:
datapoint: 28
auto_value: 3
low_value: 0
medium_value: 1
high_value: 2
temperature_multiplier: 0.1
visual:
min_temperature: 10 °C
max_temperature: 30 °C
temperature_step: 0.5 °C
switch:
- platform: tuya
name: "Thermostat"
icon: mdi:power
switch_datapoint: 1
internal: True
- platform: tuya
name: "Economy Mode"
icon: mdi:leaf
switch_datapoint: 4
- platform: tuya
name: "Child Lock"
icon: mdi:lock
switch_datapoint: 40
- platform: tuya
name: "Manual Schedule"
icon: "mdi:calendar"
switch_datapoint: 101
select:
- platform: tuya
name: "Sensor Type"
enum_datapoint: 102
options:
0: Internal
2: External
1: Internal and External
- platform: template
name: "Weather"
icon: "mdi:emoticon-outline"
optimistic: true
options:
- sunny
- cloudy
- rainy
- snowy
on_value:
then:
- logger.log:
format: "Chosen option: %s (index %d)"
args: ["x.c_str()", "i"]
- uart.write:
data: !lambda |-
if (x == "sunny") {
return {0x55,0xAA,0x00,0x21,0x00,0x15,0x01,0x0E,0x77,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x4e,0x75,0x6d,0x01,0x03,0x31,0x32,0x30,0x77};
} else if (x == "cloudy") {
return {0x55,0xAA,0x00,0x21,0x00,0x15,0x01,0x0E,0x77,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x4e,0x75,0x6d,0x01,0x03,0x31,0x34,0x32,0x7B};
} else if (x == "rainy") {
return {0x55,0xAA,0x00,0x21,0x00,0x15,0x01,0x0E,0x77,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x4e,0x75,0x6d,0x01,0x03,0x31,0x31,0x32,0x78};
}else if (x == "snowy") {
return {0x55,0xAA,0x00,0x21,0x00,0x15,0x01,0x0E,0x77,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x4e,0x75,0x6d,0x01,0x03,0x31,0x30,0x35,0x7A};
}
sensor:
- platform: tuya
name: "Temperature External Sensor"
device_class: "temperature"
sensor_datapoint: 101
unit_of_measurement: "°C"
accuracy_decimals: 1
filters:
- multiply: 0.1
disabled_by_default: True
number:
- platform: tuya
name: "Temperature compensation"
number_datapoint: 27
min_value: -9
max_value: 9
step: 1
- platform: tuya
name: "Economy Temperature"
number_datapoint: 106
min_value: 0
max_value: 30
step: 0.5
multiply: 10
- platform: tuya
name: "Min Set Temp"
number_datapoint: 20
min_value: 5
max_value: 15
step: 0.5
multiply: 10
- platform: tuya
name: "Max Set Temp"
number_datapoint: 19
min_value: 20
max_value: 35
step: 0.5
multiply: 10
- platform: tuya
name: "Low Temperature Protection"
number_datapoint: 105
min_value: 0
max_value: 10
step: 0.5
multiply: 10
- platform: tuya
name: "High Temperature Protection"
number_datapoint: 104
min_value: 25
max_value: 45
step: 0.5
multiply: 10
- platform: tuya
name: "Dead Zone Temperature"
number_datapoint: 103
unit_of_measurement: "°C"
min_value: 1
max_value: 5
step: 1
disabled_by_default: True
Currently, everything works fine including the weather display, except for one thing: I can’t get the state when the thermostat starts cooling or heating… I’ve read that it is possible to get this state with some soldering… but has anybody succeeded with this unit?
I can get the state when the thermostat starts cooling or heating, but only when the thermostat is on. Is there a way to switch off the screen from HA (It would be nice to have the green leaf on) and still leave the device on?