Adding multiple Smartphones to the configuration

Hi,
I am pretty nee to HomeAssistant - and running my Installation in a Debian based lxc.

Eversthing seems to be fine so far, but are the moment I struggle with one specific topic…

I am running the Smartphone App for android, and I’ve noticed that the battery indication is not working by Default in my Installation.

Therefore I’ve added the following Part to my configuration File:

sensor:
  - platform: template
    sensors:
      battery_phone:
        friendly_name: AndroidPhone Battery
        unit_of_measurement: '%'
        value_template: >-
            {%- if state_attr('device_tracker.xxxxx', 'battery_level') %}
                {{ state_attr('device_tracker.xxxxx', 'battery_level')|round }}
            {% else %}
                {{ states('device_tracker.xxxxx') }}
            {%- endif %}
        device_class: battery

and replaced the xxxxx with the device Name.
So gar, so good and it is running well…

But how can I add more devices?
What do I need to Change?

Any Help would bei much appretiated :slight_smile:
Thanks & with best regards

Hi all,
Another small issue I’ve noticed:

With adding the above Code to my configuration.yaml I also got the WiFi Connection Status.
But it seems, that this is just showing ‘disconnected’ even, If my Smartphone ist connected to a wifi network.

Do You have an idea?

Thanks & with best regards,
Chris

Which version of HA and the app are you using?

When you use the most recent version, the battery level should already be a separate sensor, no need for a template.
Do you see your phone under Configuration → Integrations → Mobile App?

This is impossible, the WiFi Connection status was there before, the template you posted can not create this sensor.

I’d try to remove the mobile app integration, delete the app, clear cache on the phone, set it up again.

1 Like

Hi,
Thanks for your reply.
I’ve redone the Server Installation right now and tried to add my Smartphone again.

HomeAssistant is running in Version 0.111.4

  • the Smartphone App has Version 1.9.0-167

Now I do have all entities… It seems that it Takes a few minutele and probably required a reboot

1 Like