Advertisement
richsimpson

Gas Heating - works but throws error in log Apr2022

May 4th, 2022
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. sensor current-consumption:
  2. - platform: template
  3. sensors:
  4. gas_heating_current_consumption:
  5. friendly_name: "Gas Heating Current Consumption"
  6. unit_of_measurement: "W"
  7. value_template: >
  8. {% if state_attr('climate.hall', 'hvac_action') == 'heating' %}
  9. 18500
  10. {% elif state_attr('climate.hall', 'hvac_action') == 'off' %}
  11. 0
  12. {% endif %}
  13. #Gas Heating Sensor for usage
  14. #gives an on/off state for the calling for heat (not main on/off of device)
  15. central_heating_heating_state:
  16. friendly_name: "Central Heating Heat State"
  17. value_template: >
  18. {% if state_attr('climate.hall', 'hvac_action') == 'heating' %}
  19. ON
  20. {% elif state_attr('climate.hall', 'hvac_action') == 'off' %}
  21. OFF
  22. {% elif state_attr('climate.hall', 'hvac_action') == 'idle' %}
  23. OFF
  24. {% endif %}
  25.  
  26.  
  27. - platform: integration
  28. source: sensor.gas_heating_current_consumption
  29. name: gas_heating_total_consumption
  30. unit_prefix: k
  31. round: 2
  32. method: left
  33.  
  34. # These are the sensors that feed into lovelace and give a value of KWH used
  35. utility_meter:
  36. hourly_gas_heating_energy:
  37. source: sensor.gas_heating_total_consumption
  38. name: Gas Heating - Current Hour
  39. cycle: hourly
  40.  
  41. daily_gas_heating_energy:
  42. source: sensor.gas_heating_total_consumption
  43. name: Gas Heating - Today
  44. cycle: daily
  45.  
  46. weekly_gas_heating_energy:
  47. source: sensor.gas_heating_total_consumption
  48. name: Gas Heating - This Week
  49. cycle: weekly
  50.  
  51. monthly_gas_heating_energy:
  52. source: sensor.gas_heating_total_consumption
  53. name: Gas Heating - This Month
  54. cycle: monthly
  55.  
  56. yearly_gas_heating_energy:
  57. source: sensor.gas_heating_total_consumption
  58. name: Gas Heating - This Year
  59. cycle: yearly
  60.  
  61. sensor:
  62. # Rad Demand and Heating Called history stats
  63. - platform: history_stats
  64. name: Heating On Today
  65. entity_id: sensor.central_heating_heating_state
  66. state: "ON"
  67. type: time
  68. start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  69. end: "{{ now() }}"
  70. - platform: history_stats
  71. name: Heating On Yesterday
  72. entity_id: sensor.central_heating_heating_state
  73. state: "ON"
  74. type: time
  75. end: "{{ now().replace(hour=0, minute=0, second=0) }}"
  76. duration:
  77. hours: 24
  78. - platform: history_stats
  79. name: Heating On Current Week
  80. entity_id: sensor.central_heating_heating_state
  81. state: "ON"
  82. type: time
  83. start: "{{ as_timestamp( now().replace(hour=0, minute=0, second=0) ) - now().weekday() * 86400 }}"
  84. end: "{{ now() }}"
  85. # - platform: history_stats
  86. # name: Rads On Today
  87. # entity_id: binary_sensor.radiator_demands_heat
  88. # state: "on"
  89. # type: time
  90. # start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  91. # end: "{{ now() }}"
  92. # - platform: history_stats
  93. # name: Rads On Yesterday
  94. # entity_id: binary_sensor.radiator_demands_heat
  95. # state: "on"
  96. # type: time
  97. # end: "{{ now().replace(hour=0, minute=0, second=0) }}"
  98. # duration:
  99. # hours: 24
  100. # - platform: history_stats
  101. # name: Rads On Current Week
  102. # entity_id: binary_sensor.radiator_demands_heat
  103. # state: "on"
  104. # type: time
  105. # start: "{{ as_timestamp( now().replace(hour=0, minute=0, second=0) ) - now().weekday() * 86400 }}"
  106. # end: "{{ now() }}"
  107.  
  108. # extract current and target temps from rad valves
  109. - platform: template
  110. sensors:
  111. lounge_current_temp:
  112. friendly_name: "Lounge Temp"
  113. unit_of_measurement: "°C"
  114. value_template: "{{ states.climate.radiator_lounge.attributes.current_temperature }}"
  115. lounge_target_temp:
  116. friendly_name: "Lounge Target Temp"
  117. unit_of_measurement: "°C"
  118. value_template: "{{ states.climate.radiator_lounge.attributes.current_heating_setpoint }}"
  119. dining_room_current_temp:
  120. friendly_name: "Dining Room Temp"
  121. unit_of_measurement: "°C"
  122. value_template: "{{ states.climate.radiator_dining_room.attributes.current_temperature }}"
  123. dining_room_target_temp:
  124. friendly_name: "Dining Room Target Temp"
  125. unit_of_measurement: "°C"
  126. value_template: "{{ states.climate.radiator_dining_room.attributes.current_heating_setpoint }}"
  127. bedroom_current_temp:
  128. friendly_name: "Bedroom Temp"
  129. unit_of_measurement: "°C"
  130. value_template: "{{ states.climate.radiator_bedroom.attributes.current_temperature }}"
  131. bedroom_target_temp:
  132. friendly_name: "Bedroom Target Temp"
  133. unit_of_measurement: "°C"
  134. value_template: "{{ states.climate.radiator_bedroom.attributes.current_heating_setpoint }}"
  135. office_current_temp:
  136. friendly_name: "Office Temp"
  137. unit_of_measurement: "°C"
  138. value_template: "{{ states.climate.radiator_office.attributes.current_temperature }}"
  139. office_target_temp:
  140. friendly_name: "Office Target Temp"
  141. unit_of_measurement: "°C"
  142. value_template: "{{ states.climate.radiator_office.attributes.current_heating_setpoint }}"
  143. chloe_current_temp:
  144. friendly_name: "Chloe Temp"
  145. unit_of_measurement: "°C"
  146. value_template: "{{ states.climate.radiator_chloe.attributes.current_temperature }}"
  147. chloe_target_temp:
  148. friendly_name: "Chloe Target Temp"
  149. unit_of_measurement: "°C"
  150. value_template: "{{ states.climate.radiator_chloe.attributes.current_heating_setpoint }}"
  151. charlie_current_temp:
  152. friendly_name: "Charlie Temp"
  153. unit_of_measurement: "°C"
  154. value_template: "{{ states.climate.radiator_charlie.attributes.current_temperature }}"
  155. charlie_target_temp:
  156. friendly_name: "Charlie Target Temp"
  157. unit_of_measurement: "°C"
  158. value_template: "{{ states.climate.radiator_charlie.attributes.current_heating_setpoint }}"
  159. play_room_current_temp:
  160. friendly_name: "Play Room Temp"
  161. unit_of_measurement: "°C"
  162. value_template: "{{ states.climate.radiator_play_room.attributes.current_temperature }}"
  163. play_room_target_temp:
  164. friendly_name: "Play Room Target Temp"
  165. unit_of_measurement: "°C"
  166. value_template: "{{ states.climate.radiator_play_room.attributes.current_heating_setpoint }}"
  167. cinema_room_current_temp:
  168. friendly_name: "Cinema Room Temp"
  169. unit_of_measurement: "°C"
  170. value_template: "{{ states.climate.radiator_cinema_room.attributes.current_temperature }}"
  171. cinema_room_target_temp:
  172. friendly_name: "Cinema Room Target Temp"
  173. unit_of_measurement: "°C"
  174. value_template: "{{ states.climate.radiator_cinema_room.attributes.current_heating_setpoint }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement