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

Template Warnings under 2021.10.x #36

Open
dmzimmerman opened this issue Oct 22, 2021 · 1 comment
Open

Template Warnings under 2021.10.x #36

dmzimmerman opened this issue Oct 22, 2021 · 1 comment

Comments

@dmzimmerman
Copy link

dmzimmerman commented Oct 22, 2021

The following warning appears (many times) under 2021.10, and says that the template will no longer work under 2021.12:

Template warning: 'float' got invalid input 'Not Charging' when rendering template '{% macro battery_level() %} {% for entity_id in states.group.battery_status.attributes.entity_id if ( not is_state_attr(entity_id, 'battery_alert_disabled', true) and states(entity_id) is not none and ( ( ( states(entity_id) is number or states(entity_id) | length == states(entity_id)| int | string | length or states(entity_id) | length == states(entity_id)| float | string | length ) and states(entity_id) | int < states.input_number.battery_alert_threshold_max.state | int and states(entity_id) | int > states.input_number.battery_alert_threshold_min.state | int ) or states(entity_id) | lower == 'low' or states(entity_id) | lower == 'unknown' or states(entity_id) | lower == 'unavailable' ) ) -%} {{ state_attr(entity_id, "friendly_name") }} ({{ states(entity_id) }}) {% endfor -%} {% endmacro %} {{ battery_level() | trim == "" }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2021.12

@zawias
Copy link

zawias commented Nov 19, 2021

I have the same problem in version 2021.11.4. Anyone know how to solve it?

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

2 participants