Closed sandreialexandru closed 3 years ago
In scheduling.php, after line 327 insert this
$query = "SELECT * FROM zone_sensors WHERE id = {$row['zone_id']} LIMIT 1";
$result = $conn->query($query);
$zs_temp = mysqli_fetch_array($result);
$zs_max = $zs_temp['max_c'];
then change $max = xx
to $max = $zs_max
This solution rezolves the problem only when editing schedule or night schedule, but when trying to add a schedule, the slider goes up to 100
Hi,
To be honest I don't think max_c was intended to be used to determine the upper limit of the slider, these vales are hardcoded at line 330 onwards. I think the idea for max_c was that it is is used in boiler.php as part of the boiler control
Hello, I think it is a bit weird that we can set the slider up to 30, but the maximum allowed temperature of the zone is 25 (numbers are hypothetical). My solution to this, was to get max_c from database into a variable called zs_max and replace the values of $max at lines 332, 335, 338, 341 with $zs_max
@pihome-shc how do you want to handle this issue ?
What is your opinion on this matter @pihome-shc ?
@sandreialexandru right now we have max value of slider hard coded taking this value from zone max value ould work as well, dont mind if you want to set this, also change text on zone creation to notify user about this.
I am aware of the fixed value for the $max , but changing the value to zone's max temperature would improve the logic. Is it just me that thinks it is strange seeing the slider go higher than the maximum allowed temperature for the zone?
i agree, it will make more sense if we set the slider's limit to zone max temperature, having hard coded slider max value just overlooked.
Maybe @twa127 could help. I'm not an expert at php/sql . My only solution to this is : _In scheduling.php, after line 327 insert this
$query = "SELECT * FROM zone_sensors WHERE id = {$row['zone_id']} LIMIT 1"; $result = $conn->query($query); $zs_temp = mysqli_fetch_array($result); $zs_max = $zs_temp['max_c'];
then change $max = xx to $max = $zs_max
This solution rezolves the problem only when editing schedule or night schedule, but when trying to add a schedule, the slider goes up to 100_
Okay leave it with me and I'll see what I can come up with
I've committed an update, the max temperature is now set to the zone value for max_c, the minimum slider value is still hardcoded in scheduling.php. Note: Requires the Views to be updated.
@twa127 please have a look, if you can, at EDITING an existing holiday schedule. The slider goes to 100. When ADDING holiday schedule the slider works ok. Also, for me, deleting holidays doesn't work. Night climate is the same.(slider to 100)
The holidays scheduling uses the same schedule_daily_time_zone_view so should work the same. Please post a dump of your database and I'll have a look
pihome_db.zip this is my database, no alterations
Hi,
Looks like you have not updated views schedule_daily_time_zone_view and schedule_night_climat_zone_view
Great! Thank you! The sliders work.
No problem, glad its working okay
Upper limit of the slider for setting schedule temperature should be the maximum temperature of the zone (DB zone_sensors > max_c)