pihome-shc / pihome

PiHome - Smart Heating, Ventilation and Air Conditioning (HVAC)
http://www.pihome.eu
Other
55 stars 25 forks source link

Circulation Pump Overrun #263

Closed pihome-shc closed 4 years ago

pihome-shc commented 4 years ago

This issue was raised previously via email to me and i did this quick dirty trick in boiler.php to accommodate over run for circulation pump/boiler pump. i have same issue in my place but i have this i think its called loop. here is update form user:

Hello. I have a fully wired setup. I have updated your zone (pump) overrun code in boiler.php for the new version, as follows:- insert after line 586 …

$query = “SELECT * FROM boiler_logs ORDER BY id DESC LIMIT 1;”;
$result = $conn->query($query);
$blrow = mysqli_fetch_array($result);
$bstop_datetime = $blrow[‘stop_datetime’];
$phpdate = strtotime( $bstop_datetime );
$now=strtotime(date(‘Y-m-d H:i:s’));
$overrun_time = $phpdate + (1 * 60);

if ($overrun_time > $now){
echo “\033[36m”.date(‘Y-m-d H:i:s’). “\033[0m – Circulation Pump Need to overrun. \n”;
exec(“python3 /var/www/cron/gpio/gpio3_relay.py “.$zone_controler_child_id.” “.$relay_on);
}else {
echo “\033[36m”.date(‘Y-m-d H:i:s’). “\033[0m – Circulation pump need to Shutoff. \n”;
exec(“python3 /var/www/cron/gpio/gpio3_relay.py “.$zone_controler_child_id.” “.$relay_off);
}

It works, but every overrun is through the Hot Water zone (ie the last zone in the boiler.php run). Does anyone have any suggestions for a modification that would make the overrun zone be the same as the zone just ended – meaning, if Downstairs zone just ended then the overrun zone would be Downstairs – not Hot Water as now ? Reminder – mine is a fully wired 3 zone system, with 4 way relay, the extra one for the boiler so it can be shut off 60 seconds before the zone valve/pump.

Any suggestions would be much appreciated – many thanks for reading.

aszumski commented 4 years ago

@pihome-shc basically you want to delay valve close. It would be easy enough to delay it by one boiler.php run after implementing changes for zone status.

change standard relay command: if ($zone_controller_type == 'GPIO'){ $relay_status = ($zone_status == '1') ? $relay_on : $relay_off;

with

if ($zone_controller_type == 'GPIO'){ $relay_status = (($zone_status == '1')||($zone_status_prev == '1')) ? $relay_on : $relay_off; and move code that updates zone_current_status $query = "UPDATE zone_current_state SET... below the code that commands the relay.

That would delay every zone stop, not only when the boiler stops. thing is you don't know if boiler stops until all zones are processed.

To delay only last valve close when boiler stops it would require separate loop for zone commands after all zones are processed,and would require passing data between the loops.

dvdcut commented 4 years ago

I have radiator next to the boiler and i have to leave it one (not fully on) so when all zone valve are closed boiler still need to circulate water for extra 20ish seconds its waste of energy as it just need to stay on all the time, that is my overrun, can we add this code in for everyone ? not just gpio connection?

@aszumski moving $query = "UPDATE zone_current_state SET after if ($zone_controller_type == 'GPIO'){ $relay_status = (($zone_status == '1')||($zone_status_prev == '1')) ? $relay_on : $relay_off; not going to make difference, its just updating gui only.

aszumski commented 4 years ago

@dvdcut you are right moving UPDATE zone_current_state wont change anything. as we already pulled value of $zone_status_prev at the start of the loop.

To do it properly (keep the valves that ware open just before boiler stop, and close it straightaway when you shut zone but boiler keeps running ), we really need separate loop for zone commands and adjustable time in boiler settings, for example my boiler stops when you shut it off and then after couple of minutes circulates pump for couple of seconds probably to get hot water out of boiler (I have custom code that opens one of the valves all the time when boiler is not running). I'm OK to leave the valve open as I use ball valves, and they draw current only when opening/closing, for someone using solenoid type valves it might be better to close after a while as they draw little bit of current. In my case delaying closing by one scan would not be enough.

So it would be best to give user option for overrun time, if it's set to 0 no overrun greater than zero overrun in minutes, less than 0 (default -1) keep the zones valves that ware active before boiler start open until next boiler start (if it starts same zone during next boiler start valve is being kept open, if you don't run the zone close it).

I will try to do some code for it and see how it works

dvdcut commented 4 years ago

@aszumski yes adding option to boiler for user to have this overrun would be great

pihome-shc commented 4 years ago

@aszumski tested this update and it is working as expected.

pihome-shc commented 4 years ago

Comments on PiHome site by Ian:

Good afternoon. Zone/Pump overrun tested and is working very well. I tested using boost facility on single zones and also on multple concurrent overlapping zones - all good. Many thanks, your help is much appreciated and please also pass on my thanks to @aszumski. Kind regards

dvdcut commented 4 years ago

@aszumski i have done testing few times myself (i have wireless boiler and zone controller) and i can confirm it works great, i have turned off that radiator for good now, my pull request #287 was to understand how i can increase time to may be 2 minutes. i think we can add this to boiler table.

dvdcut commented 4 years ago

i have done all the work, i dont know how to do multiple pull request :cry: so i will wait for #287 to get added and i'll do another pull and this will be done from gui

pihome-shc commented 4 years ago

@dvdcut interesting work on #287 :) sorry can not help you on multiple pull requests i m no expert on GitHub.

dvdcut commented 4 years ago

@aszumski icon for boiler overrun is not very visable in outline as its very small icon, i suggest better change this from class="fa ion-ios-play-outline orange fa-fw to class="fa fa-play orange fa-fw"

image

aszumski commented 4 years ago

@dvdcut Chose this icon so it doesn't stand out :) I taught it's nice to know what is driving your zone valve open but it's not very important information. I don't mind changing it if you think it should be more visible.

dvdcut commented 4 years ago

its nice to see this feature i think and why not show users as well that system is working.

pihome-shc commented 4 years ago

@aszumski / @dvdcut can we close this issue if no further update required on this?

dvdcut commented 4 years ago

its all working great thanks to @aszumski for all the hard work. this can be closed as far i can think

aszumski commented 4 years ago

I think this can be closed. @dvdcut thanks for the front end changes.