Skip to main content

Event Trigger

Event Trigger are a virtual copy of controllable physical parameters of your device.

That a mouthful, so let's break it down.

Event Trigger are a way to represent the state of your device in the cloud, and can be used to control your device remotely. Think of Event Trigger as a lightweight digital twin for your device.

Event Trigger are defined at the level, and the shadow schema is shared across all devices in a given fleet.

Event Trigger are defined using a Protocol Buffer schema, and can be updated by the device itself, a consumer application, the OmniWOT Web App, or APIs.

Let's explore this using an example:

Example: Smart Light

Let's say we have an RGB smart light that can be turned on and off, and have it's color changed. We want to be able to control the light from our mobile app, and also be able to see the current state of the light.

Event Trigger are perfect for this use case.
We can define a event trigger schema that looks like this:

syntax = "proto3";
message event_trigger {
bool on = 1;
Color color = 2;
}
message Color {
uint32 red = 1;
uint32 green = 2;
uint32 blue = 3;
}