Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Battery Entity ID - Creates with Duplication of the word 'Battery' #630

Closed
5 tasks done
Roving-Ronin opened this issue Feb 24, 2024 · 1 comment
Closed
5 tasks done
Labels
bug Something isn't working

Comments

@Roving-Ronin
Copy link
Contributor

Describe the issue

Hi Thijs,

Assisting some other users I've created the custom senors to enable the battery / batteries Internal Temperature to be enabled as a sensor. However I note that the entity_id for these sensors now takes the format of 'sensor.battery_battery_1_temperature' and 'sensor.battery_battery_2_temperature'.

image

Could you please assist in fixing this, or give a heads up to where the code that is causing this is located (I've looked a few times through the libraries and can't see anything that makes sense to me).

Looking to get this fixed so these sensors appear automatically as:

Battery 1 - 'sensor.battery_1_temperature'
Battery 2 - 'sensor.battery_2_temperature'

or follow the new naming format introduced with v1.3.1, that would see them appear as:

Battery 1 - 'sensor.battery_temperature'
Battery 2 - 'sensor.battery_temperature_2'

I have just updated to v1.3.2 and tested this and it remains the same.

Thanks.

Bescribe your Huawei Solar Setup

Inverter Type: L1 or M1
Inverter Firmware version: Latest for L1 / M1
SDongle present: yes
Power meter present: three phase / single phase - Tested with both and get duplicated 'battery' in the entity_id
Battery: LUNA2000 xxkWh
Battery Firmware version: Latest

How do you connect to the inverter?

Via the SDongle, wireless connection

Upload your Diagnostics File

Drag & Drop your Diagnostics File here.

Upload your relevant debug logs

N/A.

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@Roving-Ronin Roving-Ronin added the bug Something isn't working label Feb 24, 2024
@wlcrs
Copy link
Owner

wlcrs commented Mar 12, 2024

Sensor ID's are automatically generated by HA based on what the user-facing name of the sensor is. In the past I had code to automatically append "#1", "#2" to sensor names when multiple inverters were present, but that was incompatible with how HA has implemented support for translation of sensors and thus removed when I added translations to this integration.

I would need to remove translation support to do anything about the issue you've raised, which I'm not planning to do. You can of course rename the sensors in your HA installation manually if that bothers you.

If HA ever adds support for providing 'hints' on how sensors should be named, I will revisit this issue.

@wlcrs wlcrs closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants