SHARE
TWEET

espdisplay.relay.pir.dht

a guest Dec 6th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Enable logging
  2. logger:
  3.  
  4. # Enable Home Assistant API
  5. api:
  6.  
  7. web_server:
  8.   port: '80'
  9. ota:
  10.  
  11. time:
  12.   - platform: homeassistant
  13.     id: time12
  14.  
  15. sensor:
  16.   - platform: dht
  17.     pin: D6
  18.     model: DHT22
  19.     temperature:
  20.       name: "hall temperature"
  21.       accuracy_decimals: 2
  22.     humidity:
  23.       name: "hall  Humidity"
  24.     update_interval: 120s
  25.  
  26.   - platform: homeassistant
  27.     id: hall_temperature
  28.     entity_id: sensor.hall_temperature
  29.     accuracy_decimals: 2
  30.     internal: true
  31.    
  32.   - platform: homeassistant
  33.     id: heating
  34.     entity_id: switch.heating
  35.    
  36. text_sensor:
  37.   - platform: homeassistant
  38.     id: sensor_heating
  39.     entity_id: sensor.heater
  40.     internal: true
  41.    
  42. binary_sensor:
  43.   - platform: gpio
  44.     pin: D5
  45.     name: "heater pir"
  46.     device_class: motion
  47.    
  48. switch:
  49.   - platform: gpio
  50.     name: "heating"
  51.     pin: D7
  52.     id: relay
  53.    
  54. font:
  55.   - file: 'slkscr.ttf'
  56.     id: font1
  57.     size: 20
  58.  
  59.   - file: 'bebas-neue-regular.ttf'
  60.     id: font2
  61.     size: 48
  62.  
  63.   - file: 'arial.ttf'
  64.     id: font3
  65.     size: 20
  66.    
  67. i2c:
  68.   sda: D1
  69.   scl: D2
  70.  
  71. display:
  72.   - platform: ssd1306_i2c
  73.     model: "SSD1306 128x64"
  74.     reset_pin: D0
  75.     address: 0x3C
  76.     lambda: |-
  77.       // Print "Osborne" in top center.
  78.       it.printf(74, 0, id(font1), TextAlign::TOP_CENTER, "Osborne");
  79.  
  80.       // Print time in HH:MM format
  81.       it.strftime(0, 60, id(font2), TextAlign::BASELINE_LEFT, "%H:%M", id(time12).now());
  82.  
  83.       // Print hall temperature (from homeassistant sensor)
  84.       if (id(hall_temperature).has_state()) {
  85.         it.printf(127, 23, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(hall_temperature).state);
  86.       { // Print "Alarm State: <state>" in top center
  87.       it.printf(127, 60, id(font3), TextAlign::BASELINE_RIGHT, "%s", id(sensor_heating).state.c_str());}
  88.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top