home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.81k stars 30.51k forks source link

Utility Meter - Created Entities Ignore Friendly Name #128198

Open PSXDupe opened 2 weeks ago

PSXDupe commented 2 weeks ago

The problem

I am creating a Utility Meter helper in the configuration.yaml file with the following code.

utility_meter:
  energy_grid_import_today:
    name: Energy Grid Import Today
    source: sensor.grid_import_today_f
    cycle: daily
    tariffs:
      - Peak
      - Off-Peak
    unique_id: 22b7da94-805a-4b58-820e-31e6289ba23f

The two sensor created for Peak & Off-Peak are named correctly, however the created "Select" entity does not use the Friendly Name. These are the entities created with the above code.

energy_grid_import_today
Energy Grid Import Today Peak
Energy Grid Import Today Off-Peak

I would have expected "energy_grid_import_today" to be named "Energy Grid Import Today" but its not.

What version of Home Assistant Core has the issue?

2024.10.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

utility_meter:
  energy_grid_import_today:
    name: Energy Grid Import Today
    source: sensor.grid_import_today_f
    cycle: daily
    tariffs:
      - Peak
      - Off-Peak
    unique_id: 22b7da94-805a-4b58-820e-31e6289ba23f

Anything in the logs that might be useful for us?

No response

Additional information

If I remove the tariffs section, the code will create a sensor with the correct friendly name.

It seems to be an issue when specifying tariffs.

home-assistant[bot] commented 2 weeks ago

Hey there @dgomes, mind taking a look at this issue as it has been labeled with an integration (utility_meter) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `utility_meter` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign utility_meter` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


utility_meter documentation utility_meter source (message by IssueLinks)

dgomes commented 2 weeks ago

Thanks, the linked PR should address the issue