point 1
The current behavior is inconsistent, depending on whether an entity is assigned to a device or not.
point 2
Due to point 1, adding device to existing entities, breaks current entity naming, thus HA instance.
point 3
There is arbitrary naming way, not giving instance owners to decide about entity names and friendly names
point 4
Points above leads to unreadable representation in GUI (ie Device page)
Current state
if name and device are provided
the friendly name will be <device_name> <name>
the entity name will be <device_name>_(normalized_name) - where normalized name is the original name converted to match lowercase alphanumeric characters and underscore pattern
if object_id, name and device are provided, it ignores object_id, applying naming as above
You can edit both friendly name and entity name in the UI, provided the entity has an “unique id”, which is then, well, the unique identifier of that entity.
I don’t want to edit anything manually.
I’m asking for ability to set it up in yaml.
Actually it worked as I need until I’ve added devices. Since that it’s generates names I don’t want. Example with 3 the same friendly names is extreme example of how bad it’s executed
Not a chance anything will be added back to YAML.
If you want to change in code, do it in .storage/core.config_entries. Unsupported, so at your own risk.
Why? Isn’t HA still evolving?
While there is a trend to provide GUI functionality, yaml is not abandoned afaik. until mqtt entities can be officially created with use of yaml (there are obvious benefits if one chooses this way), it might be subject for improvement always. Isn’t it?
At least there is a serious bug in how it works right now, which should be looked at.
It doesn’t make sense.
I want to control my entities just by editing them in yaml and getting the job done. No additional steps are needed. This is one of the reasons of using yaml.
AFAIK it can be achieved with mqtt discovery. But this is like scratching behind the left ear with the right hand
Anyway, I was raising the issue. I’m not asking for “if it will be resolved”.
Please do not downvote it by saying it cannot be done, it’s not gonna be done etc. I put different questions.
Integrations that communicate with devices and/or services are only configured via the UI. In rare cases, we can make an exception.
Tell me how can I create mqtt entity using GUI. None? Then it’s space to make the exception.
4 years after this document was created, yaml-based mqtt entities still are supported. If supported, and some shortcomings are found, they deserve to be worked on. This is what I’m asking for.
A lot of things were stated as impossible in the past, but then changed (or at least some of them changed their mind about impossibility). So let this question open, please.
You can only upvote a WTH, there’s no downvote button. And anyone can voice their opinion, no? That doesn’t necessarily affect what the devs do with the request.
Maybe I’m taking crazy pills here but I’ve never had a problem with this, I always supply unique_id, object_id, device name, and name. The configuration always takes all 4 and properly uses them without overwriting anything.
Discovery? Where can I get this info from to verify?
You know… I’ve never had problems with yaml mqtt. I started to used devices not long ago. And didn notice such thing. but with this particular device HA makes up unexpected names. (stripping phase X out of initial text)
So this is real example. I’m adding just another yaml entries to existing device (see unrealistic phase number).
So it’s either build the friendly name from device name and entity name, or just makes up the name from unknown pattern (without phase X - see example with phase 6)
entity_id of sensor.shelly_3em_phase_1_power because of object_id: "shelly_3em_phase_1_power". The device name will be Shelly 3EM MainHouse because of device: name: "Shelly 3EM MainHouse" and the friendly_name will be Shelly 3EM MainHouse Shelly 3EM Phase 1 Power because of name: "Shelly 3EM Phase 1 Power"
The naming structure in all of HA, not just MQTT is:
DeviceNameEntityName for friendly names of entities. If the DeviceName is in the EntityName, your entity_id and Friendly Name will have double DeviceName. The entity_id is derived from the resulting Friendly Name.
MQTT has the unique ability to override the entity_idin all cases by supplying object_id.
First to say: I really appreciate you entered discussion about this problem. Thank you.
Yes I know that.
It’s all might be generalized to a request to allow overriding the friendly name from yaml too. (I remember there were such requests in the past)
Still we don’t know answer, why Phase X is being stripped from friendly name. It seems like a bug. it looks like Device Name Device Class. Or I’m overlooking something.
PS. I have no certainty about phase 1 entity is not touched through GUI. This is why I’m creating examples with further phase numbers.