fanatic2pope 2 days ago

I have a home server that is on 24x7 protected by a UPS. The UPS monitoring daemon (nut) provides a hook for calling a script when its status changes, so I have it push a high priority notification to my phone via ntfy whenever it goes on battery or off battery. I also have it broadcast on mqtt so that in the future I can have a dedicated daemon that will collect stats and take other actions that aren't really appropriate for a hook script.

  • sugarpimpdorsey 2 days ago

    How hilariously complicated.

    Make UPS data available over SNMP, track via MRTG. A simple, decidedly 1990s solution that unsurprisingly still works. Pretty graphs and everything.

    • fanatic2pope 2 days ago

      Complicated? It's a 10 line shell script and a single configuration item in the nut config.

      • sugarpimpdorsey 2 days ago

        > I also have it broadcast on mqtt so that in the future I can have a dedicated daemon that will collect stat

        mqtt? How many Docker containers do you have running to track UPS voltage?

        I keep forgetting SNMP is not "web scale" and only for greybeards on a minimum of 3+ prescription medications.

        • ghotli 2 days ago

          The way you wrote this and your previous comment above led me to believe your account is new. I checked it, 74 days at time of writing. I get the impression you haven't read the guidelines here. I like this place as it is generally civil discourse and have no qualms being the person that points you to the "In Comments" section of the guidelines.

          https://news.ycombinator.com/newsguidelines.html

          Be kind, rewind.

        • fanatic2pope 2 days ago

          LOL, docker for running mosquitto at home? Who does that?

          • NortySpock 2 days ago

            I did.

            It was convenient. The official docker image includes all the tools you need.

            Overkill? Sure. It sips memory and compute, but when most everything else is in docker, what is wrong with one more container.

            I did a write-up here:

            https://github.com/NortySpock/selfhosted-show-wiki/blob/bca6...

            (Eventually I did switch over to NATS emulating an MQTT endpoint so I could get a broker with Prometheus-scrapeable `/metrics` endpoint )

          • Xevion 2 days ago

            Are you recommending that I run mosquitto directly on my Unraid server rather than Docker?

            Just to re-iterate, Unraid is a proprietary Linux OS based on Slackware Linux. It is generally ill-advised to ever run tooling directly on Unraid when a Dockerized equivalent is available.

          • Nextgrid 2 days ago

            Docker is effectively just a packaging format on Linux - it's not a VM (unlike on Windows/Mac where running Docker involves running a hidden Linux VM on which containers are scheduled). So I don't see why you wouldn't use it if it makes things easier (like not having to worry about distro specifics, since there is generally one canonical Docker image for major pieces of software)?

    • rhcom2 2 days ago

      What a use of electricity. I just go out to my power meter with a pencil and pad and note the number.

  • fusionadvocate 2 days ago

    How does ntfy compares to Pushover?

    • binwiederhier 2 days ago

      Disclaimer: I am the ntfy maintainer. Pleasantly surprised to be mentioned, hehe.

      Pushover is an amazing tool and works well. In my obviously biased opinion though, I think that ntfy has a ton more features than Pushover and is fully open source. You can self host all aspects of it or you can use the hosted version on ntfy.sh for free, without signups, or pay for higher limits.

      I suggest you try out ntfy;-)

      • joezydeco 2 days ago

        I use ntfy for a whole bunch of personal projects. THANK YOU for keeping this service up and running.

        • binwiederhier 2 days ago

          I love hearing that. Anything worth sharing? I love hearing how people use it. My favorite one is the guy protecting his apple tree from thieves by adding a camera and motion sensor and then sending himself a notification with the picture to catch the apple thief.

          • joezydeco 2 days ago

            I have a few things. One is home security, I get basic notifications when something is in the driveway. I'm working on getting Frigate running to hopefully give me the names or license plates of people when they arrive.

            I also have one tied to a manufacturing database at my company. When a batch of products rolls off the line I get an updated count of units made. Kind of a way to know production systems are running and there are no problems at the work cells.

            I also made a rickety-ass system that scrapes the local commuter rail API and fires off a notification when one of my trains is late or cancelled. That's been pretty helpful. The rail company has a Twitter account, but I don't go there anymore. So I rolled my own.

            ntfy makes this all incredibly easy. I love it.

    • fanatic2pope 2 days ago

      I don't know, I've never used pushover. A quick look at their home page doesn't seem to indicate the option of self hosting on a VPS, so that precludes it for me. Otherwise from the code samples provided, it looks quite similar.

toomuchtodo 2 days ago

Very cool project! Another method you can run entirely remotely, if your utility supports it, is poll the utility's customer API endpoint for data where they expose if your power is out using your smart meter. ComEd in Illinois supports this, for example.

OptionOfT 2 days ago

I was checking today how expose my electricity meter within Home-Assistant.

My electricity reader supports ZigBee.

