Using Solar Panels for Heat Pump (AC) Power

I. Motivation

With our brutal summer heat and generally sunny weather, one might think that every rooftop in my hometown of Phoenix would be plastered with solar panels. But that’s not the case. The reason is simple – panels and installation are expensive, and power pricing plans make it difficult to justify the cost.

Last year I decided to bite the bullet, install solar, and find a way to offset my energy costs with a payback time of under 10 years. Unfortunately, it’s not easy.

The power utility for my area is Salt River Project. SRP provides reliable power and offers a few pricing plans. The most economical are the “time of use plans,” and before installing solar panels we had a plan with peak summer rates between 2:00PM and 8:00 PM. In recent years, I’ve adopted the approach of “supercooling” the home during off-peak hours and allowing the temperature to rise during off-peak hours. (We are very disciplined about the use of major appliances during peak-rate periods.) Here is an example of a day from last July:

My apologies to those who use the Celsius scale. I’m missing power use data for this time range, but typically the downstairs (primary) heat pump would turn on and maintain temperature between 18:00 and 20:00. So, we would incur peak rate costs for these hours. This time window presents an opportunity for cost savings, if grid demand could be delayed until after 20:00 (8:00 PM). My ulterior motive is to also make the home more comfortable in the late afternoon and evening.

Unfortunately for me, the only solar pricing option that offers any hope of a reasonable payback period features “Peak demand” charges (on top of use charges, other fees, taxes, etc. etc.). To keep costs low, it is important to avoid significant grid demand (kW) during peak-rate periods. The pricing curve accelerates with increasing demand. Also, the demand charge is determined by the single-largest demand of the billing month, during a 30-minute window. Yikes!

FYI It is very easy to pull over 12 kW on a hot day. :hot_face:

As I understand, the two common approaches to controlling demand are 1) demand controllers (which shut off power to major appliances if grid power is above a threshold) and 2) battery storage. Demand controllers are too blunt of an instrument for my purposes, and batteries are uneconomical. But I have home automation, so I can figure this out – right? Right?? :flushed:

1 Like

II. Equipment

When I started the project, I ordered a Sense Home power monitor, two Ecobee smart thermostats, and (assuming somehow it would be useful) a Hubitat Elevation. I had no experience with smart-home hubs before this.

I have two heat pumps, each with inverter-based variable speed operation for high efficiency.

After realizing that there is no Hubitat integration for the Sense device, I decided to install and learn Home Assistant. The learning curve has been steeper than for the HE. But it works and is quite powerful. Polling for power data using the HA Sense plug-in is once every 60 seconds.

A note about Sense. I’ve read in this forum and elsewhere a number of complaints about the Sense Home power monitor, with folks saying the device fails to identify all important home appliances and devices. I find, however, that despite this issue the device reports total power consumption and solar generation accurately, with near-real-time performance (within about a second). With the handy phone app, I can monitor graphs of power use and watch as devices turn on and off. Even before the unit’s AI identified my downstairs heat pump, I was able to identify and plot the power use as it ramped up the compressor and then the air handler. Understanding differences between the power use of my two heat pumps has been valuable for developing the control logic that follows in section IV.

Oh, and for solar power I have REC400AA panels (6.8kW rated) with Enphase IQ8M micro-inverters. Peak production so far is a little over 5 kw. I have the panels on a west-facing section of the roof, in order to maximize output in the mid-late afternoon, during the peak-rate period.

III. General Approach

I’ve become a big fan of the Hubitat Elevation, which I use to control my smart home devices (mostly Zigbee). I’ve decided to use the HE to control the two Ecobee thermostats, and to allow the Ecobees and the heat pump controllers to do the control of the cooling in the home.

To avoid rapid on-off cycles, which would be hard on the compressors, the HE provides temperature setpoints (not on or off commands, fan settings etc.).

