Completely redesigned color scheme:
And a complete new view and control of the heating:
Above we see the 5 rooms that are controlled by Domoticz and Danfoss valves.
Rooms in red are hot enough, blue room needs heating.
You instantly see a complete overview, how much difference there is, desired temperature, actual temperature and the setpoint of the valves.
The + sign right of the bathroom indicates that that room needs the most heat.
Valves in such rooms receive by default a setpoint +2°C setting. This way the valves are already open before the temperature drops below the desired setpoint. Before I put this in place I noticed that sometimes the heater burns with all valves closed, this because of the x minutes wake-up interval of the valves.
Example of advanced heating schedule:
Code: Select all
//Slaapkamer tobi
$Settobi = 8.0;
$setpointtobi = cget('setpointtobi');
if($setpointtobi!=0 && $RTtobi < $eenuur) {cset('setpointtobi',0);$setpointtobi=0;}
if($setpointtobi!=2) {
if($Tbuiten<15 && $Sraamtobi=='Closed' && $Sheating=='On' && ($STraamtobi<$tweeuur||$time > $achtavond)) {
$Settobi = 12.0;
if (date('W')%2==1) {
if (date('N') == 3) { if($time > $achtavond) $Settobi = 16.0;}
else if (date('N') == 4) { if($time < $zevenochtend || $time > $achtavond) $Settobi = 16.0;}
else if (date('N') == 5) { if($time < $zevenochtend) $Settobi = 16.0;}
} else {
if (date('N') == 3) { if($time > $achtavond) $Settobi = 16.0;}
else if (in_array(date('N'),array(4,5,6))) { if($time < $zevenochtend || $time > $achtavond) $Settobi = 16.0;}
else if (date('N') == 7) { if($time < $zevenochtend) $Settobi = 16.0;}
}
}
$Settobi = number_format($Settobi,1);
if($Rtobi != $Settobi) {Udevice($RItobi,0,$Settobi,'Rtobi');$Rtobi=$Settobi;cset('temptobi', serialize(array('1' => $Settobi, 't' => $time)));}
}
$diftobi = number_format($Ttobi - $Rtobi,1);
Above we see that the default setpoint of Tobi's room is 8°. If several conditions (hour of day, day of week, odd/even weeknumber and window closed) are in place the setpoint is raised to 16°.
The room that needs the most heating is partly choosen by this part:
Code: Select all
$kamers=array('living','badkamer','alex','tobi','kamer');
$bigdif=100;$rooms = 0;
foreach($kamers as $kamer) {
${'koud'.$kamer} = false;
if(${'dif'.$kamer}<$bigdif) {
$bigdif = ${'dif'.$kamer};
}
if(${'dif'.$kamer} <= $bigdif) $rooms = $rooms + 1;
if(${'dif'.$kamer} < 0) ${'color'.$kamer} = '#1199FF';
else if(${'dif'.$kamer} > 0) ${'color'.$kamer} = '#FF5511';
else ${'color'.$kamer} = '#AAAAAA';
${'Set'.$kamer} = number_format(${'Set'.$kamer},1);
}
Also the controlling of the relay for the burner is optimized. Heater is already switched off before the temperature is achieved, this way I optimally make use of the remaining heat in the radiators.
Depending on the biggest difference between actual temperature and setpoint, number of 'cold' rooms, I decide when and how long the heater is active:
Code: Select all
if ($bigdif <= -0.2 && $Sbrander == "Off" && $STbrander < $time-60 ) {Schakel($SIbrander,'On', 'brander');logwrite('1 Brander On OR -0.2, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if($bigdif <= -0.1 && $Sbrander == "Off" && $STbrander < $time-290) {Schakel($SIbrander,'On', 'brander');logwrite('2 Brander On OR -0.1, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if($bigdif <= 0 && $Sbrander == "Off" && $STbrander < $time-550) {Schakel($SIbrander,'On', 'brander');logwrite('3 Brander On OR 0, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if ($bigdif >= 0.1 && $Sbrander == "On" && $STbrander < $time-60 ) {Schakel($SIbrander,'Off','brander');logwrite('4 Brander Off AND +0.1, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if ($bigdif >= 0 && $Sbrander == "On" && $STbrander < $time-(90 * $rooms * 0.65 )) {Schakel($SIbrander,'Off','brander');logwrite('5 Brander Off AND 0, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if ($bigdif >= -0.1 && $Sbrander == "On" && $STbrander < $time-(180* $rooms * 0.65 )) {Schakel($SIbrander,'Off','brander');logwrite('6 Brander Off AND -0.1, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
else if ($bigdif >= -0.2 && $Sbrander == "On" && $STbrander < $time-(360* $rooms * 0.65 )) {Schakel($SIbrander,'Off','brander');logwrite('7 Brander Off AND -0.2, was '.$Sbrander.' for '.($time - $STbrander).' seconds');}
For some reason, since I moved to Syno, I can't access the domoticz db anymore. Therefore I searched a different way to display multiple sensors in one graph:
By calling the history of 3 sensors I was able to accomplish that:
Code: Select all
if($setpoint>0) {
$temps = json_decode(file_get_contents('http://127.0.0.1:8084/json.htm?type=graph&sensor=temp&idx='.$sensor.'&range=day',false,$ctx),true);
$setpoints = json_decode(file_get_contents('http://127.0.0.1:8084/json.htm?type=graph&sensor=temp&idx='.$setpoint.'&range=day',false,$ctx),true);
$radiators = json_decode(file_get_contents('http://127.0.0.1:8084/json.htm?type=graph&sensor=temp&idx='.$radiator.'&range=day',false,$ctx),true);
$graph = array();
foreach(array_keys($temps['result']) as $id) {
array_push($graph, array('Date' => $temps['result'][$id]['d'], 'Radiator' => number_format($radiators['result'][$id]['te'],1), 'Setpoint' => number_format($setpoints['result'][$id]['te'],1), 'Temperature' => number_format($temps['result'][$id]['te'],1)));
}
}