Skip to content

Adding a New Branch

Scenario Objective

Enhance your scenario by adding a new branch that allows you to stop the music. In this branch, you will:

  • Use a voice command (e.g., "Stop the alarm clock") to stop the scenario.
  • Include a test to check if the alarm is already active and, if so, stop it.
  • Update the scenario parameters so that the rule call can effectively stop the music.

Steps to Add the New Branch

  1. Add a New Branch:
    Click the Start button in the Actions tab to add a new branch to your scenario.

    Screenshot

  2. Configure the Calendar Node:
    Set the Calendar node to use a voice rule and add the rule "Stop the alarm clock".

    Screenshot

    Check the configuration for this step

  3. Add Javascript Nodes:

    • Insert a Javascript node between the Calendarscheduled node and the Speak node.
    • Add a Javascript node into the new branch.

    Screenshot

  4. Configure the Javascript Node:
    Set up the Javascript nodes to test whether the alarm is active and stop it accordingly.

    Screenshot

    Check the configuration for this step

  5. Close the New Branch:
    Connect the Javascript node to the end node to complete the branch.

    Screenshot


With this new branch, your scenario can now be stopped via a voice command, effectively stopping the music and ending the alarm when required.


Next Step