mirror of
https://github.com/Tediore/battery2mqtt.git
synced 2025-04-04 15:33:44 +02:00
Add note about sensor status
This commit is contained in:
parent
0405d5600e
commit
8b77606217
@ -4,7 +4,7 @@
|
||||
I thought of this project when I switched to using my old laptop as my Home Assistant server. I wanted to track its battery level in Home Assistant to use in automations. Hopefully others can find it useful as well.
|
||||
|
||||
# Summary
|
||||
`battery2mqtt` can monitor current battery percentage, charging status, etc. for any batteries present at `/sys/class/power_supply`. The MQTT topic format is `battery2mqtt/$TOPIC/$NAME` where `$TOPIC` is the topic you define and `$NAME` is the name of each battery. For example, if `/sys/class/power_supply/BAT0` is present in your system and you choose `server` to be the topic, the full topic will be `battery2mqtt/server/BAT0`.
|
||||
`battery2mqtt` can monitor current battery percentage, charging status, etc. for any batteries present at `/sys/class/power_supply`. The MQTT topic format is `battery2mqtt/$TOPIC/$NAME` where `$TOPIC` is the topic you define and `$NAME` is the name of each battery. For example, if `/sys/class/power_supply/BAT0` is present in your system and you choose `server` to be the topic, the full topic will be `battery2mqtt/server/BAT0`. The topic for sensor availability would be `battery2mqtt/server/status`.
|
||||
|
||||
# Instructions
|
||||
|
||||
@ -101,6 +101,7 @@ sensor:
|
||||
value_template: "{{ value_json.capacity }}"
|
||||
unit_of_measurement: '%'
|
||||
json_attributes_topic: *server_battery_topic
|
||||
availability_topic: "battery2mqtt/server/status"
|
||||
device_class: battery
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user