So i thought it would be a good idea to shutdown HA properly (running in a vm) if the battery of the laptop is running low. There’s been a few instances where i’m doing some work on light switches and power is off a little bit longer then i thought it would be so…
Is there anyway of doing this? I can’t use a smart plug because if power is down wifi is also down, i could use a zigbee power plug i guess.
Apologies for the lazy question but I don’t want to reboot my production server (a laptop) to discover the answer. Does the battery sensor appear without having to explicitly specify a type? Because I don’t see an explicit type for battery in System Monitor’s documentation.
If it’s Windows, I’d just go with setting the MQTT Broker on the Laptop and tell Home Assistant to connect to localhost MQTT Broker. Then install IOT Link, which I am 99% sure has battery status.
I figured that out as well. Linux battery i can’t get to work, however, i found this: GitHub - timmo001/system-bridge: A bridge for your systems which has a homeassistant integration as well. Looks fairly complete, and supports command passthrough as well.
If Linux Battery fails then I’ll probably try using Command Line.
I know about System Bridge but haven’t had a need for all the monitoring data it collects; battery level is, for the moment, all I require. Same for IOT Link but thank you all for the useful suggestions.
Makes sense. I thought system bridge might provide me with useful stats on ha cpu but probably don’t need so much software for that. And i don’t want to overload the system with extra stuff.
Do let me know if you get linux battery to work (assuming you use ubuntu or similar). I’d be interested in that route too. That’s all i was looking for anyway, just find a way to shut the VM down in a safe manner.
says 100 for state because it’s attached to mains. imagine the other values will fill up once i disconnect the power chord.
Now just to figure out what the equivalent is of ‘host shutdown’ on the cli. I found a service called: Home Assistant Supervisor: Poweroff the host’. I guess i’ll try that.
# Report host battery for detecting if we need to shutdown HA VM
- platform: linux_battery
name: 'Home Assistant Laptop Battery 1'
in my sensors.yaml
I remember struggling a lot with getting this sensor to work, but i think in the end it came down to me not setting up the battery to be passed through in the VMware client.
I have similar problem, I would like to get the percentage battery in Home Assistant. My case is slightly different as I am running Home Assistant Operating system directly on the laptop. So, it’s not running as VM or in a docker. 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, 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?
i am completely new and confused
i am running HA in a docker container on a laptop running Ubuntu server do you have any idea if this could be the same for me because it seems no matter what i do i cant get any thing to pop up other than when adding a command sensor and then it just says unknown whatever i do.