only waste your time on this topic if your feeling generous
im barely getting by with my understanding of home assistants inner workings.
the following code shows the string “smart display” and the time… but i cant get anything else to show up … i think im balsing up the printf parameters… can someoneeoint out the probably obvious mistake i have made??
esphome:
name: wemos18650oled
esp8266:
board: d1_mini
# Enable logging
logger:
# level: VERY_VERBOSE
# Enable Home Assistant API
api:
ota:
password: "5f0f41c4b9c3819005ac35e955ab7e51"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
# manual_ip:
# static_ip: 192.168.1.109
# gateway: 192.168.1.1
# subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Wemos18650Oled Fallback Hotspot"
password: "RTJeDqGOH0Nj"
captive_portal:
sensor:
- platform: wifi_signal
name: "wemos18650oled ssi"
update_interval: 60s
- platform: adc
pin: A0
name: battery
update_interval: 5s
- platform: homeassistant
id: elec_usage
entity_id: sensor.electricity_usage_2
internal: false
- platform: homeassistant
id: elec_cost
entity_id: sensor.dollarstodaydig
internal: false
time:
- platform: homeassistant
id: esptime
text_sensor:
- platform: wifi_info
ip_address:
name: wemos18650oled IP Address
ssid:
name: wemos18650oled Connected SSID
bssid:
name: wemos18650oled Connected BSSID
mac_address:
name: wemos18650oled Mac Wifi Address
scan_results:
name: wemos18650oled Latest Scan Results
switch:
- platform: gpio
name: "wemos18650oled Devboard Led"
inverted: true
pin: 16
- platform: gpio
name: "wemos18650oled espchip Led"
inverted: true
pin: 2
i2c:
sda: D1
scl: D2
font:
- file: "arial.ttf"
id: my_font
size: 10
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
# reset_pin: D0
address: 0x3C
lambda: |-
it.printf(64, 0, id(my_font), TextAlign::TOP_CENTER, "Smart Display");
it.strftime(0, 21, id(my_font), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
if (id(elec_usage).has_state()) {
it.printf(0, 32, id(my_font), TextAlign::TOP_RIGHT ,"power usage%f", id(elec_usage).state);
}
if (id(elec_cost).has_state()) {
it.printf(0, 43, id(my_font), TextAlign::BASELINE_RIGHT ,"power cost%f", id(elec_cost).state);
}