-
Notifications
You must be signed in to change notification settings - Fork 14
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
Electricity price in cents instead of euros #20
Comments
Making the unit selectable might not be possible or might create more confusion than it helps. For example I think that changing unit of "SHF Max Price allowed" slider is not possible dynamically. Or if it is, then please tell me! |
I would also like to have prices in cents, would it be possible to make second branch or something for that? |
There is a fork which seem to be in cents. I haven't tested it, but maybe it's useful for you? |
Maybe voting would be best way to settle this. So please react to this comment with following emoji:
Emojis were selected due to their availability on one of the internet forum where quite many of the Finnish users are. |
I vote for euros. Reasons:
|
And a disclaimer: c/kWh should have majority of votes in order for the change to happen. Because if 50% vote yes and 50% vote no, then 50% of people will have to make dramatic changes to their current implementation and the number of unhappy people would stay roughly the same. Also new pros/cons (like dillonfi's) are highly appreciated and will affect the final decision. |
Oh, I didn't check whether browsers affect this or not and I made too quick conclusions before investigating. It seems that Firefox for some reason is very strict about this "step". Or stricter than Chrome. Anyway, after realizing this, I have two workarounds for you:
I would like to know whether either of these workarounds ease your pain with this. What comes to the original problem: I would recommend creating an issue on Home Assistant repo or asking about this issue on https://community.home-assistant.io/ about this. For me it doesn't make sense to restrict numeric state trigger to be only usable with one decimal as the sensors might give outputs with arbitrary number of decimals. Does this make sense? |
Third possible workaround: use Input Number helpers where you could set €/kWh values like 0,1234 and then use Numeric state triggers configured to trigger based on another entity (this setting is called "Numeric value of another entity"). |
I did some research and learned something new. It is possible to use anchors and aliases in YAML to reuse certain set values which makes it easy to change "€/kWh" to "c/kWh" for example in the YAML file even though Home Assistant doesn't allow templating unit_of_measurement fields. So please check https://github.com/T3m3z/spotprices2ha/tree/currency_unit and change rows 9-11 of spot-price.yaml according to your needs. This change needs testing before I can merge this into main branch. So it would be nice if you could do some testing and report findings here. |
I'm getting an error when checking the config: This is probably related that I have in my
So I have packages -folder where I have a file called Any idea if I can get this to work with such syntax? Should I move the shf_config to configuration.yaml? |
The error you see is actually caused by my code. Somehow (maybe through Home ASsistant CLI) I was able to make those changes and restart HomeAssistant. That just caused some errors on the log. The problem is that HomeAssistant tries to interpret that "shf_config" part on spot-price.yaml as an integration (which it is not). I have an idea how to fix this. I will make an update to the repo soon (need to do some houshold chores etc. normal life first :) ). |
I have now made an attempt to fix this @oskari . So please check https://github.com/T3m3z/spotprices2ha/blob/currency_unit/spot-price.yaml My previous attempt was flawed. Now it should work. Just follow the instructions starting from row 8 (basically just altering price_factor on row 41, energy_price_unit on row 70 and currency_unit on row 200. Please note that changing units on the fly will cause some logged errors/warnings related to statistics integration. I haven't yet investigated how much they cause harm (if any). |
I think we need to use edit: My price1 is wrong, but I think the issue is valid. |
Sorry for the delay. Everyday life has been my priority one lately. Your point was valid. Price1 and Price2 got multiplied mistakenly with price_factor even though they were already cents. I have corrected this now: https://github.com/T3m3z/spotprices2ha/blob/currency_unit/spot-price.yaml#L53 Sorry for the bug and thank you for reporting it. |
The one big problem I have with SHF using euros instead of cents is that:

a) 15 Cents per kwh is easier to communicate than 0.15 euros per kwh
b) HA automation fields don't support decimals. Let's say I want to check if the price is below 15 cents to charge my car. Have to make it a custom sensor or use templates. Rather just use the visual automation maker
Maybe an option on which unit to use? Or just use cents always?
The text was updated successfully, but these errors were encountered: