Platform: linux_battery - No battery found

Hi,

Running Ubuntu server 20.4 and hassio on laptop with battery
trying to set linux_battery get error in info: No battery found

how can i read the battery level of the laptop that running the system ?

If I were you in your situation, I would take a gander at the source code to determine what it is looking for.

You can see that you are erroring right here.

The code states it is looking under /sys/class/power_supply/BATxxxx and it is not able to find it for one reason or another.

Note that it is expecting a battery_id.

Based on that, what is your configuration you are supplying?
What is in the directory /sys/class/power_supply/???

Okay so as I mentioned, did you supply the following in your configuration?

# Example configuration.yaml entry
sensor:
  - platform: linux_battery
    battery: 0

As you can see in the short documentation for Linux battery, “battery integer(Optional, default: 1)” where your battery is number 0 and not 1!

image

1 Like

still get:
image

was this ever resolved? it doesn’t show up here either.