im log steht :
ist das normal ?
der Code:
Code:
[16:14:33.555][W][component:579]: display took a long time for an operation (246 ms)
[16:14:33.562][W][component:582]: Components should block for at most 30 ms
[16:14:33.796][W][component:579]: logger took a long time for an operation (491 ms)
[16:14:33.798][W][component:582]: Components should block for at most 30 ms
[16:15:32.207][I][safe_mode:071]: Boot seems successful; resetting boot loop counter
ist das normal ?
der Code:
Code:
captive_portal:
i2c:
- id: links
sda: 8
scl: 9
scan: true
# frequency: 100khz
# Geändert auf 5 & 6, um die Strapping-Warnung zu vermeiden
- id: rechts
sda: 10
scl: 11
scan: true
# frequency: 100khz
font:
- file: "gfonts://Roboto"
id: big_font
size: 25
- file: "gfonts://Roboto"
id: small_font
size: 14
- file: "gfonts://Roboto"
id: gros_font
size: 45
sensor:
- platform: homeassistant
id: inverter_power
entity_id: sensor.inverter_eingangsleistung
internal: true
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 1
on_value:
then:
- component.update: display_links
- platform: homeassistant
id: battery_charge
entity_id: sensor.batteries_batterieladung
internal: true
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 1
on_value:
then:
- component.update: display_rechts
display:
- platform: ssd1306_i2c
model: "SH1106 128x64"
id: display_links
i2c_id: links
address: 0x3C
update_interval: 30ms
lambda: |-
if (id(api_client).is_connected() && id(inverter_power).has_state()) {
if (id(inverter_power).state >= 10.0) {
float kw_val = id(inverter_power).state / 1000.0;
it.printf(64, 32, id(big_font), TextAlign::CENTER, "%.3f kW", kw_val);
} else {
// PING-PONG SCROLLING (Exakt auf 35px Textbreite optimiert)
static int x_pos = 64;
static int direction = 2;
x_pos += direction;
// Umkehrpunkte: Textmitte bei 18 (ganz links) und 110 (ganz rechts)
if (x_pos >= 80 || x_pos <= 48) {
direction *= -1;
}
it.print(x_pos, 32, id(big_font), TextAlign::CENTER, "0,000kW");
}
} else {
it.fill(COLOR_OFF);
}
- platform: ssd1306_i2c
model: "SH1106 128x64"
id: display_rechts
i2c_id: rechts
address: 0x3C
update_interval: 30ms
lambda: |-
if (id(api_client).is_connected() && id(battery_charge).has_state()) {
float charge = id(battery_charge).state;
// Logik für LEER (<= 20%) und VOLL (>= 100%)
if (charge <= 20.0 || charge >= 100.0) {
static int x_pos_r = 64;
static int dir_r = 2;
x_pos_r += dir_r;
// Wendepunkte für "LEER" / "VOLL" (ca. 35-45px breit)
if (x_pos_r >= 90 || x_pos_r <= 38) dir_r *= -1;
const char* text = (charge >= 100.0) ? "VOLL" : "LEER";
it.print(x_pos_r, 32, id(big_font), TextAlign::CENTER, text);
} else {
// Normalanzeige der Prozentzahl (statisch mittig)
it.printf(64, 32, id(gros_font), TextAlign::CENTER, "%.0f%%", charge);
}
} else {
it.fill(COLOR_OFF);
}