Triggers are a core concept of MudPi. A trigger contains a set of conditions or thresholds that take system readings and activates if the threshold have been met. Typically a state change is the most common cause of a trigger.

Available Interfaces

Below is a list of currently supported interfaces for triggers.

stateResponds to `StateUpdated` eventsLearn More
sensorInteracts with sensor dataLearn More
controlActivates when a control is changedLearn More
groupCombines multiple triggers togetherLearn More
toggleResponds to a toggle change eventLearn More
cronUses a cron string to check current timeLearn More

If you would like at add support for another trigger interface read the developer docs and submit a PR!

Available Actions

Sensors provide a trigger action to immediately trigger the actions configured to it. This is intended mainly for testing only.

triggerImmediately fire actions on a trigger (TESTING ONLY).

Trigger Event

While you can listen to the StateUpdated event for all the triggers they also broadcast an event on the trigger topic as well. This event is broadcast for you to hook into triggers and chain additional functionality.

Event: TriggerFired

"event": "TriggerFired",
"component_id": "example_trigger_1",
"name": "Example Trigger 1",
"updated_at": "2021-03-14 09:34:33",
"state": 12,
"source": "example_sensor_1"