Give Integration integration support for unique_ids

The “platform: integration” allows us to take a sensor which only reports in “W” for power monitoring, to create a new sensor that can report “kWh” which allows it to be used in the Energy Usage Dashboard.

Such as:

- platform: integration
  source: sensor.kitchen_coffee_pot_power_meter
  name: kitchen_coffee_pot_power_energy
  unit_prefix: k
  round: 3

Resulting in:
energy_usage_ha

I want to define a friendly_name attribute such as “Coffee Maker” that can be displayed in the Energy Usage Dashboard, but the integration does not allow it. I want to give all of these a more useful name.

Feature request to allow the Integration integration to accept a friendly_name attribute.

In case you don’t know, you can give a “friendly” name to the sensor via name:, and the entity ID will be auto-generated based on that.

So your request only make sense if you want the name and the entity ID to be completely different.

Thanks for the response… I was keeping the name based on the sensor it was derived from, but I guess I can use the source attribute for that.

The negative to renaming is that it seems I have to start over with the power monitoring data. I think it would still be nice to have a friendly_name which could be changed in the front-end without loosing all the data associated with it.

So I updated my configuration:

- platform: integration
  source: sensor.kitchen_coffee_pot_power_meter
  name: "Kitchen Coffee Pot"
  unit_prefix: k
  round: 3

Which when viewed in developer tools shows me, a friendly_name was automatically generated:

state_class: total
source: sensor.kitchen_coffee_pot_power_meter
unit_of_measurement: kWh
friendly_name: Kitchen Coffee Pot
icon: mdi:chart-histogram
device_class: energy

If I try to define my own friendly_name as such:

- platform: integration
  source: sensor.kitchen_coffee_pot_power_meter
  name: "Kitchen Coffee Pot"
  friendly_name: "Kitchen test Coffee Pot"
  unit_prefix: k
  round: 3 

Then do a Server Controls > Check Configuration, it’s invalid:
ha_invalid_config

Is this more of a bug vs a request for something new?

friendly_name is not an allowable attribute. If it’s not listed in the docs, it’s not possible. The functionality you are looking for is

“Give Integration integration support for unique_ids”

With that feature request, you can have exactly what you want using unique_id and name.

@petro - Thank you, thread name changed to be above.

@reefland - I managed to get the friendly_name changed using the customize entity method. If you use the UI, you can choose “Other” and type “friendly_name” as the attribute.

Thanks, I looked at that but didn’t see “friendly_name” listed in the screen, didn’t think to try “Other”. Good tip.