Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- web_server:
- port: '80'
- ota:
- time:
- - platform: homeassistant
- id: time12
- sensor:
- - platform: dht
- pin: D6
- model: DHT22
- temperature:
- name: "hall temperature"
- accuracy_decimals: 2
- humidity:
- name: "hall Humidity"
- update_interval: 120s
- - platform: homeassistant
- id: hall_temperature
- entity_id: sensor.hall_temperature
- accuracy_decimals: 2
- internal: true
- - platform: homeassistant
- id: heating
- entity_id: switch.heating
- text_sensor:
- - platform: homeassistant
- id: sensor_heating
- entity_id: sensor.heater
- internal: true
- binary_sensor:
- - platform: gpio
- pin: D5
- name: "heater pir"
- device_class: motion
- switch:
- - platform: gpio
- name: "heating"
- pin: D7
- id: relay
- font:
- - file: 'slkscr.ttf'
- id: font1
- size: 20
- - file: 'bebas-neue-regular.ttf'
- id: font2
- size: 48
- - file: 'arial.ttf'
- id: font3
- size: 20
- i2c:
- sda: D1
- scl: D2
- display:
- - platform: ssd1306_i2c
- model: "SSD1306 128x64"
- reset_pin: D0
- address: 0x3C
- lambda: |-
- // Print "Osborne" in top center.
- it.printf(74, 0, id(font1), TextAlign::TOP_CENTER, "Osborne");
- // Print time in HH:MM format
- it.strftime(0, 60, id(font2), TextAlign::BASELINE_LEFT, "%H:%M", id(time12).now());
- // Print hall temperature (from homeassistant sensor)
- if (id(hall_temperature).has_state()) {
- it.printf(127, 23, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(hall_temperature).state);
- { // Print "Alarm State: <state>" in top center
- it.printf(127, 60, id(font3), TextAlign::BASELINE_RIGHT, "%s", id(sensor_heating).state.c_str());}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement