I followed home assistant battery configuration
# Loads default set of integrations. Do not remove.
default_config:
# Example configuration.yaml entry
sensor:
- platform: linux_battery
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
restarted home assistant:
$ sudo docker stop homeassistant
homeassistant
$ sudo docker start homeassistant
homeassistant
$
here is my battery information:
g$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: Hewlett-Packard
model: Primary
power supply: yes
updated: Sun 09 Nov 2025 09:01:12 PM UTC (0 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: fully-charged
warning-level: none
energy: 25.764 Wh
energy-empty: 0 Wh
energy-full: 25.764 Wh
energy-full-design: 25.764 Wh
energy-rate: 0 W
voltage: 12.576 V
charge-cycles: 231
percentage: 100%
capacity: 100%
technology: lithium-ion
icon-name: 'battery-full-charged-symbolic'
History (charge):
1762722072 100.000 fully-charged
1762722072 0.000 unknown
History (rate):
1762722072 0.000 unknown
then I tried this:
# Loads default set of integrations. Do not remove.
default_config:
# Example configuration.yaml entry
- 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
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
$ sudo docker restart homeassistant
It does not work as described in home assistant.
Can someone please guide me into the right direction.
I want to know whether or not the laptop is connected to AC and also what the battery % is when it is not.