I need some help with a small project. I am trying to safe battery power. Am running a display that shows different tempartures for today and the next hours/week. It pulls the information from an MQTT broker, which gets its information from HA. HA is actually not involved at all.
The display is refreshed only once per hour after which it goes into deep-sleep. From other sources I read that this should last for months. I only seem to be able to get the battery last for 4 days max.
See the graph:
The hardware:
Board: HUZZAH Featherboard ESP-wroom-32ESP
Battery:waveshare 3700mAh 3,7v
Screen: Waveshare e-paper 7.5 inch v2
This is the script. Is there anyone that can take a look at this what I am doing wrong why the battery is drained so quickly.
esphome:
name: temperature
platform: ESP32
board: featheresp32
on_boot:
priority: -100
then:
- wait_until:
mqtt.connected:
# Wait for some valid temp data
- wait_until:
sensor.in_range:
id: temptoday
above: -460
- delay: 1s
- component.update: sntp_time
- component.update: voltage
# Give some time to get the rest of the mqtt data
- component.update: epaper_display
# Wait for display update cycle
- delay: 6s
# Go back to sleep once display has updated
# - deep_sleep.enter: deep_sleep_1
- if:
condition:
binary_sensor.is_on: ota_mode
then:
- deep_sleep.prevent: deep_sleep_1
else:
- deep_sleep.enter: deep_sleep_1
logger:
level: DEBUG
# api:
# encryption:
# key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ota:
password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
mqtt:
broker: 192.168.10.2
username: !secret mqtt_login
password: !secret mqtt_password
binary_sensor:
- platform: template
id: ota_mode
internal: True
on_state:
if:
condition:
binary_sensor.is_on: ota_mode
then:
- deep_sleep.prevent: deep_sleep_1
- platform: template
id: sleep_mode
internal: True
on_state:
if:
condition:
binary_sensor.is_off: ota_mode
then:
- deep_sleep.enter: deep_sleep_1
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.10.14
gateway: 192.168.10.1
subnet: 255.255.255.0
dns1: 192.168.10.1
fast_connect: True
power_save_mode: HIGH
deep_sleep:
run_duration: 60s
sleep_duration: 60min
id: deep_sleep_1
font:
- file: "fonts/AcuminPro-Medium.ttf"
id: tm12
size: 10
- file: "fonts/AcuminPro-Medium.ttf"
id: tm24
size: 22
- file: "fonts/AcuminPro-Medium.ttf"
id: tm60
size: 50
glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', '-']
- file: "fonts/AcuminPro-Medium.ttf"
id: tm90
size: 80
glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', '-']
- file: "fonts/AcuminPro-Light.ttf"
id: tl24
size: 22
glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', 'm', 'i', 'n', 'a', 'x', ':', '/', '%', 'r', '-']
- file: "fonts/AcuminPro-Light.ttf"
id: tl60
size: 50
glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', '-']
- file: 'fonts/materialdesignicons-webfont.ttf'
id: im90
size: 80
glyphs: &mdi-weather-glyphs
- "\U000F0590" # mdi-weather-cloudy
- "\U000F0F2F" # mdi-weather-cloudy-alert
- "\U000F0E6E" # mdi-weather-cloudy-arrow-right
- "\U000F0591" # mdi-weather-fog
- "\U000F0592" # mdi-weather-hail
- "\U000F0F30" # mdi-weather-hazy
- "\U000F0898" # mdi-weather-hurricane
- "\U000F0593" # mdi-weather-lightning
- "\U000F067E" # mdi-weather-lightning-rainy
- "\U000F0594" # mdi-weather-night
- "\U000F0F31" # mdi-weather-night-partly-cloudy
- "\U000F0595" # mdi-weather-partly-cloudy
- "\U000F0F32" # mdi-weather-partly-lightning
- "\U000F0F33" # mdi-weather-partly-rainy
- "\U000F0F34" # mdi-weather-partly-snowy
- "\U000F0F35" # mdi-weather-partly-snowy-rainy
- "\U000F0596" # mdi-weather-pouring
- "\U000F0597" # mdi-weather-rainy
- "\U000F0598" # mdi-weather-snowy
- "\U000F0F36" # mdi-weather-snowy-heavy
- "\U000F067F" # mdi-weather-snowy-rainy
- "\U000F0599" # mdi-weather-sunny
- "\U000F0F37" # mdi-weather-sunny-alert
- "\U000F14E4" # mdi-weather-sunny-off
- "\U000F059A" # mdi-weather-sunset
- "\U000F059B" # mdi-weather-sunset-down
- "\U000F059C" # mdi-weather-sunset-up
- "\U000F0F38" # mdi-weather-tornado
- "\U000F059D" # mdi-weather-windy
- "\U000F059E" # mdi-weather-windy-variant
- "\U000F10C2" # mdi-thermometer-high
- "\U000F10C3" # mdi-thermometer-low
- "\U000F0E01" # mdi-thermometer-alert
- "\U000F054B" # mdi-umbrella-outline
- "\U000F0F29" # mdi-snowflake-alert
- "\U000F12A3" # mdi-battery-high
- "\U000F12A2" # mdi-battery-medium
- "\U000F12A1" # mdi-battery-low
- file: 'fonts/materialdesignicons-webfont.ttf'
id: im24
size: 22
glyphs: *mdi-weather-glyphs
- file: 'fonts/materialdesignicons-webfont.ttf'
id: im20
size: 18
glyphs: *mdi-weather-glyphs
- file: 'fonts/materialdesignicons-webfont.ttf'
id: im40
size: 30
glyphs: *mdi-weather-glyphs
color:
- id: color_white
red: 0%
green: 0%
blue: 0%
white: 0%
time:
- platform: sntp
id: sntp_time
text_sensor:
- platform: mqtt_subscribe
id: ota_mode_payload
internal: True
topic: homeassistant/prevent_deep_sleep_temp_sign
on_value:
then:
- binary_sensor.template.publish:
id: ota_mode
state: !lambda 'return id(ota_mode_payload).state == "on";'
- platform: mqtt_subscribe
id: desctoday
topic: homeassistant/sensor/weathertoday/state
- platform: mqtt_subscribe
id: monttoday
topic: homeassistant/sensor/weathertoday/month
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icontoday
topic: homeassistant/sensor/weathertoday/icon
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hrtime1
topic: homeassistant/sensor/weathertodayhourly/hour1
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hricon1
topic: homeassistant/sensor/weathertodayhourly/icon1
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hrtime2
topic: homeassistant/sensor/weathertodayhourly/hour2
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hricon2
topic: homeassistant/sensor/weathertodayhourly/icon2
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hrtime3
topic: homeassistant/sensor/weathertodayhourly/hour3
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hricon3
topic: homeassistant/sensor/weathertodayhourly/icon3
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hrtime4
topic: homeassistant/sensor/weathertodayhourly/hour4
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: hricon4
topic: homeassistant/sensor/weathertodayhourly/icon4
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: daytom
topic: homeassistant/sensor/weathertomorrow/day
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: monttom
topic: homeassistant/sensor/weathertomorrow/month
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icontom
topic: homeassistant/sensor/weathertomorrow/icon
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: day1days
topic: homeassistant/sensor/weatherdays/day1
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icon1days
topic: homeassistant/sensor/weatherdays/icon1
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: day2days
topic: homeassistant/sensor/weatherdays/day2
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icon2days
topic: homeassistant/sensor/weatherdays/icon2
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: day3days
topic: homeassistant/sensor/weatherdays/day3
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icon3days
topic: homeassistant/sensor/weatherdays/icon3
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: day4days
topic: homeassistant/sensor/weatherdays/day4
internal: True
filters:
- substitute:
- "\" -> "
- platform: mqtt_subscribe
id: icon4days
topic: homeassistant/sensor/weatherdays/icon4
internal: True
filters:
- substitute:
- "\" -> "
sensor:
- platform: adc
pin: A13
name: "ESP32 Battery Voltage"
id: voltage
attenuation: 11db
filters:
- multiply: 2
- platform: mqtt_subscribe
id: datetoday
internal: True
topic: homeassistant/sensor/weathertoday/date
- platform: mqtt_subscribe
id: temptoday
internal: True
topic: homeassistant/sensor/weathertoday/temperature
- platform: mqtt_subscribe
id: lowttoday
internal: True
topic: homeassistant/sensor/weathertoday/lowtemp
- platform: mqtt_subscribe
id: hightoday
internal: True
topic: homeassistant/sensor/weathertoday/hightemp
- platform: mqtt_subscribe
id: perctoday
internal: True
topic: homeassistant/sensor/weathertoday/percipitation
- platform: mqtt_subscribe
id: hrtemp1
internal: True
topic: homeassistant/sensor/weathertodayhourly/temp1
- platform: mqtt_subscribe
id: hrrain1
internal: True
topic: homeassistant/sensor/weathertodayhourly/rain1
- platform: mqtt_subscribe
id: hrtemp2
internal: True
topic: homeassistant/sensor/weathertodayhourly/temp2
- platform: mqtt_subscribe
id: hrrain2
internal: True
topic: homeassistant/sensor/weathertodayhourly/rain2
- platform: mqtt_subscribe
id: hrtemp3
internal: True
topic: homeassistant/sensor/weathertodayhourly/temp3
- platform: mqtt_subscribe
id: hrrain3
internal: True
topic: homeassistant/sensor/weathertodayhourly/rain3
- platform: mqtt_subscribe
id: hrtemp4
internal: True
topic: homeassistant/sensor/weathertodayhourly/temp4
- platform: mqtt_subscribe
id: hrrain4
internal: True
topic: homeassistant/sensor/weathertodayhourly/rain4
- platform: mqtt_subscribe
id: hightom
internal: True
topic: homeassistant/sensor/weathertomorrow/state
- platform: mqtt_subscribe
id: datetom
internal: True
topic: homeassistant/sensor/weathertomorrow/date
- platform: mqtt_subscribe
id: lowtom
internal: True
topic: homeassistant/sensor/weathertomorrow/lowtemp
- platform: mqtt_subscribe
id: perctom
internal: True
topic: homeassistant/sensor/weathertomorrow/percipitation
- platform: mqtt_subscribe
id: high1days
internal: True
topic: homeassistant/sensor/weatherdays/hightemp1
- platform: mqtt_subscribe
id: low1days
internal: True
topic: homeassistant/sensor/weatherdays/lowtemp1
- platform: mqtt_subscribe
id: rain1days
internal: True
topic: homeassistant/sensor/weatherdays/rain1
- platform: mqtt_subscribe
id: high2days
internal: True
topic: homeassistant/sensor/weatherdays/hightemp2
- platform: mqtt_subscribe
id: low2days
internal: True
topic: homeassistant/sensor/weatherdays/lowtemp2
- platform: mqtt_subscribe
id: rain2days
internal: True
topic: homeassistant/sensor/weatherdays/rain2
- platform: mqtt_subscribe
id: high3days
internal: True
topic: homeassistant/sensor/weatherdays/hightemp3
- platform: mqtt_subscribe
id: low3days
internal: True
topic: homeassistant/sensor/weatherdays/lowtemp3
- platform: mqtt_subscribe
id: rain3days
internal: True
topic: homeassistant/sensor/weatherdays/rain3
- platform: mqtt_subscribe
id: high4days
internal: True
topic: homeassistant/sensor/weatherdays/hightemp4
- platform: mqtt_subscribe
id: low4days
internal: True
topic: homeassistant/sensor/weatherdays/lowtemp4
- platform: mqtt_subscribe
id: rain4days
internal: True
topic: homeassistant/sensor/weatherdays/rain4
spi:
clk_pin: 5
mosi_pin: 18
display:
- platform: waveshare_epaper
id: epaper_display
cs_pin: 22
dc_pin: 23
busy_pin: 32
reset_pin: 21
model: 7.50inV2
update_interval: never
reset_duration: 2ms
rotation: 270°
lambda: |-
it.filled_rectangle(0, 395, 480, 2);
it.filled_rectangle(118, 240, 2, 98);
it.filled_rectangle(236, 240, 2, 98);
it.filled_rectangle(354, 240, 2, 98);
it.filled_rectangle(118, 600, 2, 125);
it.filled_rectangle(236, 600, 2, 125);
it.filled_rectangle(354, 600, 2, 125);
// Map weather states to MDI characters.
std::map<std::string, std::string> weather_icon_map
{
{"cloudy", "\U000F0590"},
{"cloudy-alert", "\U000F0F2F"},
{"cloudy-arrow-right", "\U000F0E6E"},
{"fog", "\U000F0591"},
{"hail", "\U000F0592"},
{"hazy", "\U000F0F30"},
{"hurricane", "\U000F0898"},
{"lightning", "\U000F0593"},
{"lightning-rainy", "\U000F067E"},
{"night", "\U000F0594"},
{"clear-night", "\U000F0594"},
{"night-partly-cloudy", "\U000F0F31"},
{"partlycloudy", "\U000F0595"},
{"partly-lightning", "\U000F0F32"},
{"partly-rainy", "\U000F0F33"},
{"partly-snowy", "\U000F0F34"},
{"partly-snowy-rainy", "\U000F0F35"},
{"pouring", "\U000F0596"},
{"rainy", "\U000F0597"},
{"snowy", "\U000F0598"},
{"snowy-heavy", "\U000F0F36"},
{"snowy-rainy", "\U000F067F"},
{"sunny", "\U000F0599"},
{"sunny-alert", "\U000F0F37"},
{"sunny-off", "\U000F14E4"},
{"sunset", "\U000F059A"},
{"sunset-down", "\U000F059B"},
{"sunset-up", "\U000F059C"},
{"tornado", "\U000F0F38"},
{"windy", "\U000F059D"},
{"windy-variant", "\U000F059E"},
{"low-temperature", "\U000F10C3"},
{"high-temperature", "\U000F10C2"},
{"alert-temperature", "\U000F0E01"},
{"umbrella", "\U000F054B"},
{"alert-low-temperature", "\U000F0F29"},
};
// Today Date Section
it.print(85.5, 25, id(tm24), TextAlign::TOP_CENTER, "TODAY");
it.printf(85.5, 90, id(tm90), TextAlign::CENTER, "%.0f", id(datetoday).state);
it.printf(85.5, 120, id(tm24), TextAlign::TOP_CENTER, "%s", id(monttoday).state.c_str());
// Today Temperature & Description
it.printf(260, 90, id(im90), TextAlign::CENTER_RIGHT, weather_icon_map[id(icontoday).state.c_str()].c_str());
it.printf(260, 90, id(tm90), TextAlign::CENTER_LEFT, "%.1f°", id(temptoday).state);
it.printf(295, 135, id(tm24), TextAlign::TOP_CENTER, "%s", id(desctoday).state.c_str());
// Today Rain
it.printf(210.50, 170, id(tm24), TextAlign::TOP_RIGHT, "%.0f%%", id(perctoday).state);
it.print(210.50, 168, id(im24), TextAlign::TOP_LEFT, "\U000F054B");
// Today Low Temperature
it.printf(295, 170, id(tl24), TextAlign::TOP_RIGHT, "%.1f°", id(lowttoday).state);
if(id(lowttoday).state < -5 ) {
it.print(295, 168, id(im24), TextAlign::TOP_LEFT, "\U000F0F29");
} else {
it.print(295, 168, id(im24), TextAlign::TOP_LEFT, "\U000F10C3");
}
// Today High Temperature
it.printf(379.50, 170, id(tm24), TextAlign::TOP_RIGHT, "%.1f°", id(hightoday).state);
if(id(hightoday).state > 34) {
it.print(379.50, 168, id(im24), TextAlign::TOP_LEFT, "\U000F0E01");
} else {
it.print(379.50, 168, id(im24), TextAlign::TOP_LEFT, "\U000F10C2");
}
// Today hour 1
it.printf(59, 250, id(tm24), TextAlign::TOP_CENTER, "%s", id(hrtime1).state.c_str());
it.printf(49, 275, id(im40), TextAlign::TOP_RIGHT, weather_icon_map[id(hricon1).state.c_str()].c_str());
it.printf(49, 295, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp1).state);
it.print(46, 315, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(46, 328, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain1).state);
// Today hour 2
it.printf(177, 250, id(tm24), TextAlign::TOP_CENTER, "%s", id(hrtime2).state.c_str());
it.printf(167, 275, id(im40), TextAlign::TOP_RIGHT, weather_icon_map[id(hricon2).state.c_str()].c_str());
it.printf(167, 295, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp2).state);
it.print(164, 315, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(164, 328, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain2).state);
// Today hour 3
it.printf(295, 250, id(tm24), TextAlign::TOP_CENTER, "%s", id(hrtime3).state.c_str());
it.printf(285, 275, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(hricon3).state.c_str()].c_str());
it.printf(285, 295, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp3).state);
it.print(286, 315, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(286, 328, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain3).state);
// Today hour 4
it.printf(413, 250, id(tm24), TextAlign::TOP_CENTER, "%s", id(hrtime4).state.c_str());
it.printf(403, 275, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(hricon4).state.c_str()].c_str());
it.printf(403, 295, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp4).state);
it.print(404, 315, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(404, 328, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain4).state);
// Tomorrow Date Section
it.printf(85.5, 420, id(tm24), TextAlign::TOP_CENTER, "%s", id(daytom).state.c_str());
it.printf(85.5, 485, id(tm90), TextAlign::CENTER, "%.0f", id(datetom).state);
it.printf(85.5, 515, id(tm24), TextAlign::TOP_CENTER, "%s", id(monttom).state.c_str());
// Tomorrow Temperature & Rain
it.printf(280, 485, id(im90), TextAlign::CENTER_RIGHT, weather_icon_map[id(icontom).state.c_str()].c_str());
it.printf(280, 485, id(tm60), TextAlign::BOTTOM_LEFT, "%.1f°", id(hightom).state);
it.printf(290, 485, id(tl60), TextAlign::TOP_LEFT, "%.1f°", id(lowtom).state);
it.printf(295, 540, id(tm24), TextAlign::TOP_RIGHT, "%.0f%%", id(perctom).state);
it.print(295, 540, id(im24), TextAlign::TOP_LEFT, "\U000F054B");
// Forecast Day 2
it.printf(59, 610, id(tm24), TextAlign::TOP_CENTER, "%s.", id(day1days).state.c_str());
it.printf(54, 640, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(icon1days).state.c_str()].c_str());
it.printf(54, 650, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(high1days).state);
it.printf(54, 675, id(tl24), TextAlign::CENTER_LEFT, "%.1f°", id(low1days).state);
it.print(44, 695, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(44, 708, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain1days).state);
// Forecast Day 3
it.printf(177, 610, id(tm24), TextAlign::TOP_CENTER, "%s.", id(day2days).state.c_str());
it.printf(172, 640, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(icon2days).state.c_str()].c_str());
it.printf(172, 650, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(high2days).state);
it.printf(172, 675, id(tl24), TextAlign::CENTER_LEFT, "%.1f°", id(low2days).state);
it.print(162, 695, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(162, 708, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain2days).state);
// Forecast Day 4
it.printf(295, 610, id(tm24), TextAlign::TOP_CENTER, "%s.", id(day3days).state.c_str());
it.printf(290, 640, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(icon3days).state.c_str()].c_str());
it.printf(290, 650, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(high3days).state);
it.printf(290, 675, id(tl24), TextAlign::CENTER_LEFT, "%.1f°", id(low3days).state);
it.print(285, 695, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(285, 708, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain3days).state);
// Forecast Day 5
it.printf(413, 610, id(tm24), TextAlign::TOP_CENTER, "%s.", id(day4days).state.c_str());
it.printf(403, 640, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(icon4days).state.c_str()].c_str());
it.printf(403, 650, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(high4days).state);
it.printf(403, 675, id(tl24), TextAlign::CENTER_LEFT, "%.1f°", id(low4days).state);
it.print(398, 695, id(im20), TextAlign::TOP_RIGHT, "\U000F054B");
it.printf(398, 708, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain4days).state);
// Battery Status
//float volt = (id(voltage).state - 3.02) * 100;
//if(volt > 60) {
// it.printf(10, 785, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A3");
//} else if (volt > 30) {
// it.printf(10, 785, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A2");
//} else {
// it.printf(10, 785, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A1");
//}
//it.printf(30, 780, id(tm12), TextAlign::BOTTOM_LEFT, "%.0f%%", volt);
if(id(ota_mode).state) {
it.filled_rectangle (0, 765, 520, 30);
it.print(255, 787, id(tm12), color_white, TextAlign::BOTTOM_CENTER, "OTA MODE ON");
// Battery Status
float volt = (id(voltage).state - 2.93) * 100;
if(volt > 60) {
it.printf(10, 787, id(im20), color_white,TextAlign::BOTTOM_LEFT, "\U000F12A3");
} else if (volt > 30) {
it.printf(10, 787, id(im20), color_white, TextAlign::BOTTOM_LEFT, "\U000F12A2");
} else {
it.printf(10, 787, id(im20), color_white,TextAlign::BOTTOM_LEFT, "\U000F12A1");
}
it.printf(30, 785, id(tm12), color_white, TextAlign::BOTTOM_LEFT, "%.0f%%", volt);
it.strftime(455, 785, id(tm12), color_white, TextAlign::BOTTOM_RIGHT, "Last updated: %H:%M", id(sntp_time).now());
} else {
// Battery Status
float volt = (id(voltage).state - 2.93) * 100;
if(volt > 60) {
it.printf(10, 787, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A3");
} else if (volt > 30) {
it.printf(10, 787, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A2");
} else {
it.printf(10, 787, id(im20), TextAlign::BOTTOM_LEFT, "\U000F12A1");
}
it.printf(30, 785, id(tm12), TextAlign::BOTTOM_LEFT, "%.0f%%", volt);
it.strftime(455, 785, id(tm12), TextAlign::BOTTOM_RIGHT, "Last updated: %H:%M", id(sntp_time).now());
}
// Last Update Section
// it.strftime(455, 785, id(tm12), TextAlign::BOTTOM_RIGHT, "last updated: %H:%M", id(sntp_time).now());
I have a second display showing the same issues. Help would be greatly appreciated.