-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix home assistant complaining GBP/kWH is an invalid currency #77
Conversation
fix home assistant complaing GBP/kWH is an invalid currency
Thanks - I thought I had fixed that. |
@ColinRobbins this is a different line 😆 |
@ColinRobbins if you dont change |
I don’t think this is right. |
Which page / card are you looking at when you see the console error? I’m not seeing anything in my console! |
EDIT: uploading right picture does help haha this is just a standard entities added to my home dashboard
EDIT AGAIN: i dont believe the kWh is needed as thats being used/calculated in the energy tab and not on the standard dashboards |
Ah, OK. |
Sorry, device class, not state class - corrected post above. |
Not sure I can see anything better than “DEVICE_CLASS_ENERGY” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than changing line 336, I suggest trying adding the following at line 332:
@property
def device_class(self) -> str:
"""Return None as the device class."""
return None
I've tried it on my test systems, and it seems to solve the issue. I think anything other that None will case issues somewhere.
@ColinRobbins im keeping my pi running for now with this patch set as GBP |
With it set to GBP, you will not be able to add it as an |
surely the |
i currently have mine set to |
If you look at the code in |
The energy dashboard documentation gives an example in ‘USD/kWh’, not ‘USD’. |
@ColinRobbins if you look at the developer docs too for the sensor entites it says the values need to be either |
We’ll have to agree to differ, and let HandyHat decide which approach to take. |
Revisiting this, I think if you use “rate” in the energy dashboard with GBP as the unit, this PR will lead to the error…
Hence why I believe the current units are correct at GBP/kWh. |
Where are you seeing this error? I've had no issues/no errors with this pr on my pi for awhile now? |
This error is in the HA Logs. |
The error occurs if you use the current tariff rate sensor for “use an entity with the current price”. |
Don't mean to intervene but I am with @ColinRobbins on this one. Here is my reasoning:
So i can confirm changing tariff rate (the entity refered in this PR) to GBP and using it for Energy will error later.
PS: I have landed here by basically discovering the same error in the console, see here #88 (comment) |
Thank you for the insightful discussion here everyone! |
Description
fix home assistant complaining GBP/kWH is an invalid currency
Motivation and Context
How Has This Been Tested?
Types of changes