Switch device

A switch allows you to easily turn devices on or off and adjust output levels. Using Node-RED Alexa integration, you can automate switch actions based on voice commands or other smart home triggers.

Node-RED Virtual Switch device

Output

The following is a sample Node-RED output for this device using default component values:

{
  "id": "{--Switch Device ID--}",
  "name": "{--Switch Device Name--}",
  "type": "switch",
  "components": {
    "PowerController": {
      "powerState": "OFF"
    },
    "BrightnessController": {
      "brightness": 50
    }
  },
  "metadata": {
    "previous": {
      "components": {
        ...
      }
    }
  }
}

Components

The following components enable various features and controls for this device. Each component offers specific capabilities, commands, and configurations to enhance your Node-RED Alexa integration.

PowerController

The PowerController is essential for managing the power states of devices.

Commands:

“Alexa, turn on the Living room lights.”
“Alexa, turn off the Kitchen.”

Specification:

Property Description Allowed Values Default
powerState Indicates the device’s power state. ON, OFF OFF

BrightnessController

The BrightnessController adjusts the brightness levels of compatible devices.

Commands:

“Alexa, brighten the bathroom light to 75 percent.”
“Alexa, dim the lights to 25 percent.”
“Alexa, set the bedroom light to 50 percent.”

Specification:

Property Description Allowed Values Default
brightness Sets the brightness level as a percentage. 0 - 100 50