Oh I’m sorry, it’s a bit of a mess I didn’t want to bother you with. Didn’t think the other parts would be relevant
This is the entire yaml:
esphome:
name: tdisplay-s3-amoled-temp
friendly_name: tdisplay-s3-amoled-temp
platformio_options:
build_unflags: -Werror=all
board_build.flash_mode: dio
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf
external_components:
source: github://clydebarrow/esphome@amoled
components: [ qspi_amoled ]
refresh: 10min
spi:
id: quad_spi
clk_pin: 47
data_pins:
- ignore_strapping_warning: false
number: 18
- 7
- 48
- 5
psram:
mode: octal
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: !secret api_secret
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "AP ${node_name}"
password: !secret wifi_ap_password
font:
- file: "fonts/Oswald-Light.ttf"
id: font_oswald_120
size: 96
- file: "fonts/Oswald-Light.ttf"
id: font_oswald_70
size: 70
- file: "fonts/Oswald-Light.ttf"
id: font_oswald_30
size: 30
- file: 'fonts/slkscr.ttf'
id: font_slkscr_8
size: 8
glyphs: "!%()+,-/_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
- file: 'fonts/slkscr.ttf'
id: font_slkscr_16
size: 16
glyphs: "!%()+,-/_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
- file: 'fonts/BebasNeue-Regular.ttf'
id: font_bebas_120
size: 120
- file: 'fonts/BebasNeue-Regular.ttf'
id: font_bebas_160
size: 160
- file: 'fonts/arial.ttf'
id: font_arial_16
size: 16
- file: 'fonts/arial.ttf'
id: font_arial_20
size: 20
color:
- id: color_red
red: 1
green: 0
blue: 0
- id: color_green
red: 0
green: 1
blue: 0
- id: color_blue
red: 0
green: 0
blue: 1
- id: color_orange
red: 1
green: 0.6
blue: 0
- id: color_teal_blue
red: 0
green: 0.5
blue: 0.45
- id: color_grey
red: 0.3
green: 0.3
blue: 0.3
- id: color_black
red: 0
green: 0
blue: 0
- id: color_white
red: 1
green: 1
blue: 1
time:
- platform: homeassistant
id: esptime
sensor:
- platform: adc
pin: GPIO04
attenuation: auto
filters:
- multiply: 2
name: VBatt
id: vcc
update_interval: 10s
- platform: template
name: "Battery Percentage"
update_interval: 30s
accuracy_decimals: 2
lambda: |-
return (id(vcc).state - 3.5) / 0.7 * 100.00;
id: battery_percentage
entity_category: diagnostic
unit_of_measurement: '%'
device_class: battery
- platform: homeassistant
id: dsmr_power_production
entity_id: sensor.electricity_meter_power_production
unit_of_measurement: 'W'
filters:
- multiply: 1000
- heartbeat: 5s
- platform: homeassistant
id: dsmr_power_consumption
entity_id: sensor.electricity_meter_power_consumption
unit_of_measurement: 'W'
filters:
- multiply: 1000
- heartbeat: 5s
- platform: homeassistant
id: dsmr_total_power
entity_id: sensor.dsmr_total_sl
unit_of_measurement: 'W'
- platform: homeassistant
id: solar_power
entity_id: sensor.dds238_2_solar_energy_power
unit_of_measurement: 'W'
binary_sensor:
# Button to cycle through pages on the display
- platform: gpio
pin:
number: GPIO21
inverted: true
id: button_1
on_press:
then:
- display.page.show_next: my_display
# - component.update: my_display
graph:
- id: dsmr_power_graph
duration: 30min
x_grid: 5min
y_grid: 500
width: 535
height: 80
border: false
traces:
- sensor: dsmr_power_consumption
line_type: SOLID
line_thickness: 3
color: color_red
- sensor: dsmr_power_production
line_type: SOLID
line_thickness: 2
color: color_green
display:
- platform: qspi_amoled
id: my_display
model: T-DISP-AMOLED
dimensions:
height: 240
width: 536
offset_height: 0
offset_width: 0
transform:
mirror_x: true
mirror_y: false
swap_xy: true
color_order: rgb
invert_colors: false
brightness: 175
cs_pin: 6
reset_pin: 17
enable_pin: 38
pages:
- id: page1
lambda: |-
auto white = Color(255, 255, 255);
auto test = Color(40, 40, 255);
auto purple = Color(102, 0, 204);
it.filled_rectangle(0, 0, 535, 20, test);
it.strftime(268, -2, id(font_arial_20), id(color_white), TextAlign::CENTER_HORIZONTAL, "%c", id(esptime).now());
//if (id(vcc).has_state()) {
//it.printf(4, 0, id(font_arial_16), id(color_teal_blue), "%.2f V (%.2f %%)", id(vcc).state, id(batterylevel).state);
//}
if (id(dsmr_total_power).has_state())
{
float pwr = id(dsmr_total_power).state;
if (pwr > 1000.0)
{
it.printf(268, 0, id(font_bebas_160), id(color_red), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
}
else
{
if (pwr > 750.0)
{
it.printf(268, 0, id(font_bebas_160), id(color_orange), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
}
else
{
if (pwr < 0.0)
{
it.printf(268, 0, id(font_bebas_160), id(color_blue), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
}
else
{
it.printf(268, 0, id(font_bebas_160), id(color_green), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
}
}
}
}
// Draw the graph
it.graph(1, 160, id(dsmr_power_graph), color_teal_blue);
- id: page2
lambda: |-
auto white = Color(255, 255, 255);
auto test = Color(40, 40, 255);
auto purple = Color(102, 0, 204);
it.filled_rectangle(0, 0, 535, 20, test);
it.strftime(268, -2, id(font_arial_20), id(color_white), TextAlign::CENTER_HORIZONTAL, "%c", id(esptime).now());
it.printf(268, 0, id(font_bebas_160), id(color_blue), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(solar_power).state);
// Draw the graph
it.graph(1, 160, id(dsmr_power_graph), color_teal_blue);
ps removed the only calculation I was doing for battery percentage, but issue remains the same. Hope you see what the cause might be. Afaik nothing changed in my yaml compared to the previous working state where I cloned your entire repo as opposed to using the official esphome-dev now.