Make a sensor entity for the battery level of my phone

I’m trying to make a sensor entity for the battery level of my phone.
in the state page i have
device_tracker.life360_rpal with the battery level in the attributes
i’v add those lines in the configuratin.yaml

sensor:
  - platform: template
    sensors:
      refael_battery:
        friendly_name: refael Battery
        unit_of_measurement: '%'
        value_template: '{{ states.device_tracker.life360_rpal.attributes.battery|round }}'

restart HA but dont see sensor for the battery level in the state page.
what do i miss?

Refael

1 Like

Are there any error messages in Home Assistant’s system log?

I wouldn’t know how to even start understand the log
but here it is.
if you wonna help, i’l be glad
Refael
system log.yaml (32.2 KB)

does your value_template work on the templates page in homeassistant (with the external single quotes removed)?

Once working in there, it should work in a sensor.

image

Seriously?

Error saving event: <Event state_changed[L]:
Error executing query: (sqlite3.DatabaseError) database disk image is malformed
Error saving event: <Event state_changed[L]:
Error executing query: (sqlite3.DatabaseError) database disk image is malformed
Error doing job: SSL error errno:1 reason: SSLV3_ALERT_CERTIFICATE_UNKNOWN
Error doing job: SSL handshake failed
Error saving event: <Event state_changed[L]:
Error executing query: (sqlite3.DatabaseError) database disk image is malformed
etc

Hint: It contains errors.

I suggest you shutdown Home Assistant, delete the following file home-assistant_v2.db then restart Home Assistant. Then check the system log for any new errors.

I doubt some people would understand much about this at all. These aren’t the old days where delving into the system to understand it meant making it work. A lot of people like the simplicity of click and forget.

It clearly contains the word “Errormany times meaning something is failing repeatedly. I think most people know the definition of the word “Error”.

These aren’t the old days where delving into the system to understand it meant making it work.

If you think looking at the system log is “delving into the system” then you’re not going to enjoy using Home Assistant.

A lot of people like the simplicity of click and forget.

Me too but Home Assistant isn’t that (yet).