Android device Battery Level with Owntracks over mqtt is always 0

Hi everyone!
I have set up my HA to recieve gps data of my device from Owntracks with mqtt.
Now here is my sensor config:

sensor:
- platform: mqtt
  name: Andrews Smartphone Battery
  state_topic: "owntracks/andrew/gps"
  value_template: '{{ value_json.batt }}'
  unit_of_measurement: "%"
  device_class: battery

ui-lovelace part:

- type: entities
  title: Info
  show_header_toggle: false
  entities:
  - sensor.andrews_smartphone_battery

But here is what I see in ui:
30 PM

and:

The phone shows 86% battery level
what is wrong with this setup? Please help. Thank you.

Ok, so it appears that this hassio mqtt sensor for some reason does not work with encrypted payload. Once I disable encryption by simply removing the symmetric encryption key from owntracks android app, which, btw, I get from hassio owntrack integration, the battery level showed up in ui.

Now there are a couple of questions:

  • As I understand, hassio successfully decrypts messages, because I get the correct device gps location info and waypoints from owntrack; so why it cannot get the decrypted battery info then? Is there a way to make it work without disabling encryption?
  • should I disable encryption and rely on TLS only?
  • should I configure my mosquitto broker hassio addon to decrypt messages before distributing them (and if it is possible at all), so the payload will be encrypted at least when message goes through internet to my broker?

Any ideas are highly appreciated.

Thank you.

Did you solve the problem?

It seems to have something to do with the app. I Receive data from 2 cell phones. With one it works, with the other I don’t see a battery either.

I just do not use owntracks any longer…