Skip to content

8. How to: Useful sensor templates

David Bonnes edited this page Dec 25, 2023 · 1 revision

These are useful, but you need to construct them manually.

Note that climate.controller is the default name of the CH/DHW (or HVAC) controller.

Your system may have any combination of theses, including all three, or none (i.e. for systems with an OTB, and no stored HW).

sensor:
  - platform: template
    sensors:
      f9_relay_demand:
        friendly_name: "heating_valve (relay_demand)"
        unit_of_measurement: "%"
        value_template: >-
          {{ state_attr('climate.controller', 'relay_demands').F9 * 100 }}

      fa_relay_demand:
        friendly_name: "hotwater_valve (relay_demand)"
        unit_of_measurement: "%"
        value_template: >-
          {{ state_attr('climate.controller', 'relay_demands').FA * 100 }}

      fc_relay_demand:
        friendly_name: "heating_control (relay_demand)"
        unit_of_measurement: "%"
        value_template: >-
          {{ state_attr('climate.controller', 'relay_demands').FC * 100 }}

This is included here for your reference:

sensor:
  - platform: template
    sensors:
      system_mode:
        friendly_name: "System Mode"
        value_template: >-
          {{ state_attr('climate.controller', 'system_mode') }}
        attribute_templates:
          system_mode: "{{ state_attr('climate.controller', 'system_mode').system_mode }}"
          until: "{{ state_attr('climate.controller', 'system_mode').until }}"

      fc_heat_demand:
        friendly_name: "01:000000_FC (heat_demand)"
        unit_of_measurement: "%"
        value_template: >-
          {% if state_attr('climate.controller', 'heat_demands') != None %}
            {% if state_attr('climate.controller', 'heat_demands').get('FC') != None %}
              {{ state_attr('climate.controller', 'heat_demands').FC * 100 }}
            {%- endif %}
          {%- endif %}