Hi all,
Am a bit confused with a simple problem and was hoping someone would be able to explain it to me. I am using the life360 platform and looking at a way to show the “battery_charging” attribute as either “charging” or “not charging|” instead of the “true/false” (sounds simple right?).
Testing on the dev template I set this:
{{ states.device_tracker.life360_avani.attributes.battery_charging }}
Which evaluates as “False” which matches what I see in dev-states, though am not sure why it capitalises the first letter.
So to test my logic I set the following (again on the template editor)
{% if is_state('states.device_tracker.life360_avani.attributes.battery_charging', 'false') %}
not charging
{% else %}
charging
{% endif %}
the output I get is “charging” no matter to what I put as the state to test against. What am I doing wrong?