Following a recommendation from @SmartHomePrimer, I’m sharing virtual switches created in the HE with Home Assistant. One switch is used for each heat pump, representing a logical “on” or “off.” For cooling mode “on” refers to “reduce the setpoint,” and “off” to “increase the setpoint.” The HE reads the switch states and sends the corresponding setpoints to the Ecobee thermostats.


I’ve put some thought into how to automate everything for completely hands-off control of the cooling (and winter heating). But I admit that the overall problem has me stumped. There are so many variables – varying solar output (we do have the occasional cloud), varying heat input to the home, variable temperature difference desired between inside and out, thermal lag of the home itself, recovery time, varying power use by the equipment, etc. etc. Add to that the complexity of controlling two heat pumps, each of which can consume much of the power generated by the solar panels.

I’ve been looking at OpenWeatherMap temperature forecasts as a possible automation trigger, but now and then I notice that there is an issue pulling data. So, I’m simply enabling the automation when it’s hot outside.

Power Curves:

The sample above shows power use and generation curves for a one-hour time window. One heat pump is holding a steady setpoint and ramps up and down in a characteristic pattern. The square-profile on the right is from running a microwave oven.

Observation over time suggests typical power draw:

Upstairs unit ~1800 watts, max ~4000 watts

Downstairs unit ~2800 watts, max ~5500 watts

Priority for hot afternoons is to run the larger downstairs unit. When there is not enough net power to run the downstairs (during peak periods), then the system should check whether there is enough net power to run the upstairs unit.

IV. Automations (preliminary)

Two automations run concurrently. In Home Assistant, I’ve defined virtual sensors for grid export and import (plus other stuff that I use elsewhere). These values are used to set virtual switches that are shared with Hubitat Elevation.

Here is a first-pass Rule Machine routine that I plan to test. I anticipate breaking this into a few time intervals as the temperatures climb, but it’s what I can show at the moment.

Setpoints are in Fahrenheit. Note that the “low” setpoint for the Upstairs thermostat is higher than the corresponding value for the Downstairs unit. This is intended to reduce a natural bias toward running the upstairs unit, since power conditions are easier to satisfy.

HA automation

Here I’m using the Node-Red plug-in for Home Assistant. I like the idea of graphical programming.

The trigger runs every 30 seconds, and the value for Net Power Production* is sent to a function node, where a 4-sample running average is calculated. (This is to reduce “noise.”). I’ve set the switch states to update more frequently than the main automation in Hubitat, and I may update the number of samples once there is more data.

*Defined to be ≥ 0 w.

FYI here is the JS code for the rolling average:

let values = context.get("values") || [];


