Skip to content

Adding an Action

Scenario Objective

Enhance your scenario by integrating outdoor temperature data. In this example, after setting up your basic scenario, you will add an Action node that calls the meteomatics plugin to fetch the outdoor temperature. This data can then be used to drive further actions in your scenario.

Tip

If you do not have meteomatics plugin, install it from the A.V.A.T.A.R projects plugin library. You can always remove it if it doesn't suit your needs, or modify the example with one of your own plugins.


Understanding How to Call a Plugin

To call a plugin, A.V.A.T.A.R needs several pieces of information:

  1. A.V.A.T.A.R-Specific Information:

    These parameters are mandatory and must always be included in the task parameters:

    • language: The language code used.
    • client: The client that sent the task.

    The client parameter is automatically filled based on the client you selected to send the task, while the language parameter must always be updated manually.

    For example, for English (en) and a client "Living room":

    const parameters = {
        language: "en",
        client: "Living room"
    };
    
Note

Another optional parameter, toClient, may be automatically added to the A.V.A.T.A.R-specific parameters if you select a client from the "Client executing the task" list. See the Clients Tab for more details.

Plugin-Specific Information

All other parameters are defined for the plugin and the function to be executed.

None of these parameters are mandatory, including the command parameter which is added by default to simplify additions (the majority of plugins execute functions from a command array data.action.command).

If a plugin does not use this command array and executes directly, remove the command parameter.


Steps to Add the Action Node

  1. Modify the Scenario Layout
    First, adjust your scenario layout as shown below:

    Screenshot

    Check the configuration for this step

  2. Update the Speak Node
    Open the configuration of the Speak node and modify its behavior so that it works seamlessly with the new Action node.

    Check the configuration for this step

  3. Configure the Action Node
    Open the configuration of the Action node and update its parameters to call the meteomatics plugin, which will provide the outdoor temperature data.

    Screenshot

    Check the configuration for this step

  4. Save Your Changes
    Don’t forget to save the scenario after making these modifications.

    Screenshot

  5. Refresh the Job Status
    Click on the Calendar node to refresh the job status. If the job is not running, you can restart it by clicking on it.

    Screenshot

    Screenshot


Congratulations! You have successfully enhanced your scenario to include outdoor temperature data from the meteomatics plugin.


Next Step