Actions
Actions are operations that the Hiclaro automation engine can invoke on your plugin — things like toggling a device, playing a sound, or triggering a reset.
What is an action?
An action is a named operation declared in your plugin manifest that the automation engine can call when a user-defined rule fires. Once declared, your action appears in the automation builder as a selectable step. When the engine triggers it, Hiclaro publishes an MQTT message to your plugin and your service handles it.
Actions can optionally carry a value (e.g. a target state or a ringtone name) and can optionally be scoped to a specific device. A perDevice action lets the user pick which asset to target in the automation builder — Hiclaro then includes the device's port address in the payload so your service knows which hardware to act on.
Declaring actions in the manifest
Add an actions array to your plugin.json. Each entry becomes available as an automation step immediately after the plugin is installed.
The optional acceptedValues field declares a fixed set of allowed values for the action. When present, the automation builder renders a Select instead of a free-text input, preventing invalid values from being submitted. Each item can be a plain string or an object with value and label keys to display a friendlier label to the user while sending the raw value to your service. Omit the field entirely when the value is free-form (e.g. a target temperature).
See the Plugin Manifest reference for the full field list for each action entry (key, label, hasValue, valueType, perDevice, acceptedValues).
Receiving actions over MQTT
When the automation engine triggers an action it publishes to:
Subscribe to these topics in your service's on_connect handler using qos=1 so messages survive a brief reconnect.
After the two-step parse, the inner object contains:
value — the string value supplied by the automation, present when hasValue: true.
address — the port address (MAC or IP) of the targeted asset, present when perDevice: true and the user selected a device.