Skip to content
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

Negative values to additional_costs #380

Closed
djjassu opened this issue May 10, 2024 · 1 comment
Closed

Negative values to additional_costs #380

djjassu opened this issue May 10, 2024 · 1 comment

Comments

@djjassu
Copy link

djjassu commented May 10, 2024

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?

@mikak
Copy link

mikak commented May 13, 2024

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 }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants