Battery Status for laptop running Home Assistant OS

Hi,

I am trying to get the battery percentage of my laptop that is running Home Assistant OS. I am running Home Assistant Operating system directly on the laptop SSD. So, it’s not running as VM or in a docker container. The Home Assistant OS is the only OS running on the laptop.

I thought since Home Assistant OS is based on Linux, the Linux Battery add on should work. But after I added it, I don’t see any battery sensor.

I saw Device Bridge mentioned here in the forum, but not sure how it can be installed on Home Assistant OS. There is an add-on for home assistant but it requires that device bridge is already installed in the host system. The download page for device bridge gives a .deb installation file, can that be installed on Home Assistant OS?

Any help is appreciated.

2 Likes

Have the same issue / question. Any updates on this?

Did you find a way to show the battery information. On my laptop the battery sensor is created, however it shows 0 all the time. The only information that works is the “charging” / “Not charging”

EDIT: Found this on google. Works on my laptop

- platform: command_line
  name: systemmonitor_battery0_level
  command: "cat /sys/class/power_supply/BAT0/capacity"
  unit_of_measurement: "%"

and for charging status

  - platform: command_line
    name: systemmonitor_battery0_status
    command: "cat /sys/class/power_supply/BAT0/status"
4 Likes

Hi all
for your information.
The Linux Battery integration was introduced in Home Assistant 0.28

you need to specify de battery number, for exsample for me

- platform: linux_battery
  name: Host battery monitor
  battery: 0 <-- your battery number default is 1
  system: linux <-- linux is the default you can also not applie

to have all these information