pihome-shc / pihome

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

Charts not resetting - showing more than 24 hours #384

Closed scottagecheeseandcrackers closed 3 years ago

scottagecheeseandcrackers commented 3 years ago

20200830_093611

Since the update to v1.76 it seems the charts x-axis is showing multiple days. Maybe this is just a scaling issue?

Also I have noticed that the boost icon is no longer showing on the home page. SmartSelect_20200830-094320_Chrome This screenshot is taken with a boost running on zone Ch. Hot Water.

pihome-shc commented 3 years ago

@scottagecheeseandcrackers zone graphs are missing due to missing values for that time, can you check zone_graph table. for boost icon, can you check zone_current_state table, you can remove all records from zone_current_state and they will get created in next boiler.php run.

scottagecheeseandcrackers commented 3 years ago

@pihome-shc - you are correct, zone graphs data missing for those times/days. The issue seems to be that the graph starts from over 3 days ago and each day it zooms out further and further. It looks like the zone data starts from the last dB cleanup, but the graph is still showing multiple days before the last cleanup. Zone graph data also missing for a number of zones, even though the temperature are shown in the home gui.

On the zone_current_state query, I deleted those records and ran a boost to test...no change. Boiler icon changes but no boost icon for any zones. Zone_current_state table looks likes its missing data for me.

SmartSelect_20200830-133439_Chrome

pihome-shc commented 3 years ago

Can you exports database and attach here.

scottagecheeseandcrackers commented 3 years ago

Link to download database file - https://we.tl/t-zacF8H8avu

twa127 commented 3 years ago

easier for me if you mysqldump eg

mysqldump -u root -ppassw0rd pihome > dump.sql

scottagecheeseandcrackers commented 3 years ago

@twa127 - once again thank you for all the help (also @pihome-shc )

dump.zip

twa127 commented 3 years ago

first thing is I can't open any views

scott1

twa127 commented 3 years ago

re-created the views and that fixed the problem, next thing - you have multiple sensors connected to zones 33, 34 and 35, I guess that is not what you intended scott2

twa127 commented 3 years ago

explains why you have 2 Ch Hot Water graph zones

scottagecheeseandcrackers commented 3 years ago

@twa127 - I use HeidiSQL typically - for some strange reason it refuses to let me log-in as 'phpmyadmin' using the default password. Yet if I open 192.168.0.129/phpmyadmin - the same login detail work fine. Deleted those extra rows in zone_sensors...no change that I can see yet.

scottagecheeseandcrackers commented 3 years ago

@twa127 - after a bit of sensor cleanup in the zone_sensors table - and a good cache clearing - seems to be looking better

image

Hopefully the missing sensors will populate in the graph now that the correct sensors have been assigned to the right zones.

Any idea why the boost symbol wouldn't be loading.

twa127 commented 3 years ago

not yet :-) please post a copy of your cleaned-up database

scottagecheeseandcrackers commented 3 years ago

pihome.zip

Hope this sheds a little a light...

twa127 commented 3 years ago

one thing about the boost icon is that it now does not appear immediately but after boiler.php has executed

twa127 commented 3 years ago

can you do a mysqldump please

scottagecheeseandcrackers commented 3 years ago

dump.zip

twa127 commented 3 years ago

You have multiple entries in the boost table for the same zone_id

scottagecheeseandcrackers commented 3 years ago

Yes - I have different boost option set (ie. Ch. Hot Water boost for 30 mins or Ch. Hot Water boost for 60 mins)

twa127 commented 3 years ago

Problem is in the nodes table id 26 status is NULL, should be Active, after changing this the zone_current_state table updates okay and boost indicator is shown

scottagecheeseandcrackers commented 3 years ago

@twa127 - Bingo that fix did the trick - Boost icon now showing - last one to fix is the charts.

twa127 commented 3 years ago

where are we now with the charts ?

scottagecheeseandcrackers commented 3 years ago

Last cache clear reset the graphs, but they seem to be still showing more than 24hours. (Note the colour change is from when I swapped around the zone_sensors last night.) Few sensors remain missing despite data in 'messages_in'. No sign of graphs in battery.

SmartSelect_20200831-193135_Chrome SmartSelect_20200831-193158_Chrome

twa127 commented 3 years ago

Battery graph problem is due to an error in the nodes table, the type value should be MySensor not MySensors

twa127 commented 3 years ago

The data for the zone graphs comes from the zone_graphs table

twa127 commented 3 years ago

Your zone_sensors table does not look correct, you have duplicate entries and sensors allocated to more than 1 zone eg id 34 and 39 are duplicates, id 42 allocates the same sensor (24-0) to a second zone

scottagecheeseandcrackers commented 3 years ago

I have set up a ground floor zone (Id 33) - which uses the same sensor as the living room (id 39). (The original hope was that if I hit boost on this zone it would act as the overall controller - in practice though I must have all zones active for boiler to kick - same for first floor (id 34) and zone id 40) in either case zone id 33 and 34 are set not to appear in the graphs via the gui.

twa127 commented 3 years ago

okay, have we fixed the battery graph ?

twa127 commented 3 years ago

gateway.py should update the zone_graphs table which is used by chart_load.php to load the active zone graphs

scottagecheeseandcrackers commented 3 years ago

okay, have we fixed the battery graph ?

Yep battery graph fixed with the MySensors typo.

scottagecheeseandcrackers commented 3 years ago

gateway.py should update the zone_graphs table which is used by chart_load.php to load the active zone graphs

Should I manually run 'gateway.py' to see if this fixes it?

pihome-shc commented 3 years ago

@scottagecheeseandcrackers gateway.py runs in background anyway.

twa127 commented 3 years ago

If I ran a query against the zone_graphs table you can see no entries for Master Bedroom and only old entries for Kitchen, these are the missing graphs over the last 24 hours. For some reason gateway.py is not updating the zone_graphs table for these 2 zones scott3

twa127 commented 3 years ago

Are you sure sensor ID 23 and 24 are set correctly in the zone_sensors table

  1. Sensor 23 allocated to Master Bedroom and Living Room
  2. Sensor 24 allocated to Ground Floor twice and Kitchen

Also The Hot Water zone (35) has 2 sensors allocated

twa127 commented 3 years ago

Can you please let me know which nodes you have allocated to each zone

twa127 commented 3 years ago

I went back to the database you posted pihome_2020-08-25_06-23-58.sql and the zone_sensors table looks much more sensible in this one scott4

twa127 commented 3 years ago

I think your problem with the graphs displaying more than the last 24 hours is because gateway.py is failing to process the zone_graphs table where it deletes anything older than 24 hours, this is probably due to the errors in the zone_sensors table data.

scottagecheeseandcrackers commented 3 years ago

Apologies for the delayed response. @twa127 - you were correct - more than 1 zone with the same sensor was causing the havoc. As soon as I deleted Zone_id 33 and 34, cleared previous graph data and cleared my cache everything looks right.

Dump file attached below - hopefully this is all the issues sorted. Thanks again for the assistance.

GUI

Chart

dump (2).zip

twa127 commented 3 years ago

no problem, glad its sorted