Hey Henry!
It looks like you are in good hands, so I am not going to attempt to side-track your current path too much...but as you have been re-thinking this, and it is obviously very important to you...I still think you might consider a slightly different approach....
If you define some value of consumption from the mains as a "minimum threshold" below which you consider it economically viable to run the AC units then you can eliminate a great deal of complicated logic design and expensive sensors....and simply use the AC unit's existing thermostat functions to control it...if these are "analog window units" then you could easily add thermostats with the appropriate hysteresis and control features....So this assumes that you can access a standard HVAC "Call For Heat/Cool" output line AND that you install some type of inexpensive current sensor onto your Mains feed....
Psuedo Code or Hard Wired Logic
Code:
Loop:
If Manual Overide = False then
If Real Time Clock > 08:00 AND Real Time Clock < 18:00 then
If Lockout_Timer = False then
If Mains Current > XH Amps then
Set HVAC Call For Heat/Cool Output = False
Set Lockout_Timer = MinOffTime
Go To Loop
End If
If Mains Current < XL Amps then
Set HVAC Call For Heat/Cool Output = HVAC Call For Heat/Cool Input
Set Lockout_Timer = MinOnTime
Go To Loop
Else
Go To Loop
End If
Else
Go To Loop
End If
End If
End if
Set HVAC Call For Heat/Cool Output = HVAC Call For Heat/Cool Input
Go To Loop
At the end of the day you want to minimize your grid consumption and utilize as much of your PV generated power as possible, you don't really care if you keep the house @ 60F during the day, but if you aren't using the PV generated power for other things, then there is no "harm" in running the AC units....You just don't want them to run excessively if you have to supply them with grid power....
By using off-the-shelf or already installed standard HVAC thermostats you can simply "hi-jack" their functionality when for whatever reason your grid demand exceeds a certain "set point"....You can restore their functionality when the grid consumption drops below a second set point, OR you manually over-ride the "hi-jacking" function. Most modern thermostats have a built in compressor delay, and most newer AC untis have a built-in compressor delay....AND you can add "extra" delays into your logic model....
As far as actually implementing the logic, you can use dedicated logic devices, a micro controller or even a PC....this part is fairly simple, the important part is that we define the various "inputs" (ie: Gird Usage, Time Of Day, Need For Cooling Etc....and define appropriate sensors) to determine if you want to allow "normal functionality" or "interrupt normal functionality" of a standard thermostat.....In your case you might want to set the thermostat on your smaller AC unit to 60F and the thermostat on your larger AC unit to 65F thus ensuring they would "generally" be on unless their normal functionality was "hi-jacked' by the above logic...As far as setting the "current trip points", if we assume that the smaller AC unit consumes 2A @ 220V and the larger unit consumes 3A @ 220V and your "normal consumption" with both units off is ~2A then you might set the "on" trip point for the smaller unit @1A. In this case the smaller unit would be "allowed" to turn on during the defined period any time the power consumption dropped below 1A....it would then run for the "minimum on time" (perhaps 10 minutes) before the current consumption was again checked....if the grid consumption 10 minutes later was below the "high" threshold, say 1.5A then the unit would continue to run. If the larger unit had a low current threshold of say 0.5A then it would not turn on until after the smaller unit was already running and if it had a "high threshold" of say 2A of mains consumption then the smaller unit would "drop out" first and the larger unit would continue to run until the mains consumption exceeded 2A.....Obviously the thresholds and set points would need to be adjusted for actual usage, and if you are using 120V units on a 240V grid then current sensing and load balancing will make the current sensing set-up more complicated, but the approach is still viable...assuming it is what you actually want.
OK, so i went into a bit more detail than I was planning when i started, but I really think you should consider this approach....It is a very close approximation to "what you do intuitively when you are home"...and perhaps a bit better;-) If the various automated appliances in your home "turn on" and start using grid power, or if a "cloud" comes over and decreases your PV generated power then your grid consumption increases...by sensing the grid consumption and selectively turning your AC units on/off you can minimize your grid consumption and maximize your PV consumption...and I think this is your goal.
Fish
Edit: Hrmm, all of the "white space" in between the "code tags" vanished....it was a lot easier to follow with the white space, lol. Not much I can do about that :-(
Edit #2: I am going to be peeved if the manually added white space doesn't "stick", lol. Kris, don't know if you know the code writer well, but it should be fairly easy to exclude the code tags from the general white space stripping function.....It really takes ALL the fun out of HAVING code tags if you can't C&P code with white space....I would consider that a fairly major flaw worthy of fixing...obviously...IMHO, lol.