VAT is added to a negative price
VAT should be ignored when the price is negative because you are not paying taxes on negative prices (Atleast in Finland).
At the moment the price is displaying -0,43 cents but it should be -0,35 cents. -0,35 + 24% VAT = -0,43
VAT should be ignored when the price is negative because you are not paying taxes on negative prices (Atleast in Finland).
At the moment the price is displaying -0,43 cents but it should be -0,35 cents. -0,35 + 24% VAT = -0,43
Same for Sweden! VAT shouldn't be added when the price is negative.
In NL VAT has to be added to a negative price. (Price*1.21)
In my opinion you need to fully drop automatic vat calculation and ask people to use template instead.
In my opinion you need to fully drop automatic vat calculation and ask people to use template instead.
Agree, my price is spot price + 0,05 SEK and VAT should only be excluded if that goes below zero.
Better to add VAT as additional cost and add some examples in the documentation.
Any new commer want to take this one. https://github.com/custom-components/nordpool/blob/master/custom_components/nordpool/sensor.py#L294C1-L294C1
In my logic you can't omit VAT from negative prices.
If you omit VAT from negative prices the total VAT will be wrong. The VAT is added to the total sum you pay, so lets say your consumption was 5€ without VAT and you got 1€ back from the negative prices the VAT is added to 4€ so the price would be 4,96€ with VAT. If you add VAT to 5€ you get 6,2€ and you substract the 1€ you get 5,2€ which I do not believe is the case, you have to substract the 1,24€ with VAT to get the right answer. Example was calculated with VAT 24%.
Please correct me if I'm wrong.
I agree with @veista This is how it is at least done in Finland. All consumption is calculated VAT0% and to the sum of all VAT is added. so now when we had -50c/kWh negative prices in Finland for 9 hours all made money when using electricity and if I had from before used let's say 20€ worth VAT0% and now earned 5€ by using while price was negative I would end up with 15€ VAT0% to which 24% VAT would be added and the sum would be 18,60€
Code vise the calculation would need to be something like this (I'm not a programmer) IF spotprice > 0 THEN price = spotprice+VAT ELSE price = spotprice
Code vise the calculation would need to be something like this (I'm not a programmer) IF spotprice > 0 THEN price = spotprice+VAT ELSE price = spotprice
I think it is the same here in Sweden. You forgot addtional costs (if any are defined) though
cost = (spotprice + additional_cost) * VAT if spotprice + additional_cost > 0 else: spotprice + additional_cost
It is not that simple in Finland either: VAT is not necessarily calculated hourly but from the total of the invoice (month). Only if the invoice total is negative then VAT is 0. Interpretation varies between companies so this is something that should be configurable or done by templates.