DarwinsBuddy / WienerNetzeSmartmeter

A home-assistant integration supporting WienerNetze Smartmeters as sensors
121 stars 12 forks source link

Statistics Import Stops Working after Renaming Statistics Entity #218

Closed realk1ko closed 4 months ago

realk1ko commented 4 months ago

I've had some issues during the setup the past few days as I assumed that the created sensor entities can be renamed. That doesn't seem to be the case however.

Steps to reproduce:

Result:

maia commented 4 months ago

Probably related: If you have a "Spitzname" in https://smartmeter-web.wienernetze.at/#/anlagedaten, when installing the integration the created sensors will be named by this "Spitzname". But another part of the integration uses a hardcoded name for the sensor sensor.{zaehlpunktnummer}_statistics, without looking up the "real" name. So whenever you rename your sensor or it is created with a name and not a zaehlpunktnummer, you will run into issues until the other part of the integration does not assume the sensor name is always sensor.{zaehlpunktnummer}_statistics. @DarwinsBuddy I believe I mentioned this to you some weeks ago, but I didn't create an issue back then, so here it is. :)

As for the negative consumption, I'm also seeing this issue, but currently I do not have renamed sensors, so it might be unrelated. See #217.

DarwinsBuddy commented 4 months ago

@reox already suspected potential issues with this labeled name as he implemented the statistical import. I guess it has more value to have a consistent name than a mirrored label from WienerNetze. Especially when you can create a label yourself within HA.

I'll remove this functionality in the next release