Advertisement
boelle11

Untitled

Mar 14th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 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.  
  59. - platform: template
  60. name: "Target Up"
  61. turn_on_action:
  62. id: temp_control
  63. target_temperature: !lambda 'return id(temp_control).target_temperature + 1;'
  64. turn_off_action:
  65.  
  66. climate:
  67. - platform: thermostat
  68. name: "thermostat_test"
  69. id: temp_control
  70. #Note that here the same temperature sensor that has all of the alarms configured is used to control the thermostat
  71. sensor: temp_1
  72. default_target_temperature_low: ${temperature_setpoint}
  73. hysteresis: ${temperature_hysteresis}
  74. heat_action:
  75. - switch.turn_on: Relay
  76. idle_action:
  77. - switch.turn_off: Relay
  78. script:
  79. - id: temperature_heartbeat
  80. mode: restart
  81. then:
  82. - delay: 2 min
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement