@klogg wrote:
I would like to take the average of a series of sensors, so long as they are reporting a valid number as their state (which they do under ‘normal’ circumstances).
I know how to do this but it would take me a lot of lines and I feel sure there is simple (possibly even one line) way to do this that I just don’t know because my jinja/python skills are not good enough.
Anyone care to help?
e.g.
sensor.sensor1 = 2
sensor.sensor2 = 3
sensor.sensor3 = 4
sensor.sensor4 = ‘unknown’would return 3
sensor.sensor1 = 3
sensor.sensor2 = 4
sensor.sensor3 = 5
sensor.sensor4 = 6would return 4.5
Posts: 3
Participants: 2