pihome-shc / pihome

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

Pihome 1.77 not scheduling #421

Closed pihome-shc closed 3 years ago

pihome-shc commented 3 years ago

received this issue via email, i had same issue with my dev system

Hi,

I've got a one zone system, temp sensor and boiler relay. I've set up 3 schedules covering 06:00-10:00, 10:05 - 16:00 and 16:05 - 22:30. The only time the boiler comes on is between 22:00 and 22:30. I've removed and added the schedules a couple of times. Any ideas what to try next? Boosting works. I'm running the latest version on a pi4.

Cheers,

Brian

twa127 commented 3 years ago

Hi,

Can you please post a copy of your database and I'll have a look

sandreialexandru commented 3 years ago

I can confirm this issue. After updating with the latest commits schedule is not working. Deleting zones and then adding them fixes the issue

twa127 commented 3 years ago

Hi,

Did you run MySQL_View.sql to update the views after #414 ?

sandreialexandru commented 3 years ago

Yes, I did. I have imported the file using phpmyadmin.

twa127 commented 3 years ago

Okay thanks for the info, I'll dig a bit more

twa127 commented 3 years ago

Any idea at what point it broke, also is your gateway running okay ?

twa127 commented 3 years ago

I've just rebuilt my test system from the 1.77 image and that appears to be working okay

sandreialexandru commented 3 years ago

After deleting a zone and then adding it again the schedule works untill first finishes. The next schedule does not work. The gateway is working fine as the temperatures get updated (tested by taking the sensor outside). Also the deleted schedules and zones do not get cleaned from the database. I am now reverting again to the image provided on pihome.eu .

twa127 commented 3 years ago

Can you please post me a copy of your database with the faulty schedule

sandreialexandru commented 3 years ago

Should I run migrate_controller.php and migrate_db.php after reverting?

sandreialexandru commented 3 years ago

I have just flashed my faulty instance with the 1.77 image. I did not save the database. Sorry!

twa127 commented 3 years ago

:-)

twa127 commented 3 years ago

No need to run migrate_controller.php and migrate_db.php, in fact running them would cause a problem

sandreialexandru commented 3 years ago
  1. Flashed 1.77
  2. Import MySQL_View.sql
  3. Run update_db.php

It is ok for now. Looking forward to version 2. My thought on 1.77 is that it is an unstable release. Thank you @twa127 for your help.

twa127 commented 3 years ago

If someone can post a copy of a database with this fault, it would be really useful

pihome-shc commented 3 years ago

here is my dev version database.

pihome_177.zip

twa127 commented 3 years ago

Hi,

I was able to reproduce the problem using this copy of the database.

The reason appears to be inconstances in the tables schedule_daily_time and schedule_daily_time_zone which result in the scheduling query in boiler.php returning more than 1 record and as the query LIMIT is set to 1, it will return the first record it finds and if tz_status for this record is set to 0, then the schedule will not run.

I suggest that you delete all records from both table schedule_daily_time_zone and schedule_daily_time (in that order) and then re-create your schedules, hopefully this will fix the problem.

Please let me know if this resolves the issue.

brianlangdon commented 3 years ago

Hi,

I raised this issue via email initially. Unfortunately, I didn't save my database before deleting the extra rows from the the two schedule tables you have mentioned @twa127. This did fix the issue. I had started from a fresh install of 1.77, nothing was restored.

twa127 commented 3 years ago

@brianlangdon thanks for the info, glad to hear it's fixed, I think the problem arose due to the database changes for the #381 and #387