Skip to content

Commit b9bef83

Browse files
committed
Add a basic instruction
1 parent 08a5035 commit b9bef83

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

components/devices.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Sub Device Configuration
2+
========================
3+
4+
.. seo::
5+
:description: Instructions for setting up sub devices in ESPHome.
6+
:image: folder-open.svg
7+
8+
ESPHome has support for createting sub devices in configuration where
9+
individual entities can be grouped to. The grouping has no direct effect
10+
on the functionality of the entities, but it can be used to group
11+
entities together in the Home Assistant UI. This is useful for
12+
example when you have a mix sensors on one device that are related to
13+
different physical devices.
14+
15+
.. note::
16+
17+
Requires Home Assistant 2025.x or newer.
18+
19+
Base Sub Device Configuration
20+
-----------------------------
21+
22+
All devices in ESPHome have an id and name, and an optional suggested area.
23+
24+
.. code-block:: yaml
25+
26+
# Example devices configuration
27+
id: my_device
28+
name: My Device
29+
30+
# Optional variables:
31+
area: Living Room
32+
33+
Configuration variables:
34+
35+
- **id** (**Required**, string): Specify the ID for code generation.
36+
- **name** (**Required**, string): The name for the sub device.
37+
- **area** (*Optional*, string): The suggested area for the sub device.
38+
39+
Assign entity to sub device
40+
---------------------------
41+
42+
For individual entities in your configuration, you can assign them to a
43+
sub device by using the ``device_id`` option. This is done by adding
44+
the ``device_id`` option to the entity configuration. The value should
45+
be the ID of the sub device you want to assign the entity to.
46+
47+
.. code-block:: yaml
48+
49+
sensor:
50+
- platform: template
51+
# ...
52+
device_id: my_device
53+
54+
55+
See Also
56+
--------
57+
58+
- :doc:`esphome`
59+
- :ghedit:`Edit`

0 commit comments

Comments
 (0)