Advertisement
ptr727

bang_bang

Oct 3rd, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.54 KB | None | 0 0
  1. # https://esphome.io/devices/sonoff.html#sonoff-th10-th16
  2. # https://templates.blakadder.com/sonoff_TH.html
  3.  
  4. # Button: GPIO0, Inverted
  5. # Relay, Red LED: GPIO12
  6. # Blue LED: GPIO13, Inverted
  7. # UART Tx : GPIO1
  8. # UART Rx : GPIO3
  9. # Sensor 1 : GPIO4
  10. # Sensor 2 : GPIO14
  11. # EXP-LOG : GPIO2
  12.  
  13.  
  14. # https://esphome.io/guides/configuration-types.html#substitutions
  15. substitutions:
  16.   device_name: sonoff_th10_hot_recirc_pump
  17.   device_comment: "Hot Water Recirculation Pump Controller"
  18.  
  19.  
  20. # https://esphome.io/components/esphome.html  
  21. esphome:
  22.   name: ${device_name}
  23.   comment: ${device_comment}
  24.   platform: ESP8266
  25.   board: esp8285
  26.   # arduino_version: 2.4.2
  27.  
  28.  
  29. # https://esphome.io/guides/configuration-types.html#packages
  30. packages:
  31.   common: !include templates/common.yaml
  32.   status_sensor: !include templates/status_sensor.yaml
  33.   version_sensor: !include templates/version_sensor.yaml
  34.   wifi_sensor: !include templates/wifi_sensor.yaml
  35.   uptime_sensor: !include templates/uptime_sensor.yaml
  36.   restart_switch: !include templates/restart_switch.yaml
  37.   web_server: !include templates/web_server.yaml
  38.  
  39.  
  40. # https://esphome.io/components/binary_sensor/index.html
  41. binary_sensor:
  42.   # https://esphome.io/components/binary_sensor/gpio.html
  43.   - platform: gpio
  44.     name: ${device_name}_button
  45.     device_class: power
  46.     pin:
  47.       number: GPIO0
  48.       inverted: true
  49.     on_press:
  50.       - switch.toggle: relay
  51.  
  52.      
  53. # https://esphome.io/components/switch/index.html
  54. switch:
  55.   # https://esphome.io/components/switch/gpio.html
  56.   - platform: gpio
  57.     name: ${device_name}_relay
  58.     id: relay
  59.     pin: GPIO12
  60.  
  61.  
  62. # https://esphome.io/components/status_led.html
  63. status_led:
  64.   pin:
  65.     number: GPIO13
  66.  
  67.  
  68. # https://esphome.io/components/sensor/dallas.html    
  69. dallas:
  70.   - pin: GPIO14
  71.     update_interval: 5s
  72.    
  73.  
  74. # https://esphome.io/components/sensor/index.html    
  75. sensor:
  76.   # https://esphome.io/components/sensor/dallas.html
  77.   - platform: dallas
  78.     address: 0xD20301A27931AC28
  79.     name: ${device_name}_recirc_temp
  80.     id: recirc_temp
  81.  
  82.  
  83. # https://esphome.io/components/climate/index.html
  84. climate:
  85.   # https://esphome.io/components/climate/bang_bang.html
  86.   - platform: bang_bang
  87.     name: ${device_name}_bangbang
  88.     sensor: recirc_temp
  89.     default_target_temperature_low: 30 °C
  90.     default_target_temperature_high: 40 °C
  91.     heat_action:
  92.       - switch.turn_on: relay
  93.     idle_action:
  94.       - switch.turn_off: relay
  95.     visual:
  96.       min_temperature: 20 °C
  97.       max_temperature: 50 °C
  98.       temperature_step: 1 °C
  99.  
  100.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement