nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

Negative values to additional_costs

Open djjassu opened this issue 1 year ago • 1 comments

Nowadays quite many sell the solar panels overhead back to grid. Atleast here in Finland the price is VAT 0 and it is deducted with a negative marginal (in my case -0.3 c/kWh).

It seems that configuration value to Homeassistants Configuration.yaml wont handle negative values?

If added :

additional_costs: "{{-0.003|float}}"

... that will still add it to the price as a positive value. Could that be allowed to the formula, or is there a workaround?

djjassu avatar May 10 '24 06:05 djjassu

I have negative additional costs sometimes and it works. Remove the double quotes: additional_costs: {{ -0.003|float }} and try adding parentheses (-0.003)|float. Or use variable:

{% set margin = -0.003|float %}
{{ margin | float }}

mikak avatar May 13 '24 07:05 mikak