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

I can't work this out, sorry :( #39

Open
doubledrat opened this issue Jan 1, 2025 · 1 comment
Open

I can't work this out, sorry :( #39

doubledrat opened this issue Jan 1, 2025 · 1 comment

Comments

@doubledrat
Copy link

doubledrat commented Jan 1, 2025

I've added your code as described to a dashboard, but none of the battery information shows.

It shows up in my overview though. Any idea what I'm doing wrong?

The config showed up, but nothing else -

image

@doubledrat
Copy link
Author

would these errors stop things working?

Error in 'condition' evaluation: In 'template' condition: ValueError: Template error: int got invalid input 'full' 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) or is_state_attr(entity_id, 'restored', 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
Error in 'condition' evaluation: In 'template' condition: ValueError: Template error: int got invalid input 'full' 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) or is_state_attr(entity_id, 'restored', 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
Error in 'condition' evaluation: In 'template' condition: ValueError: Template error: int got invalid input 'discharging' 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) or is_state_attr(entity_id, 'restored', 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
Error in 'condition' evaluation: In 'template' condition: ValueError: Template error: int got invalid input 'discharging' 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) or is_state_attr(entity_id, 'restored', 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

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