mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-23 11:26:48 +00:00

* Rename Services to Actions in integrations: S * Update source/_integrations/scene.markdown * Update source/_integrations/scene.markdown * tweaks --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
1.9 KiB
1.9 KiB
title, description, ha_category, ha_release, ha_quality_scale, ha_domain, ha_platforms, ha_codeowners, ha_integration_type, related
title | description | ha_category | ha_release | ha_quality_scale | ha_domain | ha_platforms | ha_codeowners | ha_integration_type | related | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Switch | Instructions on how to set up your switches with Home Assistant. |
|
0.7 | internal | switch |
|
|
entity |
|
Keeps track which switches are in your environment, their state and allows you to control them.
- Maintains a state per switch and a combined state
all_switches
. - Registers actions
switch.turn_on
,switch.turn_off
, andswitch.toggle
to control switches.
{% include integrations/building_block_integration.md %}
Device class
{% include integrations/device_class_intro.md %}
The following device classes are supported for switches:
- None: Generic switch. This is the default and doesn't need to be set.
- outlet: A switch for a power outlet.
- switch: A generic switch.
Using the actions
In the frontend open Settings. Select Developer tools, click Actions. From the Action dropdown menu choose switch.turn_on
or switch.turn_off
from the list of available actions. In the Entity dropdown menu choose or enter the entity ID you want to work with. This will enter something like the sample below into the data field. Now select Perform action.
{"entity_id":"switch.livingroom_pin2"}
Data attribute | Optional | Description |
---|---|---|
entity_id |
no | String or list of strings that point at entity_id s of switches. To target all switches, set entity_id to all . |