Updated – December 29, 2022
A load-dependent switching threshold is intended to prevent overloading of the line supplying shore power. Based on the maximum permitted power, 3,100 W assumed here, and the maximum ALDE electric heating power of 1,500 W (level I -> 1,000 W, level II -Y 500 W), there is around 1,600 W of flexibility.
The program:
The code:
real pwr = dom.GetObject("HG_LM_POWER").Value(); WriteLine("Pwr.");WriteLine(pwr);
var not_heating = dom.GetObject("SV_IT").Value(); WriteLine("not_heating");WriteLine(not_heating);
if ((pwr > 1) && (pwr < 2201) && (not_heat == false))
{
dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(1);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(1);
var P = "P > 1 < 2201"; dom.GetObject("Current_Load").State(P);WriteLine(P);
}
elseif ((pwr > 2200) && (pwr < 2601) && (not_heat == false))
{
dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(0);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(1);
var P = "P > 2200 < 2601"; dom.GetObject("Current_Load").State(P);WriteLine(P);
}
elseif ((pwr > 2600) && (pwr < 2801) && (not_heat == false))
{
dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(0);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(1);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(1);
var P = "P > 2600 < 2801"; dom.GetObject("Current_Load").State(P);WriteLine(P);
}
elseif ((pwr > 2800) && (pwr < 3101) && (not_heat == false))
{
dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(0);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(1);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(0);
! var P = "P > 2800 < 3101"; dom.GetObject("Current_Load").State(P);WriteLine(P);
}
elseif (pwr > 3100)
{dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(1);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(0);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(0);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(0);
var P = "P > 3100"; dom.GetObject("Current_Load").State(P);WriteLine(P);
}
elseif (not_heat == true)
{
dom.GetObject("BidCos-RF.IEQ0101895:1.STATE").State(0);
dom.GetObject("BidCos-RF.IEQ0101895:2.STATE").State(0);
dom.GetObject("BidCos-RF.IEQ0101895:3.STATE").State(0);
dom.GetObject("BidCos-RF.SEQ3114635:1.STATE").State(1);
}
The output of the script (if the lines WriteLine(" ... ")
are not commented out):
Pwr.
1882.919998
don't_heat
false.false
P > 1 < 2201
The script evaluates the system variable HG_LM_POWER
from the previous script, as well as the status of channel 1 of the Homematic 4-way relay module that switches the heating pump.
If there is sufficient power reserve, e.g. less than 2,301 W, the status of the pump 1
, i.e. the system variable don't_heat
= false.false
, then according to if
-Branch stages I and II switched on.
For example, if the coffee machine is activated, an additional 800 W is required. The previous output of 2,131.7 W becomes 2,931.7 W.
The second one then takes effect elseif
-Branch and Stage I is turned off.
Once the coffee machine is switched off again, the power requirement is reduced to the previous level and level I is switched on again.
The other scenarios work in the same way.