Created
June 1, 2022 15:23
-
-
Save crossan007/2897419290fb0de779b0a773464f64ab to your computer and use it in GitHub Desktop.
oreo_watch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substitutions: | |
devicename: clock | |
upper_devicename: clock | |
time: | |
- platform: homeassistant | |
id: esptime | |
sensor: | |
- platform: homeassistant | |
id: inside_temperature | |
entity_id: sensor.charles_office_temperature | |
internal: true | |
- platform: homeassistant | |
id: outside_temperature | |
entity_id: sensor.kukt_temperature | |
internal: true | |
# Example configuration entry | |
i2c: | |
sda: 22 | |
scl: 21 | |
display: | |
- platform: ssd1306_i2c | |
model: "SSD1306 128x64" | |
address: 0x3c | |
lambda: |- | |
// Print "Mitt Smarta Hus" in top center. | |
it.printf(64, 0, id(font1), TextAlign::TOP_CENTER, "Oreo Watch"); | |
// Print time in HH:MM format | |
it.strftime(0, 60, id(font2), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now()); | |
// Print inside temperature (from homeassistant sensor) | |
if (id(inside_temperature).has_state()) { | |
it.printf(127, 23, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(inside_temperature).state); | |
} | |
// Print outside temperature (from homeassistant sensor) | |
if (id(outside_temperature).has_state()) { | |
it.printf(127, 60, id(font3), TextAlign::BASELINE_RIGHT , "%.1f°", id(outside_temperature).state); | |
} | |
font: | |
- file: 'C:\Users\Charles\Documents\GitHub\ESPHome Configurations\times.ttf' | |
id: font1 | |
size: 10 | |
- file: 'C:\Users\Charles\Documents\GitHub\ESPHome Configurations\times.ttf' | |
id: font2 | |
size: 40 | |
- file: 'C:\Users\Charles\Documents\GitHub\ESPHome Configurations\times.ttf' | |
id: font3 | |
size: 14 | |
<<: !include base_charles.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment