9 Commits
Author SHA1 Message Date
vakuandClaude Fable 5 29a7c2586e Ignore .venv
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 01:54:25 +03:00
vakuandClaude Fable 5 ac8a4b88f0 Make daemon stop behavior configurable via signal_ups_on_stop
Off (default): SIGKILL the daemon on addon stop so the UPS keeps power
on. On: SIGTERM it (native behavior) so it saves the RTC and tells the
UPS to cut power. Add translations so the option is documented in the
HA config UI, and document the difference in the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 01:51:50 +03:00
vakuandClaude Fable 5 fac31b4d3d Keep UPS power on when the addon is stopped
The daemon treats SIGTERM as system shutdown and clears PI_RUNNING,
making the UPS cut power seconds after the addon stops. Trap the stop
signal and SIGKILL the daemon instead so the UPS is never notified.

When the daemon exits on its own because the UPS commanded a shutdown
(button, low battery, auto shutdown), its init-0 trigger is useless in
a container, so run.sh now performs a clean host shutdown through the
Supervisor (requires hassio admin role).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 01:43:26 +03:00
vakuandClaude Fable 5 6fcef57e7a Remove committed __pycache__ files and add .gitignore
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 01:01:24 +03:00
vakuandClaude Fable 5 93c1f8d3bc Fix entity names and add units per the product brief
VOUT_MAX is the safety limit above which the UPS refuses to boot an
externally-powered Pi, not an output voltage setting. Also clarify
PI_RUNNING, WATCHDOG_GRACE and TOUCH_STATE names, and add documented
units: timeouts and watchdog values are CLI-scaled seconds,
AUTO_SHDN_TIME is minutes; SHDN_DELAY stays raw ticks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 00:53:01 +03:00
vakuandClaude Fable 5 c1c96d3cfb Rename VIN_THRESHOLD entity to Input voltage threshold
It is a voltage level, not a power quantity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 00:50:00 +03:00
vakuandClaude Fable 5 3d8deb1176 Disable Docker init so s6-overlay v3 can run as PID 1
The latest homeassistant base images use s6-overlay v3, whose /init
refuses to run unless it is PID 1. Set init:false so the Supervisor does
not inject docker-init in front of it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 13:53:42 +03:00
vakuandClaude Fable 5 952fc24e90 Make lifepo4wered-daemon the primary process in run.sh
The daemon must contact the UPS within PI_BOOT_TO seconds of power-on
or the UPS cuts power. Start it immediately via exec as the container's
main process; run the MQTT monitor in a background loop with 30s restart
backoff so Supervisor API delays or monitor crashes can never delay or
kill the daemon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 01:18:46 +03:00
vakuandClaude Fable 5 25b3e2dcc4 Add MQTT monitor with Home Assistant autodiscovery
Poll lifepo4wered-cli every 30s (configurable), publish all registers as
one JSON state payload, and announce sensors/binary sensor via MQTT
discovery. run.sh pulls broker credentials from the Supervisor mqtt
service (Mosquitto addon) with manual overrides in addon options.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 01:15:03 +03:00