Hi All,
I’m trying to do a little HA housekeeping (I’m not terribly active) and am after advice on better ways to manage my configuration. Today my config is a mess of stuff created through the UI and yaml. Below is the configuration snippet for my hydronic heater (4CHR3 controls the hydronic boiler, along with the garden sprinklers).
Aside from moving this into sensors.yaml, I feel that that “code” (I say that very loosely) is far from ideal. Any advice on better ways to structure this?
sensor:
- platform: template
sensors:
heat_required:
friendly_name: "Heat Required"
value_template: >-
{{ (state_attr('climate.ensuite_thermostat', 'current_temperature')|int) < (state_attr('climate.ensuite_thermostat', 'temperature')|int) or
(state_attr('climate.living_room_thermostat', 'current_temperature')|int) < (state_attr('climate.living_room_thermostat', 'temperature')|int) or
(state_attr('climate.bedroom_thermostat', 'current_temperature')|int) < (state_attr('climate.bedroom_thermostat', 'temperature')|int) or
(state_attr('climate.ruby_bedroom_thermostat', 'current_temperature')|int) < (state_attr('climate.ruby_bedroom_thermostat', 'temperature')|int) or
(state_attr('climate.guest_room_thermostat', 'current_temperature')|int) < (state_attr('climate.guest_room_thermostat', 'temperature')|int) or
(state_attr('climate.sitting_room_thermostat', 'current_temperature')|int) < (state_attr('climate.sitting_room_thermostat', 'temperature')|int)
}}
heat_required_ensuite:
friendly_name: "Heat Required - Ensuite"
value_template: "{{ (state_attr('climate.ensuite_thermostat', 'current_temperature')|int) < (state_attr('climate.ensuite_thermostat', 'temperature')|int) }}"
heat_required_living_room:
friendly_name: "Heat Required - Living Room"
value_template: "{{ (state_attr('climate.living_room_thermostat', 'current_temperature')|int) < (state_attr('climate.living_room_thermostat', 'temperature')|int) }}"
heat_required_bedroom:
friendly_name: "Heat Required - Bedroom"
value_template: "{{ (state_attr('climate.bedroom_thermostat', 'current_temperature')|int) < (state_attr('climate.bedroom_thermostat', 'temperature')|int) }}"
heat_required_ruby_bedroom:
friendly_name: "Heat Required - Ruby Bedroom"
value_template: "{{ (state_attr('climate.ruby_bedroom_thermostat', 'current_temperature')|int) < (state_attr('climate.ruby_bedroom_thermostat', 'temperature')|int) }}"
heat_required_guest_room:
friendly_name: "Heat Required - Guest Room"
value_template: "{{ (state_attr('climate.guest_room_thermostat', 'current_temperature')|int) < (state_attr('climate.guest_room_thermostat', 'temperature')|int) }}"
heat_required_sitting_room:
friendly_name: "Heat Required - Sitting Room"
value_template: "{{ (state_attr('climate.sitting_room_thermostat', 'current_temperature')|int) < (state_attr('climate.sitting_room_thermostat', 'temperature')|int) }}"
Thanks all,
Dim