How to sum numbers reported (motions) within 15 minutes?

Hia ll,

I built a ESP8266 board that will monitor and open/close my garage door. it spits out the following per report cycle (set right now to 120 seconds) via MQTT:

  • temperature (77F)
  • humidity (454)
  • heatindex (76F)
  • movement (5)
  • occupied (yes)

It also accepts a command also via MQTT (command/garage/door: open/close).

I want to set up automation:

If the door is OPEN
AND motion has been 0 for 15 minutes or more
send command/garage/door = close

Is there a way to accumulate motion for the last 15 minutes? At this point I don’t think so unless I resort to the new Python APPDaemon (I think it’s called that…).

IF there isn’t, I might need to change the monitor to report the motion like Unix reports system load: 1min/5min/15min, then parse out the number I want to check. OR report Motion_1m, Motion_5, Motion_15.

It kind of violates my rule of dumb sensors…

So, what do you all think?


Use the for key in the state trigger for the motion and a condition that checks the state of the door.