Advertisement
boelle11

Untitled

Mar 14th, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. #substitutions is a list of variables basically. here you can easily change the high/low limits and setpoints
  2. substitutions:
  3. temperature_setpoint: '25.5'
  4. temperature_alarm_low: '23.3'
  5. temperature_alarm_high: '27.5'
  6. temperature_hysteresis: '0.3'
  7. esphome:
  8. name: thermostat
  9. platform: ESP8266
  10. board: nodemcuv2
  11. esp8266_restore_from_flash: True
  12. on_boot:
  13. priority: -10
  14. # ...
  15. then:
  16. #on boot we turn the thermostat on ("HEAT" mode in my case) and set the desired setpoint
  17. - climate.control:
  18. id: temp_control
  19. mode: HEAT
  20. target_temperature: ${temperature_setpoint}
  21. #This script begins the monitor that makes sure we receive a new temperature measurement at least every 2 minutes
  22. #If this script isn't called every 2 minutes it will start the high temperature alarm
  23. #Everytime we call the script the timer resets. I call this the temperature "heartbeat"
  24. - script.execute: temperature_heartbeat
  25.  
  26. wifi:
  27. ssid: !secret wifi_ssid
  28. password: !secret wifi_password
  29. ap:
  30. ssid: thermostat
  31. password: !secret ap_password
  32.  
  33. web_server:
  34. port: 80
  35.  
  36. logger:
  37.  
  38. api:
  39.  
  40. ota:
  41.  
  42. captive_portal:
  43.  
  44. sensor:
  45. - platform: dht
  46. pin: D5
  47. temperature:
  48. name: "Test Room Temperature"
  49. id: temp_1
  50. humidity:
  51. name: "Test Room Humidity"
  52. update_interval: 60s
  53. switch:
  54. - platform: gpio
  55. pin: D8
  56. id: Relay
  57. name: "Heating Element Relay"
  58. climate:
  59. - platform: thermostat
  60. name: "thermostat_test"
  61. id: temp_control
  62. #Note that here the same temperature sensor that has all of the alarms configured is used to control the thermostat
  63. sensor: temp_1
  64. default_target_temperature_low: ${temperature_setpoint}
  65. hysteresis: ${temperature_hysteresis}
  66. heat_action:
  67. - switch.turn_on: Relay
  68. idle_action:
  69. - switch.turn_off: Relay
  70. script:
  71. - id: temperature_heartbeat
  72. mode: restart
  73. then:
  74. - delay: 2 min
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement