I’ve developed my own PCB that serves as a LoRa-To-MQTT gateway, which also provides some metrics and control options via MQTT and I wanted to simply add it to HA to control it. Of course, I have all the entities (switches, numeric states, etc.) in HA and can use them, put them on a dashboard etc etc. But I wanted to “group” them together under a device, but that doesn’t seem to be possible in HA, neither via the UI, nor via YAML. Or I’m just blind It really seems only integrations can add devices, or put differently: A device ALWAYS has an integration.
Is there really no way to type a device in YAML and tell which entities belong to it? Like this (totally making this up):
It’s not possible. The only way you can do this with yaml is by setting up everything in MQTT, but the entities need to be in MQTT as well. You can’t add entities from other integrations.
I’m assuming you’re feeling stuck when automating? If that’s the case, keep in mind that everything can be done without a device. You just need to use the other trigger, condition, and action options.
Hrrrmmmm, these are all MQTT entities. That’s a good lead actually! I can add them via the MQTT integration. I was used to type my entities by hand into the YAML and add them that way. But I can certainly use the MQTT integration and get them as a device that way! I may even do a proper MQTT discovery support; the software on that ESP is my own anyways, so I add that! Thanks for the lead!
Nah it was not related to automations. Just not having one place in HA that has all the entities for that one device! They are just entities right now and I need to search for them to see them all. Instead of going to devices, click the device, get the nice device view with the related entities, etc.
STILL: I think this could be a nice and easy addition to HA to configure devices manually via YAML and simply list the entities that belong to it. Maybe somebody finds that useful and has time to build it
Nice, then it seems easy for you. Just take a look at the examples hasqt posted for MQTT discovery. It’s essentially the same as a configuration, except it’s an automation that runs at startup.
I like the idea to be able to define a device and configure entities belonging to that device.
Actually I have entities defined for a modbus integration and would like to define a Device they are belonging to. Any idea how to accomplish that with the current HA implementation are highly appreciated.
has anything changed here? Got a wifi device that provides functions and sensors via a rest api and I would look to bundle them in HA together to a device …
I did see a reference to a HACS integration allowing that and even more. It is in early development stage. However so far, I was not able to set it up via HCAS (not found when exploring HACS integrations). Device tools for Home Assistant