How to get Glances-data from InfluxDB to Hassio sensor

Hi,
I installed my HASSIO on an old HP laptop running Ubuntu.
I followed @frenck 's tutorial on youtube to the letter to get Glances running and storing it’s data in InfluxDB (in a database called “glances”). So far so good. Here’s a screenshot from Glances, showing battery-level 97 %:

31

And here’s the screenshot showing the sensor-data (97%) in InfluxDB, in “glances.autogen”, “localhost.sensors”, “Battery.value”:

What I like to do is to get the battery-level of my host (the Ubuntu-HP-laptop) into a home-assistant sensor, to trigger all kinds of automations.

I’m not a DB-expert, so I’m desperately struggling to get my HA-sensor “laptop-battery” connected to the InfluxDB database called “glances”.

33

This is my config named “laptop-battery.yaml”, which is based on the example in the HA-wiki, but unfortunately I can’t get it to work, so I must be doing it wrong:

platform: influxdb
host: a0d7b954-influxdb
port: 8086
username: glances
password: glances
queries:
    - name: laptop_battery
      unit_of_measurement: '%'
      value_template: '{{ value | round(0) }}'
      group_function: last
      where: '"name" = "Battery.value"'
      measurement: '"glances"."autogen"."localhost.sensors"'
      field: value
      database: glances

Anyone suggestions on how to get this working? @fredrike Much appreciated!