Should I Upgrade from 49.1 to newest Home Assistant

OK I didn’t load that on my main HA I had a copy I installed 1.6.1, On that and going to check for a few days but every thing is working good right now.

1 Like

@pnbruckner I have been setting things up and having a little trouble with a battery sensor
on your newest release it is

- platform: template
  sensors: 
    dee_batt_lvl:
      value_template: "{{ state_attr('device_tracker.life360_dee', 'battery') }}"
      unit_of_measurement: '%'
      icon_template: >
        {% set charging = state_attr('device_tracker.life360_dee', 'battery_charging') %}
        {% if charging is none %}
          mdi:help
        {% elif charging %}
          mdi:battery-70
        {% else %}
          mdi:battery-charging-60
        {% endif %}

but it does not load can it be done?

When you say “newest release”, what exactly do you mean? 2.8.0? 2.9.0bx? 1.6.1? …? And the “stock” version, or with modifications to run on the old version of HA?

Assuming you do mean 2.8.0 (or I suppose 2.9.0bx), then what you have there looks ok. What exactly do you mean by “does not load”? Are there any errors shown anywhere?

@pnbruckner I have HA 89.1 running and all it has running on it is your life360 and lovelace I used the config for the battery sensor from that one put it on the HA 0.49.1 with your 1.6.1, It doesn’t show the battery level I’m sure something changed from the 1.6.1 version to 2.8.0
I seen you made a change from battery_charging to charging

2019-03-13 21:39:47 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template dee_batt_lvl: UndefinedError: 'state_attr' is undefined
2019-03-13 21:39:47 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render icon template dee_batt_lvl: UndefinedError: 'state_attr' is undefined

Yes, in 2.2.0 it changed from charging to battery_charging. But that’s not what the error says. It says state_attr is undefined. Did that jinja function not exist in 0.49.1???

well I’m not sure I’ll keep checking I found a post about it but it jumps from 2016 to 218 in just a few lines but I’ll keep checking maybe state_attr needs to be state_attributes??
Thanks again for your help.

@pnbruckner

HI Phil sorry I got busy, I did find my HA 0.49.1 is running jinja2, 2.9.1 and did find out the state_attr. is supported, I must have to word it differently.

Well, that’s very strange then. I don’t see anything wrong with what you wrote, assuming, of course, state_attr is indeed implemented (which the errors seem to imply is not the case.)

Anyway, you could always try using states.device_tracker.life360_dee.attributes.battery_charging instead.

If stuff works as you want, do not upgrade

Thanks Phil that worked