n4ve

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: How to submit a feature request #851
    n4ve
    Participant

    Title: UPS shutdown support (NUT client) so Helioclock can shut down cleanly on power loss

    What I’m trying to accomplish

    Your Power Outage help note recommends a UPS for 24/7 installs so the system can “shut down cleanly when mains power is lost.” I’m following that advice. I run Helioclock on my own Raspberry Pi 5, using your SD card, on a CyberPower UPS with another Raspberry Pi and a Windows PC.

    The catch is that Helioclock has no way to know the UPS is on battery. I can’t find a setting for it, and the SD card can’t be modified, so I can’t add one myself. As far as I can tell, it keeps running until the UPS battery runs out or the outlets cut, then loses power hard anyway. That’s the SD-card corruption your note warns about. The UPS just pushes it back a bit. If I’ve missed an existing option, please let me know.

    I’m setting up a Network UPS Tools (NUT) server for the UPS. If an outage lasts more than a few minutes, it’ll tell every device on the network to shut down cleanly, then have the UPS turn its outlets off and back on so everything boots up again when power returns. Helioclock is the one device I can’t include.

    What I’m asking for

    A built-in NUT client. The protocol is documented in RFC 9271 (TCP port 3493), and if Helioclock is built on Raspberry Pi OS / Debian, the standard nut-client package may make this fairly simple.

    Settings: NUT server IP, port (default 3493), UPS name, username and password. A “UPS plugged directly into the Pi by USB” option would also help people who only have the one device on a UPS.
    Behavior: shut down cleanly when the NUT server sends forced shutdown (FSD) or reports low battery.
    After the outage: boot automatically when power comes back. Mine already does this.
    Nice to have: UPS status (on line / on battery / charge %) shown in the UI.
    If a NUT client is too much, either of these would also help

    A local, authenticated API call that triggers a clean shutdown. I’d call it from my NUT server’s shutdown script.
    If the system isn’t already read-only, a read-only root filesystem (like Raspberry Pi OS’s overlay file system), so sudden power loss can’t corrupt the SD card in the first place.
    Why it’s worth it beyond me: NUT is the standard for home and small-office UPS setups. Home Assistant, Synology, Unraid and TrueNAS all support it, so anyone following your UPS advice could put that advice into practice.

    Thanks for reading!

Viewing 1 post (of 1 total)