My provider knows minute by minute my consumption, yet only providers it on THEIR website, in a way that is useless to me.

  • baby_souffle 2 days ago

    Assuming you’re talking about the same thing that PG&E does, it’s technically only zigbee at the transport layer. The power/utility aspect is all very different and relies on crypto/keys that are not trivial to get.

    You will not be able to just point the radio in your zigbee stick at your meter. As far as I know, the only device that is even blessed with the keys to do this is the Rainforest/Eagle device. You _still_ have to get permission from your utility, though. PG&E has a web page where you plug in the MAC for the radio and submit it. Only some customers on some rate plans are allowed to access this.

    I gave up and went with a power monitor that’s installed in the main breaker box. It uses CT clamps on each circuit to give very accurate and timely readings.

    • OptionOfT 2 days ago

      Clamps would work, or the optical connection. But unsure if that's disabled.

      I'll call APS (Arizona) tomorrow to see what is possible.

      • baby_souffle 2 days ago

        I got curious, dug through my notes.

        > Zigbee SE

        is the official name for the standard. Good luck w/ your Utility Company.

        > Clamps would work, or the optical connection. But unsure if that's disabled.

        If the optical connection isn't disabled, I'd go that route. Clamps are a _pain_ if the space is cramped or the installer did a poor job of keeping things tidy. The upside to clamps is that you get per-circuit and in real time. If you have a dedicated circuit for big appliances, integrating the clamp into Home Assistant is a cheap way to get a "is the dishwasher done?" signal, for example.

ge96 2 days ago

I have a self-updating github readme, reads a sensor at my home

I joke if it goes down means something happened to me but sometimes the server has a problem like running out of space since an error logger keeps writing over and over

ComputerGuru 2 days ago

Disappointed the solution doesn’t just track home power but also other dependencies like the network switch, the wan uplink, etc. sure, you might not be able to push the data if your wan is down but afterwards you should be able to determine whether it was a power outage or Comcast went down.

An IoT device actually monitoring mains (and only that) seems like a better solution, if only because it’ll work when you get a UPS for your router.

  • devmor a day ago

    > An IoT device actually monitoring mains (and only that) seems like a better solution

    This is what I was thinking. Specifically I have several different models of Zigbee and Z-wave "smart outlets" among the myriad IoT devices I've evaluated. While reading through the OP, I found myself wondering if one of them could just be left in the "ON" state, powering nothing (or something I always want running like a freezer). Then I could simply have HomeAssistant, which is backed by a UPS along with my modem and router, report its status.

black_puppydog 2 days ago

I've seen the John Oliver videos and all, so I know this comes as a surprise to no-one but... the US needs to get its act together and build some actual infrastructure. I've heard lots of encouraging stories on the Volts podcast about it, too. Not enough, not fast enough, from what I understand.

I'm 38 and I've had power go out in my house for lots of reasons, but all of them came down to me blowing a fuse somehow. I can't remember ever having had an actual, you know, power outage. So I guess I just here to tell you over there in the US that another way is possible. :)

  • nancyminusone 2 days ago

    Depends on the region. I live in one of the bad areas, with lots of trees. The power goes out every couple months for a couple hours.

    But I was very surprised to learn that until 2021, most Texans had never had a power interruption in decades (which I suppose added to their panic).

    Not all that useful to say "the US" here. California has it's wildfires and earthquakes. The west has extreme temperature swings. Southeast has hurricanes, and northeast has trees, ice, and wind. The entire south likes to run air conditioning. What does your country or its neighbors face? How about 10 countries over?

    • seszett 2 days ago

      > What does your country or its neighbors face? How about 10 countries over?

      Well my country sometimes has storms that do lead to power cuts for a few hours in the worst case, it's happened to me in 1999 and 2010 (but then there was also flooding that time). It's not happened since except for a couple of scheduled cuts that lasted a minute or so.

      About five countries over, there is a special military operation that you might have heard of. About ten countries over there's another one. I'm pretty sure some neighbouring countries also have ice, forests, wind and wildfires.

    • bob1029 2 days ago

      > But I was very surprised to learn that until 2021, most Texans had never had a power interruption in decades

      And now in 2025 you will find the highest density of generac installs in Texas. I'm in a neighborhood where at least 80% of the homes have a standby unit. The substation is less than a mile away but the lines have to go through Narnia to reach us. Outages are half a day at a minimum.

  • mcone 2 days ago

    Do you have trees where you live? :) Because we have above-ground power lines in much of the US, wind and ice are always bringing branches down on power lines.

  • GloriousKoji 2 days ago

    I live in the 3rd "wealthiest" county in the United States. The combined market cap of headquartered companies here total over 10 trillion dollars. I can't install solar panels and I can't be bothered to buy house batteries so I've only had power 98.6% of the time last year.

    I've lost hope. In theory it can be done but it feels something on the same order as setting foot on the moon again. We have the technology and capability to do so but somehow our population collective decision results in keep things garabge.

    • bcraven 2 days ago

      "Losing hope" after saying you "can't be bothered" to buy batteries feels very self-inflicted.

  • edm0nd 2 days ago

    I live in the southern US. Our power goes out all the time due to hurricanes, tornados, flooding, falling tree limbs, and various other extreme weather events.

    A lot of homes have gas or propane generators that will cut on when a power outage is detected.

  • danieldk 2 days ago

    Same here (Western Europe). I can't recall the last time we had a power outage that was not caused inside the house.

    All power cables except for long-distance transport are underground though, which probably helps a lot and might account for the difference to a large extend.

    (Our microwave oven did trip our residual-current circuit breaker a few weeks ago, never encountered that before, only 'fuse switch'-flips. Sadly that was the end of the device after 16 years.)

  • wredcoll 2 days ago

    I'm as big a fan of ragging on "america" as anyone else, but it does occasionally have a few relatively unique problems compared to most other countries, such as the distances involved and the (lack of) density of population.

    Above ground electric lines vs buried ones are a good example of how quickly your ROI can drop off for infrastructure problems.

    Spending 10 million to add cold-weather protection to a powerplant that services 5million people? No brainer. Spending 10 million to bury 100 miles of power line that services 1000 people? Ehh...