Skip to content

Entity Action

The Entity Action action performs an action on an entity (who knew?).

Two *Entity Actions*

When a entity is selected, the action menu is updated to reflect the list of actions defined by the capabilities associated with the select entity.

Note

Not every action may be implemented by every entity that supports a particular capability. It's up to you to experiment and figure out if your desired action works as expected. Reactor tries not to over-constrain the UI, as this often results in meaningful actions being inaccessible. I'd rather give you the tools you need to figure out what works than cut you off from what you want to do.

Selecting an action

Once the action is selected, Reactor will display fields for the required parameters for the action, if any. Some actions have fairly "open" parameter declarations, and you're going to need to know what values can be accepted there. Some have more constrained definitions, maybe even down to a short list of acceptable values, in which case a menu is displayed rather than an input field. If error-checking is possible based on the field definition, it will be performed when you leave the field, and if an error is detected, the field will be highlighted in red. A yellow highlight indicates that the field value may not be acceptable, but Reactor doesn't know for sure.

Setting an *Entity Action* parameter

The example above shows a "data list" control, which is fairly common in the action editor. It is a field that allows you to type in a value, or choose a predefined value from a list of expected/standard values. Because service definitions for entitys are often not exhaustive, and there are many exceptions for values that these definitions don't provide, the data list control gives you the flexibility to choose a standard value, or enter your own if your entity has a non-standard behavior.

Attention

The implementation behavior and appearance of "data list" controls varies from browser to browser. Chrome/Windows is shown in these screen shots; yours may look different. On some browsers, the pop-up list of values is only presented when the field is otherwise empty, so you may need to remove a prior value to have access to the pop-up list again.

The data list also presents a list of defined expression/variable names from the current ReactorSensor, which you can select to use the then-current value of that expression in the action's parameter. For parameters that just use a plain input field instead of a data list, you can specify an expression value by wrapping the expression/variable name like this: ${{ brightness }} (the whitespace inside doesn't matter; it's just added for clarity).

Note

Again, if you run into a field in an action for a entity where Reactor can do better error-checking on the possible values, please report that to me and submit the entity data on the "Tools" menu.

Action Responses

Some Entity Actions can return data from the operation they perform, and in that case, Reactor will offer you the opportunity to capture that response to a local (Rule) or global variable. The "Capture response to" list will show the names of all variables that are possible targets (i.e. your defined expression-less variables). If a variable is selected, the return data is saved there; otherwise, it is discarded. Typically, you will then use other actions, such as a Script Action, to further process the returned data.

Trying Your Entity Action

You can quickly test your entity action by clicking the "running man" icon on the action row. An alert will pop up with the result of the run. Unfortunately, it's just a fact of the way Vera works that not every action that fails will be reported as a failed action. That is, Vera will report the action succeeds, even when it doesn't actually work. You're just going to have to observe your system to see if you get the expected behavior. The real purpose of the alert is to show you the action call and the parameters that were passed, so you can verify that they are correct, in addition to observing the expected behavior of the controlled entity.

Updated: 2024-09-25