if (values.length > 4) {



let sum = values.reduce((acc, curr) => acc + curr, 0);

let avg = sum / values.length;

context.set("values", values);

msg.payload = avg;

return msg;

For the switch node “Power” the output range for each path is:

  1. (Top) 1500-2500w
  2. above 2500w
  3. 1-1499 w
  4. (Bottom) 0w

As suggested by the “Call Service” nodes, path 1 resuts in a call to turn on the upstairs AC (heat pump) and to turn off the downstairs unit. Paths 2 and 4 should be easy to understand.

Path 3 is there in case one of the heat pumps is running when the automation is triggered. In such a case it’s possible for there to be enough power generation to keep running the same heat pump. There is a check to see how much total power the home is using, and if it is > 1800w to assume that all is well, and to “do nothing.”

V Early Testing

For the winter heating and late spring cooling (a few warm days in April), I’ve been able to confirm the switch automation and that (other) Rule Machine automations correctly read these switch states and that the Hubitat Ecobee automation works as intended.

From the sample history plot above, I think that there is room for improvement for switch setpoints. I’m leaning toward increasing the running-average for net power from 4 to maybe 10 samples. On the sampled date of April 10, we had major appliances running in the middle of the day (not on Summer rates yet).

If anyone is interested in this topic, I could post an update during the summer.


Thanks for the post.

Extremely detailed and a worthy project. Wow.


Interesting project, we have a TOU energy tariff in Melbourne, Victoria too from 3pm to 9pm everyday and only 5c p-Kwh FiT.

So for us it was worth while to get a Tesla Powerwall 2 which allows us to store a fair proportion of our solar power and gets us past the peak period on most days that have Sun.


I’m glad the PowerWalls make sense for you. Frankly, I’d prefer to have storage than generation, all things being equal. But it seems that I can’t install batteries without Solar. Roughly speaking, with installation my cost for batteries would be on par with the panels, essentially almost doubling the potential payback.

I estimated 18 years payback when I ran the numbers. I don’t expect batteries to last that long.

I wonder if I’ll last that long myself. :thinking:



Payback in Australia where were live Is roughly 9 years by my calculations. Mainly due to power being so expensive and us having already paid off our solar system.

1 Like

You definitely can, during the winter I run our Powerwall in “time based control” Mode which automatically charges up the battery from off-peak power and then switch to “self powered” when the Sun starts shining again in spring . This way we avoid big power bills in the non-sunny months.

1 Like

Unfortunately, most utilities in the US will not allow us to do that.

1 Like

Oh that sucks.

1 Like

The situation re battery storage may be changing here in in the US (new Federal law etc.). However, I already have solar, and even with new incentives it would be expensive to add storage.

If grid power were to become less reliable, I'd be motivated to consider adding storage regardless of economic payback.

In the mean time I'm focused on making this scheme work.

We are in the Yarra ranges (outer east of Melbourne Suburbs) and get a lot of small outages due to trees falling etc. we’ve also had a few big storms that caused multiple day power outages and not being able to go off grid with just solar was very frustrating.

Getting a Powerwall was surprisingly affordable though one of the power companies here. They offered 2% finance and fully installed for $13k AUD if you joined their VPP for 12 months.

The Powerwall, by my calculations, is covering 1/3rds of its cost on average and combined with the solar system has massively boosted the value we get from our solar system.

1 Like

I really want an off-grid minisplit powered only by solar, not grid tied. They do make them, but they are super expensive compared to a normal minisplit. That is the only viable way to make solar pay with my horrible utility and the pittance they buy back solar. Otherwise, I need to store energy with expensive batteries, or with water and resistance heating, which doesn't help in the summer (but would in winter).

The supercooling does work, with my house I can "coast" from about Noon to 6 PM after cooling to 67 in the morning when rates are cheaper. The house hits about 71 at dinner time, and with cooking heat etc, I can't quite make the 8PM rate cutoff. However I am working on insulation and so on to try and improve that.

I would like to see an update and how this works for you.


Heat pump water heaters are the new hot thing in Australia (see what I did there :wink:), they use much less energy than gas or traditional electric water heaters.


The Yarra ranges look beautiful. I hope it is nice as the tourist photos suggest.

The cost savings you show - what is the time period? The values are greater than my total monthly bill during peak summer (~US $290).


Oh they are, we are in the foothills only 15 mins away from Olinda and other amazing parts of the ranges.

That's just this year so far - dont forget that our seasons are inverted down under.

We used to pay around $3,000 AUD per year for power, solar cut that in half. The battery is saving us maybe another $700 per year (it's hard to cal properly due to the way it covers the solar generation fluctuations (eg clouds) so im being very conservative.



Thank you; will do. Anything off-grid is expensive.

With my micro-inverters (IQ-8), I could add another controller to enable powering the home on solar when the grid is down. But I wouldn’t want to risk running heat pumps this way.


They really dont like frequently losing power while running, it'll damage them in the medium term. It's best to have battery storage and run them from that. A single PW2 will provide 5kW continuous and 7kW peak which is more than enough for most homes.

That said, I'd like to add a second PW at some point in the future as even our little 5.4kW system can generate more than double the 13.5kWh of energy a PW2 can hold (my record is 40kWh's in one day).

1 Like

Download the Hubitat app