Battery state: unavailable

Hey guys,

Battery state of my iPhone is unavailable from January 2nd.

Don’t know why, don’t know what caused it and don’t know how to resolve it.

I removed and added the phone from HA, no change.

Does anybody know what I could try to maybe resolve this issue? I reckon it must be easy :wink:

Thanks in advance!

  1. Do you mean “Mobile App” integration?
  1. How did you do that?
  2. Are other entities provided by this integration properly (at least sometimes) updated in HA? Double check this.
  3. What is a current exact state of your “battery state” entity? Post a screenshot of this entity from Dev tools. Make 100% sure that you select the same entity with same entity_id which is shown on your screenshot from the 1st post (because may have have several entities with similar names).

Hey Ildar,

First of all thanks for trying to help me! Much appreciated.

  1. Yes, through the integration!
  2. Pressed the 3 vertical dots and clicked delete.
  3. Yes, they are. For example: Battery Level, Connection Type, Distance, Geocoded Location, etc.
  4. Unavailble.

Screenshot:

  1. Go to Settings → Integrations.
  2. Select MobileApp → your phone device.
  3. The device has assoc. entities. Find your faulty entity and find out it’s entity_id - is it same as on a posted screenshot?

If you are 100% sure that the “unavailable” entity belongs to the same device which contains working entities, suggest to register an issue.

I’m 100% sure.

Strange thing is that I can see the battery state of my wife’s iPhone.

Register an issue at HA I assume?

I think so.

Is there any update on this?

I wish to use my phone’s battery state in an automation ( charging/discharging ).
In the developer tools this is shown correctly.
But in an automation the state’s options are Unavailable and Unknown.
(The same is true for my android tablet.)

1 Like

same here. Any updates?

@nuno-21902803 I’ve created sensors to overcome the problem.
Here’s what I’m using (it’s probably more complicated than it needs to be but it works!)

  • sensor:
    • name: “G phone battery state”
      state: >
      {% set pstate = states(‘sensor.sm_a15_phone_battery_state’) %}
      {% if pstate == “charging” -%}
      {% set pstate1 = 1 %}
      {%- else -%}
      {% set pstate1 = 0 %}
      {%- endif %}
      {{ pstate1 }}