Sensor mean value


I have two temperature sensors per floor. One old zwave and a new one I built myself.
I would like to display the combined mean value of these two sensors. How do I do that?

Thanks in advance.

Have a look here…

  - platform: template
        value_template: '{{ ( (float(states.sensor.old_zwave.state) + float(states.sensor.new_zwave.state) ) / 2) }}'

Something like this?


What does the states.sensor.state mean? otherwise I follow the calculation. Would this work?

value_template: '{{ ( (float(states.sensor.sn1_temperature) + float(states.sensor._temperature1) ) / 2) }}'

Thanks, I’ll take a look.

What does the states.sensor.state mean?

If you don’t include the .state at the end, the values won’t come through. Just realised in my above example I forgot to include both .state (now edited)

Your code will work like this:

value_template: '{{ ( (float(states.sensor.sn1_temperature.state) + float(states.sensor._temperature1.state)) / 2 ) }}'

1 Like

Thank buddy! I’ll give it a go!