Creating rules with arbitary stream events

In this example we will show how you can use any custom payloads in the rule. For instance, let’s imagine that a security camera is sending an event in this format

  "event": {
    "motion": "Uknown"

and that we want to set and alarm when the motion value within a payload says "Uknown". Often is the case that cameras run face recognition on the device itself, only sending such events to the cloud.

our condition sensor is very simple, it checks only for that event type:

$${streamdata.event.motion} === "Uknown"

Now we can add any notification actuator (SMS, alarm etc…) on top of this sensor (when condition is true) and run this template in the streaming mode.