Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Estimating Air Conditioner Energy Use and Cost in Python

The number printed on an air conditioner is rarely the number you pay for. A "1.5-ton" split unit doesn't draw 1.5 of anything from the wall, and it doesn't run flat out all day. If you're building an energy dashboard, a smart-plug integration or just want to sanity-check a bill, you need to turn cooling capacity, efficiency and real running time into kilowatt-hours, then into money. This…

An air conditioner's energy consumption and cost cannot be accurately determined by simply looking at the tonnage or cooling capacity printed on the unit. This is because the wattage drawn by the AC depends on its efficiency rating (EER or COP) and the duty cycle of the compressor, which varies based on whether it is a fixed-speed or inverter unit.

In Python, you can calculate the electrical power consumption in kilowatts using a function that takes in the cooling capacity (in tons or BTU/h), efficiency rating (EER or COP), and returns the electrical power in kW. The function also allows for the specification of the duty cycle, which represents the fraction of time the compressor is running at full power. This is crucial as a fixed-speed compressor turns on and off, while an inverter compressor varies its speed.

To find the daily energy consumption, the function `daily_kwh` is used. It multiplies the electrical power by the number of hours the unit runs per day and the duty cycle. This gives the total kWh consumed per day.

When dealing with tiered or slab tariffs, where the price per kWh varies based on consumption brackets, a separate function `slab_cost` is provided. This function accepts a list of tuples, each containing the upper limit of the consumption bracket (or None for the 'and above' bracket) and the corresponding price per kWh. The function then calculates the total cost based on the amount of energy consumed in each bracket.

In practice, to get accurate measurements of real-world energy usage, it is recommended to use a smart plug or a clamp-on current sensor to monitor the actual consumption. By dividing the measured kWh by the calculated kW and hours on, you can determine the actual duty cycle of the air conditioner. This information is vital for understanding the true energy costs and for optimizing the usage of the device.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Eliminating Dead-End Calculators & Redirect UTM Loss Across a 100-Route SvelteKit CAD App

When a homeowner or contractor opens a room-sizing tool from Google Search or Pinterest, two quiet engineering mistakes leak half your organic conversions: The calculator stops at a number: the user…

  • PlanCaliber upgrades 100 routes in SvelteKit CAD app to eliminate dead-end pages
  • Standardized printable spec bars pass plain string array and live parametric CAD href
  • UTM query strings preserved in SvelteKit 301 redirects via Cloudflare Worker edge

AWS Student Community Day Islamabad: Build, Deploy, Scale — A Day of Learning, Innovation and Connection ☁️

AWS Student Community Day Islamabad: Build, Deploy, Scale — A Day of Learning, Innovation and Connection ☁️🚀 Attending AWS Student Community Day Islamabad was an incredible experience filled with…

  • Over 700 students and professionals attended AWS Student Community Day in Islamabad.
  • Sessions covered Cloud Computing, AI, DevOps, and emerging technologies.
  • Panel discussion focused on future of AI, Cloud, and career prospects in tech industry.

Print a Giant Wall Poster at Home by Tiling an Image Across A4 or Letter Pages

A large-format print shop is the right choice for a gallery canvas. It is the wrong choice for a weekend mural, a classroom display, or a party backdrop you need tomorrow.

  • Choose high-quality image with 2,000 to 4,000 pixels on long side
  • Use browser-based software like BlockPoster to slice image into sheets
  • Print "Actual Size" with 5 mm overlap for seamless assembly

More from Saturday, 28 November 2026 →