WTH can't I manually create a device from entities?

Tags: #<Tag:0x00007f739ab95e50>

Why can’t we manually create a device, either via YAML, UI, or preferably both? Also, why can’t we edit existing devices to add entities to them?

As an example, I have some devices that connect via MQTT, without discovery. They’re a couple of sensors/binary_sensors. I’ve manually created a couple of devices by publishing some MQTT discovery messages for them instead of configuring them via YAML. In the MQTT sensor integration documentation, it even has a section for device, but even if you fill everything here out, and provide a unique_id, it’s ignored unless all being provided via MQTT discovery.

Why can’t I fill out the device section in a YAML file and create a device? I can publish the exact same info as a JSON payload to the discovery topic and create a device, I should be able to do this via YAML. Also, if I were able to do this via YAML, I should also be able to hot-reload the config and create the new device without a restart, since I can do this via MQTT discovery without a reboot.

Another extremely useful thing would be to be able lump template sensors in with the device they’re created from, or make a new device out of them. If I create a template sensor from a device, it becomes a stand-alone entity, not linked to that device. We really need a way to create and edit devices.

If this is implemented, one thing that would be very useful with this would be the ability to flag one of the entities as being the one that reports the battery level so it shows as the battery indicator on the devices tab.

This is handled by that entity being of device_class: battery, there’s no need to have any sort of ‘tag’ added, as that is precisely what device_class does.

1 Like

I wanted to post EXACTLY the same thing.
So i support this WTH 100%.

I have multiple devices using MQTT and I still don’t understand why device, uniq_id etc … are not used without discovery.

For multiple reasons I don’t use discovery. This would be really usefull for entity grouping, battery management, device poisitionning in rooms etc …