Would anyone be kind enough to help me with choosing a template sensor value? I’m trying to estimate the output of my heat pump using flow rate and flow/return temperatures. I want to set the current flow rate according to which pump is on.

`HP_WaterPump1Status`

is 1 if the heatpump is circulating, 0 if it is off and its flow rate is `input_number.flow_rate_hw`

(e.g. 14 l/min)

`HP_WaterPump2Status`

is 1 if the underfloor heating pump is on and the flow rate increases to

`input_number.flow_rate_htg`

(e.g. 17 l/min).

The is the entry in configuration.yaml I came up with:

```
template:
- sensor:
- name: HP flow rate now
state: "{{ states('HP_WaterPump1Status')|float * states('input_number.flow_rate_hw')|float + states('HP_WaterPump2Status')|float * (states('input_number.flow_rate_htg')|float - states('input_number.flow_rate_hw')|float) }}"
unit_of_measurement: l/min
unique_id: HP_flow_rate_now
```

It returns “unavailable”.

A more logical solution whould be to choose between 3 values (0, 14 or 17 in this example) according to which pump is on. I couldn’t see any examples on the forum showing how to do this so I resorted to arithmentic!