Counting total time tripped

I would like to start a scena based on the nuber of sec/min a motion sensor where tripped over the day.

Does anyone have an idea how to accomplish that?

I was thinking of getting last triped minus current time and write it in a extra variable.

Well somethings like that.

The idea is to automate my bug trap but only if there is a reason for it (doors windows open for some time)

Sent from my iPhone using Tapatalk

Does anyone have an idea how to accomplish that?

It would be fairly easy in PLEG. In fact there is an example in the latest version of PLEG Basics that shows a similar application (Duty-cycle).

You could also do it with Lua, of course. You could use the Not_Tripped trigger with Lua code (assuming UI5) to update a device variable with the accumulated on-time. Another trigger scheduled for 00:00:01 could reset the accumulator.