yup
This commit is contained in:
parent
a53fda923c
commit
96732ec6ae
1 changed files with 122 additions and 112 deletions
234
thermostat.yml
234
thermostat.yml
|
@ -1,16 +1,39 @@
|
||||||
esphome:
|
esphome:
|
||||||
name: thermostat
|
name: thermostat
|
||||||
|
|
||||||
|
# esp32:
|
||||||
|
# board: esp32-s3-devkitc-1
|
||||||
|
# variant: esp32s3
|
||||||
|
# framework:
|
||||||
|
# type: esp-idf
|
||||||
|
# sdkconfig_options:
|
||||||
|
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: y
|
||||||
|
# CONFIG_ESP32S3_DATA_CACHE_64KB: y
|
||||||
|
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
|
||||||
|
# CONFIG_SPIRAM_RODATA: y
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp32-s3-devkitc-1
|
board: esp32-s3-devkitc-1
|
||||||
variant: esp32s3
|
variant: esp32s3
|
||||||
|
flash_size: 8MB
|
||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
version: latest
|
||||||
sdkconfig_options:
|
sdkconfig_options:
|
||||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: y
|
CONFIG_IDF_TARGET: "esp32s3"
|
||||||
CONFIG_ESP32S3_DATA_CACHE_64KB: y
|
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240: y
|
||||||
|
CONFIG_ESPTOOLPY_FLASHMODE_QIO: y
|
||||||
|
CONFIG_ESPTOOLPY_FLASHFREQ_80M: y
|
||||||
|
CONFIG_ESPTOOLPY_FLASHSIZE_8MB: y
|
||||||
|
CONFIG_IDF_EXPERIMENTAL_FEATURES: y
|
||||||
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
|
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
|
||||||
|
CONFIG_SPIRAM: y
|
||||||
|
CONFIG_SPIRAM_MODE_OCT: y
|
||||||
CONFIG_SPIRAM_RODATA: y
|
CONFIG_SPIRAM_RODATA: y
|
||||||
|
CONFIG_SPIRAM_SPEED_80M: y
|
||||||
|
CONFIG_FREERTOS_HZ: "1000"
|
||||||
|
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: y
|
||||||
|
COMPILER_OPTIMIZATION_SIZE: y
|
||||||
|
|
||||||
psram:
|
psram:
|
||||||
mode: octal
|
mode: octal
|
||||||
|
@ -19,6 +42,9 @@ psram:
|
||||||
# Enable logging
|
# Enable logging
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
|
ch422g:
|
||||||
|
# address: 0x24
|
||||||
|
|
||||||
# Enable Home Assistant API
|
# Enable Home Assistant API
|
||||||
api:
|
api:
|
||||||
password: ""
|
password: ""
|
||||||
|
@ -28,8 +54,11 @@ ota:
|
||||||
password: ""
|
password: ""
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: "Cochrun"
|
# ssid: "Cochrun"
|
||||||
password: "GreasyChicken784"
|
# password: "GreasyChicken784"
|
||||||
|
|
||||||
|
ssid: "TFC"
|
||||||
|
password: "Disciple77"
|
||||||
|
|
||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||||
ap:
|
ap:
|
||||||
|
@ -39,10 +68,20 @@ wifi:
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
i2c:
|
i2c:
|
||||||
sda: GPIO08
|
- id: bus_a
|
||||||
scl: GPIO09
|
sda: GPIO08
|
||||||
scan: True
|
scl: GPIO09
|
||||||
id: bus_a
|
scan: True
|
||||||
|
# - id: bus_b
|
||||||
|
# sda:
|
||||||
|
# pin:
|
||||||
|
# ch422g:
|
||||||
|
# number: 6
|
||||||
|
# scl:
|
||||||
|
# pin:
|
||||||
|
# ch422g:
|
||||||
|
# number: 5
|
||||||
|
# scan: True
|
||||||
|
|
||||||
# uart:
|
# uart:
|
||||||
# tx_pin: GPIO27
|
# tx_pin: GPIO27
|
||||||
|
@ -50,18 +89,15 @@ i2c:
|
||||||
# baud_rate: 115200
|
# baud_rate: 115200
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: bme280_i2c
|
- platform: aht10
|
||||||
|
variant: AHT20
|
||||||
temperature:
|
temperature:
|
||||||
name: "Temperature"
|
name: "Temperature"
|
||||||
id: temperature
|
id: temperature
|
||||||
pressure:
|
|
||||||
name: "Pressure"
|
|
||||||
id: pressure
|
|
||||||
humidity:
|
humidity:
|
||||||
name: "Humidity"
|
name: "Humidity"
|
||||||
id: humidity
|
id: humidity
|
||||||
i2c_id: bus_a
|
# address: 0x76
|
||||||
address: 0x76
|
|
||||||
|
|
||||||
# dfrobot_sen0395:
|
# dfrobot_sen0395:
|
||||||
|
|
||||||
|
@ -147,19 +183,6 @@ switch:
|
||||||
# detection_segments:
|
# detection_segments:
|
||||||
# - [0cm, 3.3m]
|
# - [0cm, 3.3m]
|
||||||
|
|
||||||
# number:
|
|
||||||
# - platform: template
|
|
||||||
# id: sensitivity
|
|
||||||
# name: Mmwave sensitivity
|
|
||||||
# optimistic: true
|
|
||||||
# min_value: 1
|
|
||||||
# max_value: 10
|
|
||||||
# step: 1
|
|
||||||
# mode: slider
|
|
||||||
# set_action:
|
|
||||||
# - button.press:
|
|
||||||
# id: inner_button
|
|
||||||
|
|
||||||
# - platform: template
|
# - platform: template
|
||||||
# id: distance
|
# id: distance
|
||||||
# name: Mmwave distance
|
# name: Mmwave distance
|
||||||
|
@ -251,14 +274,17 @@ display:
|
||||||
font:
|
font:
|
||||||
- file: "gfonts://Roboto"
|
- file: "gfonts://Roboto"
|
||||||
id: chu_nano
|
id: chu_nano
|
||||||
size: 12
|
size: 18
|
||||||
|
|
||||||
touchscreen:
|
touchscreen:
|
||||||
platform: gt911
|
- platform: gt911
|
||||||
id: my_touch
|
id: my_touchscreen
|
||||||
interrupt_pin: GPIO4
|
interrupt_pin: 4
|
||||||
on_touch:
|
reset_pin:
|
||||||
- lambda: |-
|
ch422g:
|
||||||
|
number: 1
|
||||||
|
on_touch:
|
||||||
|
- lambda: |-
|
||||||
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
|
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
|
||||||
touch.x,
|
touch.x,
|
||||||
touch.y,
|
touch.y,
|
||||||
|
@ -266,90 +292,74 @@ touchscreen:
|
||||||
touch.y_raw
|
touch.y_raw
|
||||||
);
|
);
|
||||||
|
|
||||||
|
color:
|
||||||
|
- id: bg
|
||||||
|
hex: 282A36
|
||||||
|
|
||||||
lvgl:
|
lvgl:
|
||||||
buffer_size: 25%
|
buffer_size: 25%
|
||||||
|
default_font: chu_nano
|
||||||
pages:
|
pages:
|
||||||
- id: clock_page
|
- id: page
|
||||||
|
bg_color: 0x282A36
|
||||||
widgets:
|
widgets:
|
||||||
- obj: # Clock container
|
- obj:
|
||||||
height: size_content
|
align: top_mid
|
||||||
width: 800 #240
|
width: 800
|
||||||
align: CENTER
|
|
||||||
pad_all: 0
|
|
||||||
border_width: 0
|
|
||||||
bg_color: 0xFFFFFF
|
|
||||||
widgets:
|
widgets:
|
||||||
- meter: # Clock face
|
- slider: # Clock container
|
||||||
height: 400 #220
|
pad_top: 30px
|
||||||
width: 400 #220
|
align: top_mid
|
||||||
|
width: 600
|
||||||
|
id: heat_id
|
||||||
|
value: 76
|
||||||
|
min_value: 50
|
||||||
|
max_value: 100
|
||||||
|
- label:
|
||||||
|
pad_top: 40px
|
||||||
align: center
|
align: center
|
||||||
bg_opa: TRANSP
|
text: "Hello World"
|
||||||
text_color: 0x000000
|
text_color: 0xE2E4E5
|
||||||
scales:
|
- slider: # Clock container
|
||||||
- ticks: # minutes scale
|
pad_top: 60px
|
||||||
width: 1
|
align: top_mid
|
||||||
count: 61
|
width: 600
|
||||||
length: 10
|
id: cool_id
|
||||||
color: 0x000000
|
value: 68
|
||||||
range_from: 0
|
min_value: 50
|
||||||
range_to: 60
|
max_value: 100
|
||||||
angle_range: 360
|
- label:
|
||||||
rotation: 270
|
pad_top: 70px
|
||||||
indicators:
|
align: center
|
||||||
- line:
|
text: "Hello World"
|
||||||
id: minute_hand
|
text_color: 0xE2E4E5
|
||||||
width: 3
|
- label:
|
||||||
color: 0xa6a6a6
|
align: center
|
||||||
r_mod: -4
|
text: "Hello World"
|
||||||
value: 0
|
text_color: 0xE2E4E5
|
||||||
- ticks: # hours scale
|
|
||||||
width: 1
|
# time:
|
||||||
count: 12
|
# - platform: homeassistant
|
||||||
length: 1
|
# id: time_comp
|
||||||
major:
|
|
||||||
stride: 1
|
|
||||||
width: 4
|
|
||||||
length: 8
|
|
||||||
color: 0xC0C0C0
|
|
||||||
label_gap: 12
|
|
||||||
angle_range: 330
|
|
||||||
rotation: 300
|
|
||||||
range_from: 1
|
|
||||||
range_to: 12
|
|
||||||
- indicators:
|
|
||||||
- line:
|
|
||||||
id: hour_hand
|
|
||||||
width: 5
|
|
||||||
color: 0xa6a6a6
|
|
||||||
r_mod: -30
|
|
||||||
value: 0
|
|
||||||
angle_range: 360
|
|
||||||
rotation: 270
|
|
||||||
range_from: 0
|
|
||||||
range_to: 720
|
|
||||||
|
|
||||||
time:
|
# interval:
|
||||||
- platform: homeassistant
|
# - interval: 30s
|
||||||
id: time_comp
|
# then:
|
||||||
|
# if:
|
||||||
|
# condition:
|
||||||
|
# time.has_time:
|
||||||
|
# then:
|
||||||
|
# - script.execute: time_update
|
||||||
|
|
||||||
interval:
|
# script:
|
||||||
- interval: 30s
|
# - id: time_update
|
||||||
then:
|
# then:
|
||||||
if:
|
# - lvgl.indicator.update:
|
||||||
condition:
|
# id: minute_hand
|
||||||
time.has_time:
|
# value: !lambda |-
|
||||||
then:
|
# return id(time_comp).now().minute;
|
||||||
- script.execute: time_update
|
# - lvgl.indicator.update:
|
||||||
|
# id: hour_hand
|
||||||
script:
|
# value: !lambda |-
|
||||||
- id: time_update
|
# auto now = id(time_comp).now();
|
||||||
then:
|
# return std::fmod(now.hour, 12) * 60 + now.minute;
|
||||||
- lvgl.indicator.update:
|
|
||||||
id: minute_hand
|
|
||||||
value: !lambda |-
|
|
||||||
return id(time_comp).now().minute;
|
|
||||||
- lvgl.indicator.update:
|
|
||||||
id: hour_hand
|
|
||||||
value: !lambda |-
|
|
||||||
auto now = id(time_comp).now();
|
|
||||||
return std::fmod(now.hour, 12) * 60 + now.minute;
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue