You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
3.4 KiB

esphome:
name: gf-toilet-thermostat
bk72xx:
board: generic-bk7231t-qfn32-tuya
uart:
rx_pin: RX1
tx_pin: TX1
baud_rate: 9600
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
mqtt:
broker: mqtt.blu3cat
username: openhab
password: Hl3Yr6cT2mgSp1eW
ota:
- platform: esphome
password: ""
wifi:
ssid: "blu3cat-legacy"
password: "tubbychristison"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Gf Toilet Thermostat"
password: "yOfdzvIhC1Qd"
captive_portal:
time:
- platform: sntp
id: sntp_time
timezone: Europe/London
servers:
- blu3cat.blu3cat
- 192.168.3.1
tuya:
# The MCU uses this for displaying the time in the display as well as for
# scheduled programmes one may have configured in their thermostat.
time_id: sntp_time
# (Optional)
# Schedules are not modeled in neither ESPHome nor Home Assistant.
#
# This parses the data point and emitting it as a string in the logs, and
# serves as an example for users desiring more advanced configurations.
on_datapoint_update:
- sensor_datapoint: 101
datapoint_type: raw
then:
- lambda: |-
// Apparently these vary per model; these are valid for the BHT-002
const int POS_HOUR = 1;
const int POS_MINUTE = 0;
const float TEMPERATURE_MULTIPLIER = 0.5f;
const std::map<int, std::string> DAY_OFFSET = {
{0, "days 1-5"},
{6, "day 6"},
{12, "day 7"},
};
for (auto& day : DAY_OFFSET) {
for (int period = 0; period < 6; period++) {
int offset = (day.first + period) * 3;
int hour = x[offset + POS_HOUR];
int minute = x[offset + POS_MINUTE];
float temp = x[offset + 2] * TEMPERATURE_MULTIPLIER;
ESP_LOGD("custom", "Scheduled program for %s %02d:%02d set at %.1f C", day.second.c_str(), hour, minute, temp);
}
}
climate:
- platform: tuya
name: "Thermostat"
switch_datapoint: 1
target_temperature_datapoint: 2
current_temperature_datapoint: 3
preset:
eco:
datapoint: 5
temperature: 18 °C
temperature_multiplier: 0.5
visual:
min_temperature: 15 °C
max_temperature: 30 °C
temperature_step: 0.1 °C
sensor:
- platform: "tuya"
name: "Temperature"
sensor_datapoint: 3
unit_of_measurement: "°C"
device_class: "temperature"
accuracy_decimals: 1
filters:
- multiply: 0.5
# The climate component already includes temperature, but having the
# temperature as a separate sensor can be useful
disabled_by_default: false
# The external temperature sensor, if wired
- platform: "tuya"
name: "Temperature (external)"
sensor_datapoint: 102
unit_of_measurement: "°C"
device_class: "temperature"
accuracy_decimals: 1
filters:
- multiply: 0.5
disabled_by_default: false
switch:
- platform: "tuya"
name: "Lock"
icon: "mdi:lock"
switch_datapoint: 6
- platform: "tuya"
name: "Device Power"
switch_datapoint: 1
select:
- platform: "tuya"
name: "Scheduled programming"
icon: "mdi:calendar"
enum_datapoint: 4
options:
0: Use scheduled programs
1: Manual control