So in the old world you used to be able to group things together into what a device does in the config.yaml
e.g.
sensor DeviceGroup:
- platform: command_line
- platform: mqtt
sensor DeviceGroup2:
- platform: command_line
- platform: mqtt
etc.
but with the new format it does not appear to allow you to name the group hence you can only have one mqtt: template: tag in the yaml?
i.e. you can’t do
mqtt DeviceGroup:
sensor:
- name:
mqtt DeviceGroup2:
sensor:
- name:
Is this intentional or just something I’ve missed?
Hi @mark.carter ,
I think what you are looking for now is the unique_id
. Something like the config below should just work :
mqtt:
sensor:
- name:
unique_id: DeviceGroup
- name:
unique_id: DeviceGroup2
123
(Taras)
July 9, 2022, 6:19pm
3
mark.carter:
Is this intentional
Yes. You can’t do that anymore (using mqtt, template, rest integrations).
If you wish, you can use packages to allow defining separate collections of MQTT entities (but it’s not exactly the same as the old practice you described).
opened 04:26PM - 04 Jul 22 UTC
closed 12:53PM - 07 Jul 22 UTC
integration: mqtt
### The problem
In the old format it was possible to have multiple tags in th… e configuration so sensors etc could be grouped per device as what they consisted of. In the new format this seems no longer possible and only one mqtt: or template: tag is allowed in the configuration.yaml.
For example old format you could express a device and all its components under a grouping
```
sensor Device:
- platform: command_line
- platform: mqtt
sensor Device2*
- platform: command_line
- platform: mqtt
```
but it is not possible in the new formats and the following is not valid
```
mqtt Device:
sensor:
- name:
switch:
-name:
mqtt Device2:
sensor:
- name:
```
### What version of Home Assistant Core has the issue?
2022.6.7
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
_No response_
### Link to integration documentation on our website
_No response_
### Diagnostics information
_No response_
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
_No response_
### Additional information
_No response_
Pronown
(sudoxnym)
July 9, 2022, 6:20pm
4
I don’t believe this will do what OP is intending. This creates two separtate entities… Not one entity with 2 platforms.
Thanks all raised it on github same answers gone with platforms but annoying that it has to be indented from the homeassistant: tag but apart from that works well