Implemented rough 1st iteration of dc-load value screen.
This commit is contained in:
+47
-20
@@ -1,6 +1,7 @@
|
||||
# Derived work based on https://github.com/reaper7/M5Stack_BLE_client_Owon_B35T by reaper7.
|
||||
# AI (ChatGPT) has been used to adopt the Arduino sketch to ESPHome.
|
||||
# AI (ChatGPT (GPT5.5), Qwen3.6) has been used to adopt the Arduino sketch to ESPHome.
|
||||
# Ported to M5Stack Core2 due to memory constraints.
|
||||
# Integrated atorch ble proxy functionality from https://github.com/syssi/esphome-atorch-dl24 by syssi.
|
||||
|
||||
substitutions:
|
||||
name: "lab-ble-proxy"
|
||||
@@ -68,6 +69,12 @@ wifi:
|
||||
|
||||
captive_portal:
|
||||
|
||||
globals:
|
||||
- id: display_page
|
||||
type: int
|
||||
initial_value: "0"
|
||||
restore_value: no
|
||||
|
||||
interval:
|
||||
- interval: 10s
|
||||
then:
|
||||
@@ -146,6 +153,7 @@ font:
|
||||
"-",
|
||||
".",
|
||||
"/",
|
||||
":",
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
@@ -182,6 +190,7 @@ font:
|
||||
"Y",
|
||||
"Z",
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"e",
|
||||
@@ -190,9 +199,11 @@ font:
|
||||
"h",
|
||||
"i",
|
||||
"k",
|
||||
"l",
|
||||
"m",
|
||||
"n",
|
||||
"o",
|
||||
"p",
|
||||
"r",
|
||||
"s",
|
||||
"t",
|
||||
@@ -212,7 +223,19 @@ display:
|
||||
model: M5CORE2
|
||||
update_interval: 500ms
|
||||
lambda: |-
|
||||
owon_meter.render(it, id(meter_font));
|
||||
owon_meter.render(
|
||||
it,
|
||||
id(meter_font),
|
||||
id(display_page),
|
||||
id(atorch_running).state,
|
||||
id(atorch_voltage).has_state() ? id(atorch_voltage).state : NAN,
|
||||
id(atorch_current).has_state() ? id(atorch_current).state : NAN,
|
||||
id(atorch_power).has_state() ? id(atorch_power).state : NAN,
|
||||
id(atorch_capacity).has_state() ? id(atorch_capacity).state : NAN,
|
||||
id(atorch_energy).has_state() ? id(atorch_energy).state : NAN,
|
||||
id(atorch_temperature).has_state() ? id(atorch_temperature).state : NAN,
|
||||
id(atorch_runtime_formatted).has_state() ? id(atorch_runtime_formatted).state.c_str() : "--:--:--"
|
||||
);
|
||||
|
||||
touchscreen:
|
||||
- platform: ft63x6
|
||||
@@ -220,6 +243,18 @@ touchscreen:
|
||||
display: lcd
|
||||
|
||||
binary_sensor:
|
||||
- platform: touchscreen
|
||||
touchscreen_id: touch
|
||||
id: btn_toggle_page
|
||||
x_min: 70
|
||||
x_max: 250
|
||||
y_min: 45
|
||||
y_max: 195
|
||||
on_press:
|
||||
then:
|
||||
- lambda: |-
|
||||
id(display_page) = 1 - id(display_page);
|
||||
id(lcd).update();
|
||||
- platform: touchscreen
|
||||
id: button_a
|
||||
touchscreen_id: touch
|
||||
@@ -296,11 +331,6 @@ binary_sensor:
|
||||
lambda: |-
|
||||
return owon_meter.low_battery;
|
||||
|
||||
- platform: atorch_dl24
|
||||
atorch_dl24_id: atorch0
|
||||
running:
|
||||
name: "${friendly_name} Atorch Running"
|
||||
|
||||
sensor:
|
||||
- platform: ble_client
|
||||
type: characteristic
|
||||
@@ -323,20 +353,22 @@ sensor:
|
||||
atorch_dl24_id: atorch0
|
||||
voltage:
|
||||
name: "${friendly_name} Atorch Voltage"
|
||||
id: atorch_voltage
|
||||
current:
|
||||
name: "${friendly_name} Atorch Current"
|
||||
id: atorch_current
|
||||
power:
|
||||
name: "${friendly_name} Atorch Power"
|
||||
id: atorch_power
|
||||
capacity:
|
||||
name: "${friendly_name} Atorch Capacity"
|
||||
energy:
|
||||
name: "${friendly_name} Atorch Energy"
|
||||
id: atorch_capacity
|
||||
temperature:
|
||||
name: "${friendly_name} Atorch Temperature"
|
||||
id: atorch_temperature
|
||||
dim_backlight:
|
||||
name: "${friendly_name} Atorch Dim Backlight"
|
||||
runtime:
|
||||
name: "${friendly_name} Atorch Runtime"
|
||||
id: atorch_dim_backlight
|
||||
|
||||
text_sensor:
|
||||
- platform: template
|
||||
@@ -355,11 +387,6 @@ text_sensor:
|
||||
lambda: |-
|
||||
return owon_meter.mode_text();
|
||||
|
||||
- platform: atorch_dl24
|
||||
atorch_dl24_id: atorch0
|
||||
runtime_formatted:
|
||||
name: "${friendly_name} Atorch Runtime Formatted"
|
||||
|
||||
button:
|
||||
- platform: atorch_dl24
|
||||
atorch_dl24_id: atorch0
|
||||
@@ -400,7 +427,7 @@ button:
|
||||
value: !lambda "return std::vector<uint8_t>({2, 0x01});"
|
||||
|
||||
- platform: template
|
||||
name: "OWON HLD/LIG"
|
||||
name: "OWON HOLD | LIGHT"
|
||||
id: owon_btn_hold
|
||||
on_press:
|
||||
- ble_client.ble_write:
|
||||
@@ -410,7 +437,7 @@ button:
|
||||
value: !lambda "return std::vector<uint8_t>({3, 0x01});"
|
||||
|
||||
- platform: template
|
||||
name: "OWON REL/BT"
|
||||
name: "OWON RELATIVE | BT"
|
||||
id: owon_btn_rel
|
||||
on_press:
|
||||
- ble_client.ble_write:
|
||||
@@ -420,7 +447,7 @@ button:
|
||||
value: !lambda "return std::vector<uint8_t>({4, 0x01});"
|
||||
|
||||
- platform: template
|
||||
name: "OWON HZ/DUTY"
|
||||
name: "OWON HZ | DUTY"
|
||||
id: owon_btn_hz
|
||||
on_press:
|
||||
- ble_client.ble_write:
|
||||
@@ -430,7 +457,7 @@ button:
|
||||
value: !lambda "return std::vector<uint8_t>({5, 0x01});"
|
||||
|
||||
- platform: template
|
||||
name: "OWON MAX/MIN"
|
||||
name: "OWON MAX | MIN"
|
||||
id: owon_btn_maxmin
|
||||
on_press:
|
||||
- ble_client.ble_write:
|
||||
|
||||
Reference in New Issue
Block a user