3.6kWh Solar Generator – Backup Power For My Computers

I’m tired of power outages. We just had another one. It corrupted one of my disks, a disk that held 22TB of data I was working on. It’s data that I can recover, so it’s not an absolute disaster, but it will take something like a month to complete the recovery. I am not happy.

This event has motivated me to go out and get a single, large UPS-like device that can handle the power for my entire lap setup. All my network and PC equipment is now plugged into that box. When we have our next power outage, it will run everything for six hours. If the outage lasts longer than six hours, it can be charged off solar panels or with a gas generator. Even better, once I do have solar panels hooked to it, they will reduce the amount of electricity my lab systems consume from the grid when there isn’t a power outage, saving me a little money.

This device is called a “solar generator.” The one I bought is an EcoFlow Delta Pro. It’s rated at 3.6kWh. (kWh = kilowatt hour = 1000 watts for an hour.) My lab systems consume around 500W so, doing the math, 3600/500 = 7.2 hours of runtime if the system was perfectly efficient. But, as we all know, there’s no such thing as perfect efficiency:

  • My lab’s power consumption is never exactly 500W, it varies over time,
  • Some power is lost in the conversion from 48V DC battery power to 120V AC power,
  • In an attempt to extend the battery’s life, I only let the battery charge up to 85% so I actually start with about 3kWh of capacity.

With all those variables, both my math and real-world tests tell me that I’ll get roughly 6 hours of power out of this battery before it dies.

Now that I have the Delta Pro box set up, I wanted to integrate it into my management systems:

  • I want to collect metrics from the Delta Pro in a database so that I can look at its performance over time.
  • I’d like to have a browser-based dashboard that displays selected metrics so that I don’t have to pull out my smartphone and use the EcoFlow app all the time.
  • I use Nagios to monitor all my computer systems/services and display their status on a dashboard hanging on the wall. I need a Nagios plugin for the Delta Pro to enable it to be part of that.
  • The Delta Pro gives priority to AC charging. If the solar panels are providing power and the AC is plugged in, the Delta Pro will charge off the AC and run everything that’s plugged into it off the grid. I want to be able to keep the AC turned off until it’s absolutely necessary, say when the battery drops to 5%, so that my computers run off the solar/battery as much as possible I think I can use a Zwave switch on the Delta Pro’s AC power cord to accomplish this, by having my monitoring program turn the switch off and on, regulating the flow of AC power to the Delta Pro.

To do all of this I need an API. EcoFlow does have one that a developer can request access to from EcoFlow support. It appears to be based on MQTT between a client and their server. Their server collects metrics from the Delta Pro and can then provide those metrics to MQTT clients. I don’t like that. I’d prefer to talk directly to the Delta Pro device on my local network, not go out to an external server. The hassio-ecoflow GitHub project has an unsupported, Python API for direct network-based communication with many of the Ecoflow products, including the Delta Pro. I’ve based my hacks on that code and put the following things into my own ecoflow-hacks project on GitHub:

  • I created an ecoflow.py module that is my personal version of the EcoFlow API from the hassio-ecoflow project,
  • I created a smartthings.py module that is my personal API for turning on/off a device via a SmartThings hub,
  • I used those two modules to create an ecoflow-logging Python script that collects a list of metrics from my Delta Pro and writes them into a MariaDB database. It also turns on the AC power switch via SmartThings if the battery charge drops below 5% and has an option that turns that switch off when requested.
  • I use Nagios to monitor all the devices in my lab. I created a check_ecoflow Nagios plugin that queries the database to see how long it’s been since the Delta Pro’s status has been updated and what the battery charge and charging status are. If the Delta Pro hasn’t responded recently or the battery is running low, the plugin shows alerts on the Nagios dashboard.
  • I created a Grafana dashboard for the Delta Pro that displays historical and current battery charge, remaining battery runtime, battery temperature, input watts, and output watts from my MariaDB database.

dlk

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.