Card Switch - dckiller51/astrion-custom-dashboard GitHub Wiki
A simple on/off tile. Tap it to toggle. Made for switch.* entities, and works with anything Home Assistant can toggle whose state is on / off: input_boolean, fan, automation…
For a light with brightness and colour, use the Light card instead.
![]() On |
![]() Off |
![]() In the builder |
-
Tap anywhere on the tile: calls
<domain>.toggleon the entity. - Name and state (On / Off, in the remote's language).
-
Colour when on: the whole tile takes the
on_colorbackground, green by default. A dark red for a heater, a blue for a fan… - Icon: power (default), heater, fan or bulb, or one of your PNG icons (since 1.2.9).
| Parameter | Type | Default | Description |
|---|---|---|---|
type |
string | — | switch |
entity_id |
string | — | The entity to toggle. Required. |
name |
string | friendly name | Name shown on the tile. |
on_color |
string |
#FF2E5A46 (green) |
Tile background when on: #RRGGBB, or #AARRGGBB for transparency, e.g. #805A1F1F. |
icon |
string | power | Keyword: heater (or heat), fan, bulb (or light), or a PNG path like /sdcard/astrion/icons/heater.png (1.2.9+). Anything else shows the power icon. |
Before 1.2.9, a PNG path showed the power icon and a 6-digit
on_colormade the tile transparent.
[
{ "type": "switch", "options": { "entity_id": "switch.towel_heater", "name": "Towel heater",
"icon": "heater", "on_color": "#FF5A1F1F" } },
{ "type": "switch", "options": { "entity_id": "fan.bedroom", "name": "Bedroom fan", "icon": "fan",
"on_color": "#FF1F3A5A" } },
{ "type": "switch", "options": { "entity_id": "input_boolean.guest_mode", "name": "Guest mode" } }
]💡 Two switches side by side: put them in a Row.
See also: Card Light · Builder


