|
| 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 | +.. _config-datetime: |
| 20 | + |
| 21 | +Base Sub Device Configuration |
| 22 | +--------------------------- |
| 23 | + |
| 24 | +All devices in ESPHome have an id and name, and an optional suggested area. |
| 25 | + |
| 26 | +.. code-block:: yaml |
| 27 | +
|
| 28 | + # Example devices configuration |
| 29 | + id: my_device |
| 30 | + name: My Device |
| 31 | +
|
| 32 | + # Optional variables: |
| 33 | + area: Living Room |
| 34 | +
|
| 35 | +Configuration variables: |
| 36 | + |
| 37 | +- **id** (**Required**, string): Specify the ID for code generation. |
| 38 | +- **name** (**Required**, string): The name for the sub device. |
| 39 | +- **area** (*Optional*, string): The suggested area for the sub device. |
| 40 | + |
| 41 | +Assign entity to sub device |
| 42 | +---------- |
| 43 | + |
| 44 | +For individual entities in your configuration, you can assign them to a |
| 45 | +sub device by using the ``device_id`` option. This is done by adding |
| 46 | +the ``device_id`` option to the entity configuration. The value should |
| 47 | +be the ID of the sub device you want to assign the entity to. |
| 48 | + |
| 49 | +.. code-block:: yaml |
| 50 | +
|
| 51 | + sensor: |
| 52 | + - platform: template |
| 53 | + # ... |
| 54 | + device_id: my_device |
| 55 | +
|
| 56 | +
|
| 57 | +See Also |
| 58 | +-------- |
| 59 | + |
| 60 | +- :doc:`esphome` |
| 61 | +- :ghedit:`Edit` |
| 62 | + |
| 63 | +.. toctree:: |
| 64 | + :maxdepth: 1 |
| 65 | + :glob: |
| 66 | + |
| 67 | + * |
0 commit comments