Skip to content

Switch

Base Example
switch:
- platform: ... # [!code highlight]
name: 'My Switch'

Common attributes are documented in Common Component Properties.

PropertyDescriptionExample
device_classHome Assistant switch classification.outlet
FilterDescription
(none)Switch does not currently support filters.
PlatformNotes
ShellUses command_on and command_off; optional command_state for state polling.

For platform-specific configuration options, use the linked platform pages.

For full shell switch setup, see Shell platform documentation.

When using command_state, the command output must resolve to true or false.

Similar to ESPHome: Switch