H
HASS.Agentā€¢6mo ago
DrR0x

Command friendly name not working

Specs Version: 2023.11.1-ubeta The friendly name of commands is copied from the actual name always, therefore it is not modifiable. Steps to reproduce 1. Create new command(afaik any type is broken) and give it a friendly name that is different to the actual name 2. Store the command and reopen it 3. The friendly name has been changed to the actual name Images before & after storing
43 Replies
Amadeo
Amadeoā€¢6mo ago
reproduced on 2.0.0, gimme a sec
Amadeo
Amadeoā€¢6mo ago
so yeah... now I need to know when I broke it ok, the same is with last version edited by Sam, wonder how come
Amadeo
Amadeoā€¢6mo ago
GitHub
MQTT Discovery: friendly_name of json_attributes_topic is ignored (...
The problem In case of a mqtt discovery the friendly_name of a json_attributes_topic does not get picked up correctly (at least for a binary_sensor; I did not check other domains, but this will be ...
Amadeo
Amadeoā€¢6mo ago
now I'm sad damnnit I'll need to rething 2023.8 mqtt fix to fix the friendly name as the friendly name is now basically forced
Amadeo
Amadeoā€¢6mo ago
so yeah basically friendly names are no more kinda and I've found bug in HA, changing entity name updates it internally but not within the "device UI" after HA restart it updates properly
DrR0x
DrR0xā€¢6mo ago
Interesting, Ive added it to JIRA and I'll see what I can find
Amadeo
Amadeoā€¢6mo ago
this is going to give me some headaches I've "fixed" it already but the fix is jank and if I make it a proper fix
DrR0x
DrR0xā€¢6mo ago
Is it a client side problem?
Amadeo
Amadeoā€¢6mo ago
I'll need to spend "some" time getting the config migration sorted since "name" is going to become "entityName" and "friendlyName" is going to become "name" yesn't, since the 2023.8 there is practically no way to "set" friendly_name it always applies this logic
DrR0x
DrR0xā€¢6mo ago
Yeah just looked into that, but annoying Would the "name" just be in the list view on client side?
Amadeo
Amadeoā€¢6mo ago
no, the "name" would be the display name so entity would appear as "DEVICE <name>"
Amadeo
Amadeoā€¢6mo ago
example: https://b.chihi.ro/N7h0sm.png https://b.chihi.ro/pfDSYs.png and the backend discovery:
{
"icon": "mdi:chart-areaspline",
"unique_id": "43aa3bd7-2670-42ae-af14-9878d02e7c0f",
"object_id": "AMADEO-PC_cpuload",
"unit_of_measurement": "%",
"availability_topic": "homeassistant/sensor/AMADEO-PC/availability",
"device": {
"identifiers": "hass.agent-AMADEO-PC",
"manufacturer": "HASS.Agent Team",
"model": "Microsoft Windows NT 10.0.19045.0",
"name": "AMADEO-PC",
"sw_version": "2.0.0"
},
"name": "customcpuload2",
"state_topic": "homeassistant/sensor/AMADEO-PC/cpuload/state"
}
{
"icon": "mdi:chart-areaspline",
"unique_id": "43aa3bd7-2670-42ae-af14-9878d02e7c0f",
"object_id": "AMADEO-PC_cpuload",
"unit_of_measurement": "%",
"availability_topic": "homeassistant/sensor/AMADEO-PC/availability",
"device": {
"identifiers": "hass.agent-AMADEO-PC",
"manufacturer": "HASS.Agent Team",
"model": "Microsoft Windows NT 10.0.19045.0",
"name": "AMADEO-PC",
"sw_version": "2.0.0"
},
"name": "customcpuload2",
"state_topic": "homeassistant/sensor/AMADEO-PC/cpuload/state"
}
Amadeo
Amadeoā€¢6mo ago
this is the current state with the "jank fix" as I say "jank" because in code this change is reflected but in the saved sensors.json file:
[
{
"Type": "CpuLoadSensor",
"Id": "43aa3bd7-2670-42ae-af14-9878d02e7c0f",
"FriendlyName": "customcpuload2",
"UpdateInterval": 30,
"Query": "",
"Scope": null,
"WindowName": "",
"Category": "Processor",
"Counter": "% Processor Time",
"Instance": "_Total",
"Name": "cpuload",
"IgnoreAvailability": false,
"ApplyRounding": false,
"Round": null
}
]
[
{
"Type": "CpuLoadSensor",
"Id": "43aa3bd7-2670-42ae-af14-9878d02e7c0f",
"FriendlyName": "customcpuload2",
"UpdateInterval": 30,
"Query": "",
"Scope": null,
"WindowName": "",
"Category": "Processor",
"Counter": "% Processor Time",
"Instance": "_Total",
"Name": "cpuload",
"IgnoreAvailability": false,
"ApplyRounding": false,
"Round": null
}
]
it still uses name for entityName and friendlyName for name
DrR0x
DrR0xā€¢6mo ago
Wait but where is the name then? In a different view?
Amadeo
Amadeoā€¢6mo ago
what do you mean view?
DrR0x
DrR0xā€¢6mo ago
Like where do you see cpuload
Amadeo
Amadeoā€¢6mo ago
cpuload (the "entityName") is used to generate the object_id which then is used by HA to create entity name previously it was done with "name" but the "name" attribute in discovery config will overwrite everything due to 2023.8 mqtt changes
DrR0x
DrR0xā€¢6mo ago
Oh I see, but does that mean nowhere in the front-end it says "cpuload"?
Amadeo
Amadeoā€¢6mo ago
front end HA or HASS.Agent? the answer is yes in both cases but for which you're asking
DrR0x
DrR0xā€¢6mo ago
Well really both, so "cpuload" is more of a backend descriptor or something? I'm just trying to workout why we don't just completely remove the friendly name field and go with one single name that is duplicated?
Amadeo
Amadeoā€¢6mo ago
"friendly_name" as a payload attribute is gone with "the fix" as it does nothing HA just ignores it
DrR0x
DrR0xā€¢6mo ago
So are we going to get rid of the friendly name input box?
Amadeo
Amadeoā€¢6mo ago
but using only one "label" for the sensor command will mean you cannot have sensor.cpuload in as the entity name and "SomePC CPU Load" as the HA UI friendly name, it would be "SomePC cpuload" we need 2 labels, one with which user will be able to specift how entity (sensor.somethinh) will be named and the second where they'll specify how the sensor is displayed for example on dashboard
DrR0x
DrR0xā€¢6mo ago
Ah, that's what I was asking, okay makes sense now, that's exactly what I wanted šŸ˜‚ so basically the name is the ID and the friendly name is the entity name?
Amadeo
Amadeoā€¢6mo ago
currently yes
DrR0x
DrR0xā€¢6mo ago
And is that changing?
Amadeo
Amadeoā€¢6mo ago
good question depending on how I'll decide to approach the "jankyness" of the fix
DrR0x
DrR0xā€¢6mo ago
Oh okay, I get it now
Amadeo
Amadeoā€¢6mo ago
and how I'll make it compatible with previous config and it was supposed to be an easy fix šŸ˜„
DrR0x
DrR0xā€¢6mo ago
Don't šŸ˜‚ I mean if we have to then we create a script. That's what 2.0.0 means, there's gonna be difficulties upgrading. It's much more worth having features(especially one like a name šŸ˜‚) over ease of upgrade
Amadeo
Amadeoā€¢6mo ago
true dat so yeah, I think the best(questionable.net) approach is to make hass.agent aware of various config "versions" and allow it to migrate from older to newer not that I won't rewrite it with v3 and new UI but that's "some day, over the rainbow" šŸ˜„ not fully decided tho, there is also a half-jank way
DrR0x
DrR0xā€¢6mo ago
Well is there one script/file that runs to important changes, could you add a version number to the config file? Or its probably already there so then just check for it and run one of the 2 scripts depending on what version the previous config is. That way it's compatible with future version changes to the config system? Another option would just be to run a different script depending on the directory, because the old app is stored somewhere different to the new one right?
Amadeo
Amadeoā€¢6mo ago
the half-jank looks good config will stay the same but it will be parsed correctly by json library And this pr will bring a lot of internal changes overall in terms of naming, I need to verify this but I think the friendly name for satellite entities never worked (or I borked it somewhere down the line :d) nice, got the satellite service "friendly names" to work
Amadeo
Amadeoā€¢6mo ago
yeah, I did it
Amadeo
Amadeoā€¢6mo ago
mostly need to add some logic but the models are there
DrR0x
DrR0xā€¢6mo ago
Nice one, just much better in terms of UX
Amadeo
Amadeoā€¢6mo ago
god damnnit I think I've finally finished all migration/name compatibility code
DrR0x
DrR0xā€¢6mo ago
So in v2 the friendly name paramater will work right? As in if i set it to Gpu Temp It will show in HA as
Amadeo
Amadeoā€¢6mo ago
yeah