HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

Feature: Add support to friendly_name attribute

Open MiguelTVMS opened this issue 3 years ago • 1 comments

Add support to friendly_name attribute to sensor.

Describe the solution you'd like When the user adds upper case and spaces, create the entity id turning everything in lowercase, and convert spaces to underscore "_". For example, if the user named the device name as Office Desktop convert the entity_id it to office_desktop and add the attribute friendly_name as Office Desktop.

The payload to autodiscover could be:

{
  "availability_topic": "homeassistant/sensor/office_desktop/availability",
  "icon": "mdi:battery-charging",
  "unique_id": "office_desktop_battery_charge_status",
  "device": {
    "identifiers": "hass.agent-office_desktop",
    "manufacturer": "LAB02 Research",
    "model": "Microsoft Windows NT 10.0.22000.0",
    "name": "Office Desktop",
    "sw_version": "2022.12.0"
  },
  "friendly_name ": "Office Desktop Battery Charge Status",
  "state_topic": "homeassistant/sensor/office_desktop/office_desktop_battery/office_desktop_battery_charge_status/state"
}

This will help to have better naming of the Home Assistant devices and entities.

Describe alternatives you've considered You can even allow the user to choose both its entity_id and friendly name in the configurations.

MiguelTVMS avatar Aug 07 '22 09:08 MiguelTVMS

That's a good idea, thanks, will do :)

LAB02-Admin avatar Aug 08 '22 12:08 LAB02-Admin

I've created a ticket: hassagent-132

I'm closing this one to keep the github list tidy, but I'll report back here once it's implemented!

LAB02-Admin avatar Aug 14 '22 07:08 LAB02-Admin