Events

⚡ TipControl Events: Reacting to Driver Variables

Events in TipControl allow your IoT system to respond dynamically to changes in driver variables. Each event (except timer events) is tied to a specific variable located under drv.<drivername>.var.... Events are triggered when driver variables are updated or when the driver’s update() function is manually called (though this is rarely necessary).

🔧 Event Settings

  • Enabled – Toggle each event on or off.
  • startEnabled – Determines if the event is active when the driver is first enabled.

🧠 Supported Event Types

TypeBehavior
EQUALFires once when variable equals value; resets if not equal.
BELOWFires once when variable is below value; resets if equal or above.
EQUALBELOWFires once when variable is below or equal; resets if above.
ABOVEFires once when variable is above value; resets if equal or below.
EQUALABOVEFires once when variable is above or equal; resets if below.
WEQUALFires on every update while variable equals value.
WBELOWFires on every update while variable is below value.
WEQUALBELOWFires on every update while variable is below or equal to value.
WABOVEFires on every update while variable is above value.
WEQUALABOVEFires on every update while variable is above or equal to value.
CHANGEFires when variable changes by a specified amount (numeric only), for all other variable types on any change.
TIMERFires every X milliseconds; variable is ignored.

🛠️ Using Events in TipControl Designer

Events are easiest to manage via the TipControl Designer:

  1. Navigate to Event via the toolbar or GoTo → Event.
  2. Select your device from the Devices list.
  3. Use the Location dropdown to view drivers with installed events.
  4. Below the drivers, you’ll find locally stored events.
  5. Select a driver to view its installed events.

💡 Event Management

  • Right-click an event to rename or delete it.
  • Checkbox next to the event name toggles its enabled state.
  • Variable List shows available variables (may be empty if driver is disabled).
  • Condition & Value – Set the trigger condition and test value.
  • onStartEnabled – Determines if the event activates with the driver.
  • New – Create a blank event.
  • Test – Run the event directly on the chip.
  • Install – Deploy the event to the device.
  • Save – Store the event locally.

🧬 Event Coding in TipControl Language

Each event includes a Code Box where you define the actions to perform when the event fires. This is written in TipControl Language.

🧠 Key Concepts

  • me refers to the driver the event is installed on. Example: If installed on drv.buttonme is equivalent to drv.button.
  • Use me to write generalized code without hardcoding driver names.
  • For low-memory devices, encapsulate long code in macros—event code stays in memory.
  • To disable an event after execution, use return(false). Note: me.eventEnabled(eventName,false) will not work for the event itself, even in a subsequantially called macro.

Want to see it in action? Download an example project from our website to explore how events work in real-world scenarios.