Trigger for every event, not just changes or stays?


#1

Is there a trigger that subscribes to every event from a particular device attribute? I’ve only seen “changes” or “stays”, but neither one is really what I’m looking for.

I have a couple of situations I’m trying to solve.

In the first case, I’m interested in any “motion active” events during a specific time period. The sensor may be active for the entire time, so it may never change to active, but as long as it sends an “active” event during that time period, I want to know.

The second case is where I have a particular piston that encounters “Piston waited at a semaphore” somewhat often (long story…). In this case, the “door closed” event can arrive before the “door opened” event (due to the 10 second delay of the semaphore), which means I get two back-to-back “door closed” events. I’d like to be able to detect this situation and compensate accordingly.

Right now I’m using “On Events From” followed by an “If” statement that checks the status for each device. In most cases, I have to set a Boolean variable that I then use throughout the piston. This all seems very verbose and somewhat hacky, and I was hoping that there was a better solution. Is there anything available to better handle situations like this?


#2

I can give you an idea about this one:
Are you ok with using fuel stream?
Fuel stream will record everything about that sensor when ACTIVE when not…
if you don’t want fuel stream,
how about using a variable…
IF TIME is between X and Y
…IF motions sensor CHANGES to active
OR
…IF motions sensor IS active
Change variable @motionsensor = true
(save the time)

IF time changes to Y
Change variable @motionsensor = false
(save the time)

#3

Oh interesting! I’m not very familiar with fuel streams; I’ll have to check them out. Can you execute actions based on the status? I had always thought it was just a way to log stuff.

I considered the example you gave, where you combine “…CHANGES to active” and “…IS active”, but I wasn’t sure if that would work if the piston subscribes events from multiple devices. If the piston runs because a door opened, “…IS active” would still report true, even though the current event didn’t come from the motion sensor. Right?

I guess I could do something like this:
If {$currentEventDevice} is X
and
X is active
That’s still pretty verbose, but I can directly use it in an If statement (unlike On Events From), so it could eliminate the need for extra Boolean variables.