# Looking for a way to shutdown raspberry pi from ups

**URL:** <https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233>\
**Category:** General Discussion\
**Created:** [November 24, 2024, 5:39pm UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233 "2024-11-24T17:39:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Autosri](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Autosri](https://klipper.discourse.group/u/Autosri)\
**Post date:** [November 24, 2024, 5:39pm UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233/1 "2024-11-24T17:39:49Z")

</div>

### Basic Information:

Printer Model: ender 3 v2  
 MCU / Printerboard:btt mini e3 v3  
 Host / SBC pi3b+  
 klippy.log  
[klippy (12).log](https://klipper.discourse.group/uploads/short-url/iSvX2UxjHQGDewyizXGXsrAW3Tv.log) (76.7 KB)

_Fill out above information and_ **_in all cases attach your_ `klippy.log` _file_** (use zip to compress it, if too big). _Pasting your_ `printer.cfg` _is **not** needed_  
_ **Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there** _

### Describe your issue:

…  
Ive been having a few power cuts locally that mess up my prints and worried about SD card in the sbc with the grid auto resetting  
ive got a small UPS coming for the printer and sbc and would like to trigger a shutdown of moonraker or the raspberry pi with for example a button/relay input when the battery gets low in the ups  
does anyone know how to do this or a better way of doin this ?  
thanks

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [November 24, 2024, 6:23pm UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233/2 "2024-11-24T18:23:13Z")

</div>

> [@Autosri](#):
>
> Ive been having a few power cuts locally

How long are those power cuts? Seconds, minutes, or even hours?

---

<div class="post-metadata">

**Author:** ![Autosri](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Autosri](https://klipper.discourse.group/u/Autosri)\
**Post date:** [November 24, 2024, 7:48pm UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233/3 "2024-11-24T19:48:15Z")

</div>

sporadic most of the time its a few seconds to a minute but yesterday it was about 3 hours  
so hoping the ups will pick up the slack on the short ones and print continue as normal, but on the long ones it will run till say 50%, then shut everything down or just kill the printer and leave the rpi powered up

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [November 25, 2024, 9:03am UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233/4 "2024-11-25T09:03:53Z")

</div>

Moonraker offers many possibilities to do so. The question is, how does your UPS indicate a low battery condition for any services to react upon.

For examples see:

- [Configuration - Moonraker](https://moonraker.readthedocs.io/en/latest/configuration/#toggling-device-state-from-klipper)
- [Configuration - Moonraker](https://moonraker.readthedocs.io/en/latest/configuration/#shelly-configuration)
- not exhaustive. more options are existing

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [January 24, 2025, 9:04am UTC](https://klipper.discourse.group/t/looking-for-a-way-to-shutdown-raspberry-pi-from-ups/20233/5 "2025-01-24T09:04:41Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
