Closed dvdcut closed 4 years ago
@dvdcut thank you for explaining and typing :)
@dvdcut i don't have buffer tank and don't know how heating is circulated from buffer tank. in my place i have to trigger boiler and then zone valve for heating and not to worry about circulation pump but if i had buffer tank then i would have some circulation pump to circulate the heat from buffer tank? so we just need to trigger that pump some what same as we do for gas boiler i would imagine until buffer tank temperature is above set point.
i have been working on this, its not anywhere near finish but its starting point. i have touched boiler.php for second heat source,
CREATE TABLE `buffer_tank` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`status` TINYINT(4) NULL DEFAULT NULL,
`name` CHAR(50) NULL DEFAULT NULL,
`controller_id` INT(11) NULL DEFAULT NULL,
`controller_child_id` INT(11) NULL DEFAULT NULL,
`sensor_id` INT(11) NULL DEFAULT NULL,
`sensor_child_id` INT(11) NULL DEFAULT NULL,
`min_c` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_buffer_tank_nodes` (`sensor_id`),
INDEX `FK_buffer_tank_nodes_2` (`controller_id`),
CONSTRAINT `FK_buffer_tank_nodes` FOREIGN KEY (`sensor_id`) REFERENCES `nodes` (`id`) ON UPDATE SET NULL ON DELETE SET NULL,
CONSTRAINT `FK_buffer_tank_nodes_2` FOREIGN KEY (`controller_id`) REFERENCES `nodes` (`id`) ON UPDATE SET NULL ON DELETE SET NULL
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=2;
<button class="btn btn-default btn-circle btn-xxl mainbtn animated fadeIn" data-href="edit_boiler.php" data-toggle="modal" data-target="#buffer_tank">
<h3 class="buttontop"><small><?php echo $lang['buffer_tank']; ?></small></h3>
<h3 class="degre" ><i class="fa fa-tint fa-1x green"></i></h3>
<h3 class="status"></small></h3>
</button>
//Buffer Tank settings
echo '
<div class="modal fade" id="buffer_tank" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h5 class="modal-title">'.$lang['buffer_tank_settings'].'</h5>
</div>
<div class="modal-body">';
$query = "SELECT * FROM buffer_tank;";
$results = $conn->query($query);
$brow = mysqli_fetch_array($results);
echo '<p class="text-muted">'.$lang['buffer_tank_info_text'].'</p>';
echo '
<form data-toggle="validator" role="form" method="post" action="settings.php" id="form-join">
<div class="form-group" class="control-label">
<div class="checkbox checkbox-default checkbox-circle">';
if ($brow['status'] == '1'){
echo '<input id="checkbox2" class="styled" type="checkbox" value="1" name="status" checked>';
}else {
echo '<input id="checkbox2" class="styled" type="checkbox" value="1" name="status">';
}
echo '<label for="checkbox2"> '.$lang['buffer_tank_enable'].'</label></div></div>
<div class="form-group" class="control-label"><label>'.$lang['buffer_tank_name'].'</label>
<input class="form-control input-sm" type="text" id="name" name="name" value="'.$brow['name'].'" placeholder="Buffer tank name ">
<div class="help-block with-errors"></div></div>
<div class="form-group" class="control-label"><label>'.$lang['buffer_tank_controller_id'].'</label> <small class="text-muted">'.$lang['buffer_tank_controller_id_info'].'</small>
<select class="form-control input-sm" type="text" id="buffer_tank_controller_id" name="buffer_tank_controller_id">';
//get current buffer_tank_controller_id from nodes table
$query = "SELECT * FROM nodes WHERE id ='".$brow['controller_id']."' Limit 1;";
$result = $conn->query($query);
$row = mysqli_fetch_assoc($result);
$controller_id=$row['node_id'];
$notice_interval=$row['notice_interval'];
echo '<option value="'.$controller_id.'" selected>'.($controller_id=='0' ? 'N/A' : $controller_id).'</option>';
//get list from nodes table to display
$query = "SELECT * FROM nodes where name = 'Buffer Controller Relay' OR name = 'Buffer Controller' AND node_id!=0;";
$result = $conn->query($query);
if ($result){
while ($nrow=mysqli_fetch_array($result)) {
echo '<option value="'.$nrow['node_id'].'">'.$nrow['node_id'].'</option>';
}
}
echo '<option value="0">N/A</option>
</select>
<div class="help-block with-errors"></div></div>';
echo '
<div class="form-group" class="control-label"><label>'.$lang['buffer_tank_controller_child_id'].'</label> <small class="text-muted">'.$lang['buffer_tank_controller_child_id_info'].'</small>
<select class="form-control input-sm" type="text" id="buffer_tank_controller_child_id" name="buffer_tank_controller_child_id">
<option selected>'.$brow['controller_child_id'].'</option>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<div class="help-block with-errors"></div></div>
<div class="form-group" class="control-label"><label>'.$lang['sensor_id'].'</label> <small class="text-muted">'.$lang['sensor_id_info'].'</small>
<select class="form-control input-sm" type="text" id="sensor_id" name="sensor_id">
<option selected>'.$brow['sensor_id'].'</option>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<div class="help-block with-errors"></div></div>
<div class="form-group" class="control-label"><label>'.$lang['min_temperature'].'</label> <small class="text-muted">'.$lang['min_temperature_info'].'</small>
<select class="form-control input-sm" type="text" id="max_operation_time" name="max_operation_time">
<option selected>'.$brow['min_c'].'</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="45">45</option>
<option value="50">50</option>
<option value="55">55</option>
<option value="60">60</option>
<option value="65">65</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="85">85</option>
<option value="90">90</option>
<option value="95">95</option>
<option value="100">100</option>
<option value="110">110</option>
<option value="120">120</option>
</select>
<div class="help-block with-errors"></div></div>
';
echo '</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">'.$lang['close'].'</button>
<input type="button" name="submit" value="Save" class="btn btn-default login btn-sm" onclick="buffer_tank_settings()">
</div>
</div>
</div>
</div>';
### en.php for language
$lang['buffer_tank'] = "Buffer Tank"; $lang['buffer_tank_settings'] = "Butter Tank Settings"; $lang['buffer_tank_info_text'] = "A buffer tank is a backup/reserve tank for storing heating in form of hot water which can be called upon when needed. Buffer Tanks are designed for use with standard central heating systems (biomass or solid fuel systems in conjunction with solar water heating system) If you have Butter Tank installed and you want to used it as primary heat source you can add this information here. "; $lang['buffer_tank_enable'] = "Enable"; $lang['buffer_tank_name'] = "Name"; $lang['buffer_tank_controller_id'] = "Controller ID"; $lang['buffer_tank_controller_id_info'] = "Buffer Tank Controller"; $lang['buffer_tank_controller_child_id_info'] = "Controller Child ID Where Circulation Pump is Connected"; $lang['sensor_id'] = "Sensors ID"; $lang['sensor_id_info'] = "Temperature Sensors Connecteted to Buffer Tank"; $lang['min_temperature'] = "Minimim Temperature"; $lang['min_temperature_info'] = "Select Minimim Temperature"; $lang['buffer_tank_controller_child_id'] = "Controller Child ID";
@dvdcut, i will give it try tomorrow, your code missing request.js and db.php code.
@dvdcut i had implemented your changes, all looks good on gui apart from buffer tank info text, i think its to long. its like explaining what buffer tank is, i think one short line would be enough.
A buffer tank is a backup/reserve tank for storing heating in form of hot water which can be called upon when needed. Buffer Tanks are designed for use with standard central heating systems (biomass or solid fuel systems in conjunction with solar water heating system) If you have Butter Tank installed and you want to used it as primary heat source you can add this information here.
Buffer tank implementation proving to be more difficult then i thought, i dont know if its all worth in the end or one differential controller would be better option. anyway i have done some work in last few days on buffer tank i think all gui part is completed but boiler.php is proving to be bit difficult.
@dvdcut all GUI looks good, and i can see buffer tank on main screen and all settings working for buffer tank but i think boiler.php need some working and logic isn't there yet in the code, its partially working.
yes, login in boiler.php isnt implemented and its proving to be difficult, i'll work on this issue in new year.
i think i have to drop this, i have found that every buffer tank comes with its controller so i think we don't need this. we can always add butter as zone disable zone to monitor its temperature
@dvdcut i think you are right and not many user have buffer tank big enough to run heating from it but only supplement hot-water for the house. closing this
Buffer Tank - Second Heat Source
Some background and explanation about buffer tank and combined storage tank.
Buffer Tank:
A buffer tank is a backup/reserve tank for storing heating in form of hot water which can be called upon when needed. Buffer Tanks are designed for use with standard central heating systems (biomass or solid fuel systems in conjunction with solar water heating system. The water is heated by the heat source (solar, biomass or wood boiler) to a set temperature in the tank and this hot water can be stored until it is required. It therefore will reduce the ‘short cycling’ of a boiler, in that it will reduce the amount of times that a boiler will turn on and off to heat the water and in doing this it will help to increase the lifetime of the boiler.
Combined storage tanks
A combined storage tank combines hot water storage for heating support. As a result, warm water, typically from solar thermal energy is stored temporarily for both purposes for later consumption. (its rare installation but still if some one else can shed some light and give schematic for connection and how to control it)
Option for second heat source:
As i understand right now PiHome do not support second heat source and now way of controlling it or deciding where the heat comes from (heat sources is defined as boiler) and heat comes from same single source.
Suggestion:
Option One
Build some differential controller with two sensors and two relay and let that differential controller to decide where the heat comes from, PiHome only send instructions when there is demand for heat. This would be ideal if buffer tank and boiler are in same location.
Option Two
In some cases buffer tank and boiler aren't in same location hence one differential controller isn't going to work. configure/modify PiHome to have buffer tank as second heat source or should I say proffered heat source and if that heat source is above set point then heat should be called from buffer tank and if buffer tank is below set point then call for heat from second heat source i.e gas boiler. i know second option requires two controller: one for boiler and second for buffer tank.
This would be huge advantage for PiHome over commercially available solution in the market. all commercially available solutions do not have any way of managing or calling second heat source in managed and decent way as far as i tell (may be i m wrong but i m open to correction). I would prefer to see PiHome managing/controlling second heat source from itself and second option would definitely gives more controller rather then having only option one implemented, also implementing option one would left out all those who's boiler and buffer tank in separate locations.
sorry for long story but i felt the needs explaining, i m not an expert by any mean and open to correction.