Hi there,<br><br>I&#39;m working on a rule that will alert me when there is no events from the sensors for a while.<br><br>So, first idea was to use time window and matches in condition side, to match all types of sensors, and then to print that something is wrong.<br>
<br>rule &quot;Alert if there is no activity&quot;<br>
when<br>
    not StateEvent(itemName matches &quot;door.*|presence.*|luminosity.*&quot;) over window:time( 1m ) from entry-point &quot;EventStream&quot;<br>
then<br>
    System.out.println(&quot;Alert: one sensor is not working&quot;);<br>
end<br><br>First change was to add a timer, as truth maintenance will fire this rule the first time, but not forever. So i add a timer to fire the rule every 20 seconds, for example.<br><br>rule &quot;Alert if there is no activity&quot;<br>
timer (cron:0/20 * * * * ?)<br>

when<br>

    not StateEvent(itemName matches &quot;door.*|presence.*|luminosity.*&quot;) over window:time( 1m ) from entry-point &quot;EventStream&quot;<br>

then<br>

    System.out.println(&quot;Alert: one sensor is not working&quot;);<br>

end<br><br>The second thing i want to achieve is to print what specific sensor is not working, but i understand that as there is no StateEvent, i can&#39;t declare a variable, for example.<br><br>rule &quot;Alert if there is no activity&quot;<br>

timer (cron:0/20 * * * * ?)<br>


when<br>


    not $event: StateEvent(itemName matches &quot;door.*|presence.*|luminosity.*&quot;) over window:time( 1m ) from entry-point &quot;EventStream&quot;<br>


then<br>


    System.out.println(&quot;Alert: one sensor is not working: &quot; + $event.getItemName());<br><br>So, do you know how can i know which sensor is not working? must i rewrite the rule to achieve this? is this possible?<br>
<br><br>Thanks for your help.<br>


end<br><br>