Switch
switch: - platform: ... # [!code highlight] name: 'My Switch'Attributes
Section titled “Attributes”Common attributes are documented in Common Component Properties.
| Property | Description | Example |
|---|---|---|
device_class | Home Assistant switch classification. | outlet |
Supported Filters
Section titled “Supported Filters”| Filter | Description |
|---|---|
| (none) | Switch does not currently support filters. |
Supported Platforms
Section titled “Supported Platforms”| Platform | Notes |
|---|---|
| Shell | Uses command_on and command_off; optional command_state for state polling. |
For platform-specific configuration options, use the linked platform pages.
Shell Platform Notes
Section titled “Shell Platform Notes”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