Created
May 5, 2023 09:08
-
-
Save baldarn/ea89d08f4c6637381d583b0054c6e8fb to your computer and use it in GitHub Desktop.
display
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: | |
device_name: display-test | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 | |
board: nodemcuv2 | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
domain: !secret wifi_domain | |
ap: | |
ssid: ${device_name} Hotspot | |
password: !secret hotspot_password | |
logger: | |
api: | |
ota: | |
web_server: | |
port: 80 | |
i2c: | |
sda: GPIO4 | |
scl: GPIO5 | |
display: | |
- platform: ssd1306_i2c | |
model: "SSD1306 128x64" | |
address: 0x3C | |
lambda: |- | |
it.strftime(0, 60, id(font1), TextAlign::BASELINE_LEFT, "%H:%M:%S", id(esptime).now()); | |
it.printf(64, 0, id(font1), TextAlign::TOP_CENTER, "OpenDomus"); | |
if (id(test_temp).has_state()) { | |
it.printf(0, 32, id(font1), TextAlign::CENTER_LEFT, "%.1f°", id(test_temp).state); | |
} | |
if (id(test_humidity).has_state()) { | |
it.printf(128, 32, id(font1), TextAlign::CENTER_RIGHT, "%.0f Hum", id(test_humidity).state); | |
} | |
if (id(power).has_state()) { | |
it.printf(128, 60, id(font1), TextAlign::BASELINE_RIGHT, "%.0fW", id(power).state); | |
} | |
time: | |
- platform: homeassistant | |
timezone: Europe/Rome | |
id: esptime | |
sensor: | |
- platform: homeassistant | |
id: power | |
entity_id: sensor.house_power | |
internal: true | |
- platform: homeassistant | |
id: temperature | |
entity_id: sensor.processor_temperature | |
internal: true | |
- platform: dht | |
model: DHT11 | |
pin: D4 | |
temperature: | |
id: test_temp | |
name: "test Temperature" | |
humidity: | |
id: test_humidity | |
name: "test Humidity" | |
update_interval: 5s | |
font: | |
- file: 'arial.ttf' | |
id: font1 | |
size: 14 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment