


Open-Source Tool Designed To Throttle PC and Server Performance Based On Electricity Pricing (tomshardware.com) 52
Robotics and machine learning engineer Naveen Kul developed WattWise, a lightweight open-source CLI tool that monitors power usage via smart plugs and throttles system performance based on electricity pricing and peak hours. Tom's Hardware reports: The simple program, called WattWise, came about when Naveen built a dual-socket EPYC workstation with plans to add four GPUs. It's a power-intensive setup, so he wanted a way to monitor its power consumption using a Kasa smart plug. The enthusiast has released the monitoring portion of the project to the public now, but the portion that manages clocks and power will be released later. Unfortunately, the Kasa Smart app and the Home Assistant dashboard was inconvenient and couldn't do everything he desired. He already had a terminal window running monitoring tools like htop, nvtop, and nload, and decided to take matters into his own hands rather than dealing with yet another app.
Naveen built a terminal-based UI that shows power consumption data through Home Assistant and the TP-Link integration. The app monitors real-time power use, showing wattage and current, as well as providing historical consumption charts. More importantly, it is designed to automatically throttle CPU and GPU performance. Naveen's power provider uses Time-of-Use (ToU) pricing, so using a lot of power during peak hours can cost significantly more. The workstation can draw as much as 1400 watts at full load, but by reducing the CPU frequency from 3.7 GHz to 1.5 GHz, he's able to reduce consumption by about 225 watts. (No mention is made of GPU throttling, which could potentially allow for even higher power savings with a quad-GPU setup.)
Results will vary based on the hardware being used, naturally, and servers can pull far more power than a typical desktop -- even one designed and used for gaming. WattWise optimizes the system's clock speed based on the current system load, power consumption as reported by the smart plug, and the time -- with the latter factoring in peak pricing. From there, it uses a Proportional-Integral (PI) controller to manage the power and adapts system parameters based on the three variables. A blog post with more information is available here.
WattWise is also available on GitHub.
Naveen built a terminal-based UI that shows power consumption data through Home Assistant and the TP-Link integration. The app monitors real-time power use, showing wattage and current, as well as providing historical consumption charts. More importantly, it is designed to automatically throttle CPU and GPU performance. Naveen's power provider uses Time-of-Use (ToU) pricing, so using a lot of power during peak hours can cost significantly more. The workstation can draw as much as 1400 watts at full load, but by reducing the CPU frequency from 3.7 GHz to 1.5 GHz, he's able to reduce consumption by about 225 watts. (No mention is made of GPU throttling, which could potentially allow for even higher power savings with a quad-GPU setup.)
Results will vary based on the hardware being used, naturally, and servers can pull far more power than a typical desktop -- even one designed and used for gaming. WattWise optimizes the system's clock speed based on the current system load, power consumption as reported by the smart plug, and the time -- with the latter factoring in peak pricing. From there, it uses a Proportional-Integral (PI) controller to manage the power and adapts system parameters based on the three variables. A blog post with more information is available here.
WattWise is also available on GitHub.
Re: (Score:1)
Thankyou for explaining that you are American, and the concept of irony is foreign to you.
Re: (Score:2)
That exact mindset is what led us to be dependent on oil to begin with. No care for efficiency. We got plenty of oil, why bother improving the engine? Let's make it loud for no good reason instead. Oh wait, we don't have plenty of oil? Uh, shit better get to improving the engine or improve other fuel sources.
We could have (and should have) been investing in energy efficiency waaay earlier. But, nooo, people rather be fucking retarded.
Re: (Score:1)
look everyone
This is what 'winning the culture war' looks like
Re: (Score:2)
Awww, someone is a wittle, angry boy who like to suck the dick of the oil companies.
Re: (Score:2)
Reading slashdot, wind, solar and whatever other "renewables" are now so cheap that there's no need to meter. So why bother?
I've heard of mockery on claims on energy for nuclear fission being too cheap to meter but if you think about it there's many instances where electricity is too cheap to meter.
For those that rented a hotel room, do you recall a charge for the electricity you used? I don't, because electricity in that case is too cheap to meter.
Has anyone rented a spot at an RV park? The kind with the big 50 amp plugs for people that drive houses down the road? Were you charged for your electricity use? I rented such spo
Re: Why is this needed? (Score:2)
The effective cost of metering has also gone down as urba
Re: (Score:1)
Those analogies miss a few key points. In the case of both the RV Park and the hotel rental, electricity is being bundled with a much more expensive service and that service is typically provided over a relatively short time horizon.
In the case of "too cheap to meter" the argument is about the energy being from renewable sources and nuclear fission. With renewable energy the claim is there is no fuel cost by virtue of collecting and converting natural processes to create energy for sale. With nuclear fission the argument is that the fuel costs are so low that they are dwarfed by the fixed cost of the power plant, labor, transmission and distribution wires, and so on.
The electricity from such energy sources are bundled with more expen
Re: (Score:2)
Lets say that your hardware cost 1000 dollars and you use it 30% of time with the tool, lets say 0,5 kWh when in use, and hardware lasts for 3 years, and your electricity is 5 cents without the tool and 2 cents with the tool.
We could say that you are wasting 700 dollars from your hardware, because you don't use it.
Electricity cost without the tool is 365*3*24*0.5*0.05 = $657
Electricity cost with the tool is 365*3*24*0.5*0.02 = $263
Savings are: $394
So you are potentially wasting 700 dollars in hardware, and
This sounds like malware (Score:1)
Waste to save. (Score:5, Insightful)
Requirements
Python 3.8 or later
A TP-Link Kasa smart plug connected to your equipment
Optional: Home Assistant setup with the Kasa integration
So to "save electricity" you have to always run:
* an IoT WiFi relay switch that is always on and computing some crap to phones home about
* a docker instance to communicate with it using bloated python code
If you're going to do SCADA then build a real SCADA system. Using internet-of-shit components just wastes energy and money.
Re: (Score:2)
Anybody using this is already running Home Assistant for other purposes. The plug draws a watt (*drops monocle*) to adjust for ToU electricity usage. Simple goal, simple project. Do people like you suffocate if you aren't constantly bitching about something?
Re: (Score:2)
Anybody running OpenHAB can do this without any third party tools.
In fact, the servers in my office shutdown automagically when the ambient temperature rises above a setpoint to prevent the HVAC from kicking in. A simple schedule ensures it does not happen during Free nights and weekends, or when my total monthly power consumption is below a set threshold. All done from the UI of OpenHAB.
So yeah, it's kind of a 'why are you wasting your time doing this when there are more capable tools which do the same th
Re: (Score:3)
HA and Kasa doesn't require any cloud/IoT access. It works 100% local.
I guarantee you that the vampire power draw of many devices, especially gaming consoles and entertainment systems, dwarfs the power draw of a Kasa smartplug.
I've implemented dozens of these throughout the house. All blocked from any cloud access, and only deployed where the power savings outweighed the cost of the device factored over 5 years of savings, including the constant power draw of the Kasa device.
Re: (Score:2)
I've implemented dozens of these throughout the house. All blocked from any cloud access, and only deployed where the power savings outweighed the cost of the device factored over 5 years of savings, including the constant power draw of the Kasa device.
What a waste. A simple SCADA system would have been cheaper, saved more power, and required less effort.
Re: (Score:3)
That sounds interesting. Can you provide some links to projects showing how to get started with SCADA at home?
Re: (Score:2)
Tell me you know nothing about Home Assistant without telling me you know nothing about Home Assistant.
I find it sad when people spew nonsense with conviction.
Re: Waste to save. (Score:5, Interesting)
I have 57 Tp Link Kasa energy monitoring KP125 plugs. They each consume about 0.25 W. I'm using them for various purposes, such as "Appliance is ready", ot turning on my subwoofers when my receiver comes up - turns out the subs still consume about 10 watts each, even in power saving mode, and I have 8 subs throughout the house. That alone more than offsets the wattage from the plugs themselves.
The plugs work fine locally without any cloud access. They do unfortunately require cloud for the initial setup, which is a major deficiency. If TP-LINK servers go away, no new plugs will be able to be setup. And most likely Wifi properties won't be modifiable either.
Zwave plugs don't have this issue, but unfortunately the bus is too slow to transport energy monitoring information frequently enough, especially not with 50+ energy monitors.
I'm still hoping there will be a fully cloud tree solution from start to finish some day.
Docker isn't required if you run HAOS. It's self contained. The TP link integration is built in. Nothing to install. It auto discovers the smartplugs.
Re: (Score:2)
There are many smart plugs with energy monitoring that support the open source Tasmota firmware. No cloud needed, full control, WiFi.
Re: (Score:3)
Thanks. Do you have personal experience with any of them ? And if so, could you please provide the model(s) ? And are any of them UL certified ?
The last time I looked into Tasmota, it required hardware modifications to the device in order to be able to load the firmware. I believe this was with smartplugs from Wyze, but could be misremembering. I am not able to do very small hardware modifications such as soldering due to macular degeneration.
Re: (Score:2)
Local Bytes do some that are CE certified, but for Europe of course. There is a big list of compatible plugs here: https://templates.blakadder.co... [blakadder.com]
Sonoff products often support Tasmota too, but can be a bit difficult to flash. The cheaper ones tend to be easier to flash, often just needing a couple of screws removing.
If you can't flash yourself, Local Bytes have them pre-flashed, or you can pre-flashed ones on eBay and AliExpress. I'm sure there must be US suppliers that offer them pre-flashed, if we have
Re: (Score:2)
Shelly devices do not require Cloud access to set up or work properly. They can use cloud, if you want to, but it's not mandatory.
They also seamlessly integrate with Home Assistant.
https://www.shelly.com/ [shelly.com]
Re: (Score:2)
Thanks ! It appears all their Shelly Plus Plug US energy monitoring smartplugs are currently out of stock. There are some on ebay, but they are asking way above MSRP - about twice what I paid for my KP125s per unit. Still, I wish I had known about these before investing in all my KP125s. I didn't realize that setup required cloud at the time. But using the devices does not. TP-Link even advertises the Home assistant local interface in their Kasa app. But it's still impossible to add a plug while ISP is cut
Re: (Score:2)
None of this is Internet-of-shit. All of the things in the post are either open source, or are locally controlled.
By the way Python doesn't use power, and the Kasa smart plug uses less than half a watt. As with everything if you build this system to only run once a year you're probably too stupid to set it up in the first place.
If you're going to do SCADA then build a real SCADA system.
On the flip side SCADA systems have no low power mode and will cost you a metric fuckton. Next time you suggest a solution I invite you to first look at the problem before ranting on
Re: (Score:2)
These days you can get realtime current consumption from processors and GPUs, so the only part not accounted for is the motherboard itself and that is not a huge current draw unless you have a bunch of PCIE 5. It will be a lot less code to read those sensors (you do need appropriate addin kernel modules for the CPU power though) so it should be pretty easy to switch it over from using the network device to just reading some stuff out of proc.
Re: (Score:3)
"showing wattage and current" (Score:2)
Why not "wattage and amperage", beau?
Re: (Score:2)
Yeah, as the venerable Horowitz put it, this "terminology" is strictly bush league.
But I'd still rather have a consistent bush league than a bush league wannabe.
Or ... (Score:4, Interesting)
I set the "cpufreq" governor to "conservative" on my Linux Mint system and (probably) get much the same benefit. (I tried "ondemand" but like the former better for my use...
From Linux CPUFreq Governors [kernel.org]:
2.5 Conservative: The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU frequency depending on the current usage. It differs in behavior in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU.
On my OPNsense system, I enabled PowerD and set the AC and Normal power modes to "Adaptive" (and Battery to "Minimum") -- which seems to give about the same results as on my Linux systems.
Certainly lowers the power consumption when idle -- I tested both systems with a Kill-A-Watt type meter.
Re: (Score:3)
Not the same. This isn't about reducing idle consumption, it's a bout limiting maximum consumption.
The problem of course is that power != energy. It doesn't help me if I save 10% power if my PC runs at this full load 10% longer. It still uses the same energy.
Why monitor, just throttle based on price (Score:2)
Re: (Score:2)
It seems what he is doing is time average limiting his power consumption, not just blindly throttling the CPU. E.g. you may not want to throttle the CPU when it's just performing one quick task. That task itself will be shorter (and use the same energy) thus not saving you anything but slowing down the system needlessly. If on the other hand you're blasting your CPU for a while then it appears to throttle the CPU.
Re: (Score:2)
It seems what he is doing is time average limiting his power consumption, not just blindly throttling the CPU. E.g. you may not want to throttle the CPU when it's just performing one quick task. That task itself will be shorter (and use the same energy) thus not saving you anything but slowing down the system needlessly. If on the other hand you're blasting your CPU for a while then it appears to throttle the CPU.
For years and years I've used the ignore_nice_load option in Linux cpufreq governors. If I know the task will be running longer and it doesn't matter if it takes a bit longer, I'll set its niceness level higher, so it won't trigger an increase in the CPU frequency.
I've also used my own scripts for turning applications on/off depending on electricity price for quite a while. I've only bought my electricity with the hourly market rate for about a year and a half, but the idea really started with my profita
Rube Goldberg would be proud (Score:2)
Rube Goldberg would be proud (Score:2)
The motherboard already has a BMC... (Score:2, Interesting)
The motherboard in question for this setup already has an AST2600 BMC that is capable of reporting real time power consumption for the machine (which makes sense - I can't imagine anyone producing a board of this class without an integrated BMC of some sort). The use of a "smart plug" is completely superfluous, consumes more energy, and requires more effort than using the linux kernel IPMI driver that is already there...
Sounds interesting... (Score:2)
but the price of electricity, for most applications, just doesn't matter. If you have a service and it's only available at super off peak hours, then what good is that when most people will want to use the service in their free time, which is likely during on-peak hours?
I could only see this mattering if you were mining crypto and profit only happened during specific energy price points.
Seems like a neat tool that could have some niche applications but I'm not seeing the widespread appeal here. We should ju
Or We Could Rid the World of AI (Score:2)
You need to generate our own electricity. (Score:2)
Conservation just causes prices to get adjusted upwards over the medium to long term. It's plain economics. Companies will do anything to keep their revenue increasing from year to year.
Conservation works against this dynamic.
What is needed to counter this dynamic is demand destruction. [https://en.wikipedia.org/wiki/Demand_destruction]
Load defection [https://virtual-peaker.com/blog/utility-customer-defection/] accomplishes this and sends the right economic signals to the investor-owned utilities.
Solar + So
How to save even more (Score:2)
Always throttle the PC.
Seems pointless (Score:2)