if (averageMotionLevel != lastMotionLevel) {
this.setDescription("Last detected motion level was " + averageMotionLevel + "%");
if (averageMotionLevel > configuration.getIntProperty("sensibility-threshold", 30)) {
//here create and send the freedom event
GenericEvent event = new GenericEvent(this);
event.addProperty("motion-level", new Integer(averageMotionLevel).toString());
event.setDestination("app.event.sensor.video.motion");
notifyEvent(event);
lastMotionLevel = averageMotionLevel;
}
}