WTH Why is it so hard to add an MQTT entity that's not autodiscovered?

I find it hard in Home Assistant to create a device & entities for something which is sending MQTT data. Home Assistant MQTT broker has the entity values.
A quick ‘create MQTT entity’ and ‘create MQTT device’ with specifying the topic/prefix would be amazing.

Similarly, grouping multiple entities as a ‘virtual device’ for cases like RESTful commands used.

It’s hard because it supports a lot of options.

2 Likes

@Mark_M FYI, I use Node-Red to add/delete virtual MQTT devices. Check an example I posted if you’r interested.

I could explain/share the code if you’r interested?

Maybe I’m wrong.
But is your need really about discovery? Or maybe you simply want to create a device consisting of mqtt based entities?

Asking, because the latter can be achieved without discovery, simply by yaml configuration.

Discovery is useful for entities creation in automated way usually used by 3rd party apps, while they decide what topics they create and then passes this information to HA using discovery mqtt topics.

1 Like

Do you have an example of that?

Tried suto discovery as well, but the registration process is not clear for me. (Looks very complicated) For now i managed to get topic values into helpers, but want to load them in a virtual device

tents of them. most my devices are wired through mqtt if possible.
Here is my package for Shelly PlugS.
Note that only one entity has a full device description. Others reference the device via its identifier

pck_socket3:
  mqtt:
    switch:
      - name: "Socket 3 State"
        unique_id: plug_bedroom_ctrl
        state_topic: "shellies/shplug-3/relay/0"
        command_topic: "shellies/shplug-3/relay/0/command"
        availability_topic: "shellies/shplug-3/online"
        payload_available: "true"
        payload_not_available: "false"
        payload_on: "on"
        payload_off: "off"
        device:
          connections: [["mac", "3CAAAAAAAAAA"]]
          name: "plug_bedroom"
          configuration_url: "http://192.168.107.50"
          manufacturer: "Allterco Robotics Ltd."
          model: Shelly PlugS (SHPLG-S)
          suggested_area: Bedroom

    sensor:
      - name: "Socket 3 Power"
        unique_id: plug_bedroom_power
        state_topic: "shellies/shplug-3/relay/0/power"
        availability_topic: "shellies/shplug-3/online"
        device_class: power
        unit_of_measurement: "W"
        payload_available: "true"
        payload_not_available: "false"
        device:
          connections: [["mac", "3CAAAAAAAAAA"]]

      - name: "Socket 3 Temperature"
        unique_id: plug_bedroom_temperature
        state_topic: "shellies/shplug-3/temperature"
        availability_topic: "shellies/shplug-3/online"
        unit_of_measurement: "°C"
        device_class: temperature
        payload_available: "true"
        payload_not_available: "false"
        entity_category: diagnostic
        device:
          connections: [["mac", "3CE90ED7CBAC"]]