Trigger t = TriggerPersistence.getTrigger(triggerName);
if (t == null) {
t = new Trigger();
t.setName(triggerName);
t.setChannel(event);
Payload p = new Payload();
p.addStatement("hasLightsOn", amount);
p.addStatement("roomName", roomName);
t.setPayload(p);
TriggerPersistence.addAndRegister(t);
}
}