I am trying to calculate and save the average result of 3 sensor lux values into the logic database.
I have in my room 3 motion sensors which all suply LUX values, now i want to save the average result as logic a value so i created the following flow:
When: sensor value changes (i choose 1 sensor)
Then: calculate logic value.
I choose from list the name of the value to which to save (in my case binnenlux) and then the following as text:
{{[helderheid1]+[helderheid2]+[helderheid3]}/3}
I expected that it would calculate the average of these 3 sensors and save the result as value in binnenlux but nothing happens, the value is empty
info:
[helderheid1] = sensor 1 helderheid etc, choosen from list, blue tag)
binnenlux is the logic name and is number value type
I also tried:
{{[helderheid1]+[helderheid2]+[helderheid3]}:3}
{[helderheid1]+[helderheid2]+[helderheid3]/3}
This is working but is NOT what i want, i want the average not the total:
{[helderheid1]+[helderheid2]+[helderheid3]}
Anyone an idea what i am doing wrong and how to get the average and save this?