#How can I trigger on a sum, or some other math operation over the state of N entities?

1 messages · Page 1 of 1 (latest)

opaque vortex
#

I've attached an accelerometer to my washing machine and want to sum the square of rotations in all axes to detect when it spins and then shuts down. Is there a way to run a mathematical formula over the state of some entities? Is there a way to do it over some time (so I guess, integrate)?

glass anchor
#

You can do some things like a sum with a group - a sensor group can do sum, min, max, last change etc
Sum of squares though you'd have to do a template
You would then want to use a statistics helper to sum that result over time (an integral would sum over the entire life and only increase, whereas the statistics helper can do say "the last minute")

opaque vortex
#

As in create a sensor group out of a number of sensors and then get a sum out of that?

#

I think I'll look at template sensors in the meantime.

opaque vortex
#

What is the schedule by which these template sensors get updated?

glass anchor
#

Whenever a base sensor it references updates

opaque vortex
#

I've tried setting up a moving average using the statistics helper, but it seems that only applies to sensors and not outputs from other helpers. Is there another way to do this?

glass anchor
#

It does work on the output of other helpers, however you need to set the template sensor up properly or it won't register

#

Have you set the template sensor to have a state class of measurement?

loud shell
#

I guess they've set up a sensor group, which only works with sensors

#

a template sensor will work with any entity with a numeric state