I have been just trying to get a home assistant sensor to display using a D1 and SSd1306 Oled and cannot figure it out.
It compiles ok but the Oled display just shows time of 1600 and NAN as the temp
esphome:
name: oled-display
esp8266:
board: esp01_1m
time:
- platform: homeassistant
id: time1
timezone: US/Pacific
sensor:
- platform: homeassistant
id: brooder_temp
entity_id: sensor.brooder_temp
internal: true
state_class: measurement
unit_of_measurement: °F
device_class: temperature
i2c:
sda: GPIO4
scl: GPIO5
scan: false
frequency: 800kHz
font:
- file: 'slkscr.ttf'
id: font1
size: 8
- file: 'BebasNeue-Regular.ttf'
id: font2
size: 48
- file: 'arial.ttf'
id: font3
size: 14
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: 0
address: 0x3C
lambda: |-
it.strftime(0, 60, id(font1), TextAlign::BASELINE_LEFT, "%H:%M", id(time1).now());
it.printf(127, 23, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(brooder_temp).state);
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Oled-Display Fallback Hotspot"
password: "Uh5u3gHMo5yy"
captive_portal: