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

Could not convert string to float #213

Open
Wopples opened this issue Nov 1, 2024 Discussed in #211 · 0 comments
Open

Could not convert string to float #213

Wopples opened this issue Nov 1, 2024 Discussed in #211 · 0 comments

Comments

@Wopples
Copy link

Wopples commented Nov 1, 2024

Discussed in #211

Originally posted by Wopples October 23, 2024
Here's my template:

{% set s = {"B": 13.72,"C": 1.220,"D": 13.72,"E": 0.830,"CF": 0.3333,"CP": 128.99,"ENV": 1.0195,"BHE": 10.89,"WKK": 5.04,"BA": 12.3606,"BTW": 1.21 } %}
{% if states('calendar.belgium') == 'off' %}
  {% if now().isoweekday() < 6 %}
    {% if now().hour >= 7 and now().hour < 22 %}
      {{((s.B+s.C*((1-s.CF)*current_price+s.CF*s.CP))*s.ENV+s.BHE+s.WKK+s.BA)*s.BTW | float }}
    {% endif %}
  {% endif %}
{% else %}
  {{((s.D+s.E*((1-s.CF)*current_price+s.CF*s.CP))*s.ENV+s.BHE+s.WKK+s.BA)*s.BTW | float }}
{% endif %}

It works in the developer tools template but when I paste it in in the Entso configuration it returs an error: "could not convert string to float".
What am I missing?
Thanks for any help.

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

1 participant