Sure. I haven’t used the LORA part, I hooked a second display and use that for my car which doesn’t have a clock. The ESP display shows temperature from a xiaomi ble sensor sticked under the hood (it’s a rear engined electric Citroen C-Zero). You can see it in action here ESP based clock with dual display and temperature display - YouTube
esphome:
name: heltec
platform: ESP32
board: heltec_wifi_lora_32_V2
on_boot:
then:
# Read the RTC time once when the system boots
- ds1307.read_time:
- delay: 5s
# Reboot if the display didn't start. Reset daily counter (time) if needed.
- lambda: |-
if (!id(blue_display).is_on()) {
id(node).turn_on();
} else {
if (id(last_start)!=id(esptime).now().day_of_year) {
id(last_start) = id(esptime).now().day_of_year;
id(day_counter) = 0;
}
}
image:
- file: "logo.png"
id: logo
# resize: 100x100
type: BINARY
# - file: "mono_black.png"
# id: czero
# type: BINARY
switch:
- platform: restart
id: node
# Use phone hotspot to sync time if needed.
wifi:
ssid: "Deyan's phone"
password: "<your password>"
reboot_timeout: 0s
# Enable logging
logger:
level: DEBUG
logs:
esp32_ble_tracker: ERROR
wifi: ERROR
text_sensor:
- platform: template
name: Uptime Human Readable
id: uptime_human
icon: mdi:clock-start
sensor:
- platform: uptime
name: Uptime Sensor
id: uptime_sensor
internal: true
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(to_string(minutes) + "m ")
).c_str();
- lambda: |-
if (round(id(uptime_sensor).raw_state) > 50){
id(day_counter) ++;
}
- platform: pvvx_mithermometer
mac_address: "A4:C1:38:18:00:2F"
temperature:
name: "PVVX Temperature"
id: "outside_temp"
humidity:
name: "PVVX Humidity"
battery_level:
name: "PVVX Battery-Level"
id: "outside_battery"
battery_voltage:
name: "PVVX Battery-Voltage"
globals:
- id: prod
type: int
restore_value: no
initial_value: '0'
- id: last_start
type: int
restore_value: yes
initial_value: '0'
- id: day_counter
type: int
restore_value: yes
initial_value: '0'
- id: counter
type: int
restore_value: no
initial_value: '0'
preferences:
flash_write_interval: 0s
esp32_touch:
setup_mode: false
time:
# This will sync the time if the ESP is connected to the hotspot.
- platform: sntp
id: esptimesntp
on_time_sync:
then:
# ... and update the RTC when the synchronization was successful
ds1307.write_time:
id: esptime
- platform: ds1307
i2c_id: bus_b
update_interval: never
id: esptime
i2c:
# Built-in display
- id: bus_a
sda: 4
scl: 15
scan: false
# Second display
- id: bus_b
sda: 13
scl: 14
scan: false
esp32_ble_tracker:
display:
- platform: ssd1306_i2c #white, second display
i2c_id: bus_b
model: "SSD1306 128x64"
id: white_display
rotation: 180
address: 0x3C
pages:
- id: page11
# Print the Citroen logo on the second screen until the built-in screen boots
lambda: |-
if (id(blue_display).is_on()){
it.strftime(0, 45, id(font1), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
} else {
it.image(32, 0, id(logo));
}
- platform: ssd1306_i2c
i2c_id: bus_a
model: "SSD1306 128x64"
id: blue_display
reset_pin: 16
rotation: 180
# i2c_id: bus_a
address: 0x3C
pages:
- id: page1
lambda: |-
if (id(uptime_human).has_state()){
it.printf(0, 22, id(font4), TextAlign::BASELINE_LEFT, "");
if (id(day_counter) < 59) {
it.printf(20, 22, id(font5), TextAlign::BASELINE_LEFT, "%im", id(day_counter));
} else {
it.printf(20, 22, id(font5), TextAlign::BASELINE_LEFT, "%i:%02dh", id(day_counter)/60, id(day_counter)%60);
}
}
if (id(outside_temp).has_state()){
it.printf(0, 52, id(font4), TextAlign::BASELINE_LEFT, "");
it.printf(22, 52, id(font5), TextAlign::BASELINE_LEFT, "%.0f°", id(outside_temp).state);
}
font:
- file: 'RobotoMono-Regular.ttf'
id: font1
size: 40
glyphs: [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0",
":",
]
# - file: 'RobotoMono-Regular.ttf'
# id: font2
# size: 12
- file: 'Tahoma.ttf'
id: font5
size: 22
glyphs: [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0",
":",
"h",
"m",
" ",
"°"
]
- file: 'MaterialIcons-Regular.ttf'
id: font4
size: 15
glyphs: [
"", # battery
"", # piano
"", #car
"", #wifi_on
"", #no wifi
"", #car-home
"", #temperature
"" # clock
]