From 259ca3d11411d5695e24129de1ce4c3a99db495a Mon Sep 17 00:00:00 2001 From: "M.J. Wydra" Date: Mon, 16 Aug 2021 15:28:25 -0500 Subject: [PATCH 1/4] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b926f1..ae7d911 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ sensor: device_class: battery ``` -# TODO: +# TODO 1. Add proper logging 2. Add Home Assistant MQTT autodiscovery? 3. ??? From 0994a71715cd7c1614eb5e602740d2c3af345706 Mon Sep 17 00:00:00 2001 From: "M.J. Wydra" Date: Mon, 16 Aug 2021 15:30:43 -0500 Subject: [PATCH 2/4] Update readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae7d911..043f141 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,6 @@ A summary of these conditions is below. | Energy full design | Original battery capacity when full* | Wh | | Power now | Current power consumption | W | | Voltage now | Current battery voltage | V | -| Battery health | (See next section) | % | -| Time remaining | (See next section) | Hr | \* Batteries lose capacity with each charge cycle. *Energy full* shows the actual full capacity of the battery due to wear; *Energy full design* shows the capacity the battery was able to hold when factory fresh. @@ -84,6 +82,9 @@ A summary of these conditions is below. The default is to also provide a battery health percentage calculation by dividing `energy_full` by `energy_full_design`. This can be disabled by setting `BATTERY_HEALTH` to `0` in your `docker-compose.yaml`. Similiarly, an estimate of time remaining on battery (in hours) is calculated by dividing `energy_now` by `power_now`. This can be disabled by setting `TIME_REMAINING` to `0` in your `docker-compose.yaml`. +# AC adapter monitoring +You can monitor the status of the AC adapter (online or offline) by setting `AC_ADAPTER` to `1`. This is disabled by default. + # Example Home Assistant configuration ```yaml sensor: From 155eb97f8c6e5ca0a9f0eb4d94d74b407daf99f6 Mon Sep 17 00:00:00 2001 From: "M.J. Wydra" Date: Mon, 16 Aug 2021 21:31:59 -0500 Subject: [PATCH 3/4] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 043f141..8b10b02 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,8 @@ sensor: ``` # TODO -1. Add proper logging -2. Add Home Assistant MQTT autodiscovery? -3. ??? -4. Profit +1. Implement LWT +2. Add proper logging +3. Add Home Assistant MQTT autodiscovery? +4. ??? +5. Profit From d9f586449edc44ef8b5b27c53d8aacdfcb3dd0e1 Mon Sep 17 00:00:00 2001 From: "M.J. Wydra" Date: Mon, 16 Aug 2021 21:42:28 -0500 Subject: [PATCH 4/4] Clean up readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b10b02..39730ca 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ services: | `MQTT_QOS` | `1` | The MQTT QoS level. | | `INTERVAL` | `60` | How often (in seconds) battery2mqtt polls for battery info. | | `MONITORED_CONDITIONS` | (See below) | Battery properties to send to MQTT (must be a comma-separated string). | -| `BATTERY_HEALTH` | `1` | Set to 1 or leave blank to enable battery health percentage calculation or 0 to disable. | -| `TIME_REMAINING` | `1` | Set to 1 or leave blank to enable time remaining estimate (in hours) or 0 to disable. | -| `SHOW_UNITS` | `1` | Set to 1 or leave blank to show power units in the MQTT payload or 0 to disable. | -| `AC_ADAPTER` | `0` | Set to 1 to show AC adapter status. | +| `BATTERY_HEALTH` | `1` | Enable/disable battery health percentage calculation. Set to 0 to disable. | +| `TIME_REMAINING` | `1` | Enable/disable time remaining estimate (in hours). Set to 0 to disable. | +| `SHOW_UNITS` | `1` | Enable/disable power units in the MQTT payload. Set to 0 to disable. | +| `AC_ADAPTER` | `0` | Enable/disable AC adapter status. Set to 1 to enable. | # Monitored conditions You can specify only those conditions that you'd like to track. The default is to track `status, capacity, energy_now, energy_full, energy_full_design, power_now, voltage_now`. You can add more conditions (found at `/sys/class/power_supply/$NAME`) or choose only those you want to track. The variable in your `docker-compose.yaml` must follow this comma-separated format: