Open twa127 opened 3 years ago
as of now we have zone enable checkbox and zone gets created same way i.e even if zone is only for monitoring it still have controller attached to it, instead of creating another table may be creating zone process need re-thinking
Hi,
Yes that is exactly how I use the system at the moment with the zone enable checkbox. My thinking is that these monitoring points are not really zones at all and perhaps should not be cluttering up the zone table and as you say they need to have a controller and other data allocated needlessly. This was why I was suggesting separating the temperature measuring points out to a separate table
I've progressed this a bit further -
This is what it looks like on my test system (no gateway setup, so temperature sensors shown as timed-out)
Moved on again, now added a GUI for the Temperature Sensors, it can be found in the Node and Zone Configuration settings menu. I've moved the original Sensors option to the Status menu as I thought it filled a bit better here. The GUI works a bit like the Zones option.
Although it needed a new table, the overall data storage is reduced by not saving unnecessary zone info, also easy to swap active zones controlling sensor, selection is by temperature sensor name, rather than node_id, so easier to see choose the right sensor :-)
I'll move on to the graphs next.
All comments most welcome temperature_sensors.zip
@twa127 i will give it try later and come back to you. first impression looks nice.
A little tweak to allow being able to choose whether a temperature sensor is displayed on the home screen
@twa127 do i have to run migrate_sensor.php as well?
yes because I've added a new field to the temperature_sensors table, you need to go back to the database you had before running migrate_sensors.php and the re-run migrate_sensors.php
ok i did test and migration worked ok, but i deleted all deactivated zone and try to add again and i get following error.
three suggestions:
have error in boiler.php
2020-09-18 18:18:04 - Zone: Sensor Reading 23.50
2020-09-18 18:18:04 - Zone: Weather Factor 0.5
2020-09-18 18:18:04 - Zone: DeadBand 0.5
2020-09-18 18:18:04 - Zone: Cut In Temperature 0
2020-09-18 18:18:04 - Zone: Cut Out Temperature 0
2020-09-18 18:18:04 - Zone: Mode 0
2020-09-18 18:18:04 - Zone ID: 35
2020-09-18 18:18:04 - Zone: Hot Water Controller: 0 Controller Child: 33 Zone Status: 0
2020-09-18 18:18:04 - Zone: Hot Water Stop Cause: No Schedule - Target C:0 Zone C:23.50
----------------------------------------------------------------------------------------
PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /var/www/cron/boiler.php on line 273
2020-09-18 18:18:04 - Zone ID: 58
2020-09-18 18:18:04 - Zone: Office Controller: 0 Controller Child: 3 Zone Status: 0
2020-09-18 18:18:04 - Zone: Office Stop Cause: No Schedule
----------------------------------------------------------------------------------------
PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /var/www/cron/boiler.php on line 273
2020-09-18 18:18:04 - Zone ID: 59
2020-09-18 18:18:04 - Zone: Hall Controller: 0 Controller Child: 3 Zone Status: 0
2020-09-18 18:18:04 - Zone: Hall Stop Cause: No Schedule
Okay fixed the error in sensors.php.
Sorry not too sure about points 1-3, I see that sensors menu as for displaying status, so would probably remove the delete button altogether and use the sensors configuration GUI to delete, this also shows the unallocated sensors.
I'll look at boiler.php, can you post the database please sensor.zip
ah light bulb moment 1-3 rather than an empty cell show a disabled delete icon, same for the Show tickbox :-) Not too sure if I can make enough table space to show the last seen time
Few more suggestions Moving edit and delete in one column can same space. Change Node child id to child id. For last seen: how about second line under sensors name? May be bit small text.
@twa127 looks good, question where sensors name comes from? i.e in your image you have New Zone and Zone name not allocated.
Hi
The Sensor Name comes from the temperature_sensors table and can be set to whatever you want to identify the location of the sensor. If the sensor is being used by a zone, then the Zone Name comes from the zone table, if not being used by a zone, then the Zone Name will be 'Not Allocated'.
Attached latest version with code for the graphs. If a sensor is unallocated it will be displayed by sensor name, if allocated to a zone it will be displayed by zone name.
@pihome-shc do you still have a problem with boiler.php ?
on gui all looks ok here is output for boiler.php
2020-09-20 11:27:59 - Boiler Script Started
2020-09-20 11:27:59 - Day of the Week: 0
----------------------------------------------------------------------------------------
2020-09-20 11:27:59 - Hysteresis time: 2020-09-20 11:30:33
2020-09-20 11:27:59 - Zone: Sensor Reading 18.60
2020-09-20 11:27:59 - Zone: Weather Factor 0.5
2020-09-20 11:27:59 - Zone: DeadBand 0.5
2020-09-20 11:27:59 - Zone: Cut In Temperature 0
2020-09-20 11:27:59 - Zone: Cut Out Temperature 0
2020-09-20 11:27:59 - Zone: Mode 100
2020-09-20 11:27:59 - Zone ID: 33
2020-09-20 11:27:59 - Zone: Ground Floor Controller: 0 Controller Child: 29 Zone Status: 0
2020-09-20 11:27:59 - Zone: Ground Floor Stop Cause: Hysteresis active - Target C:0 Zone C:18.60
----------------------------------------------------------------------------------------
2020-09-20 11:27:59 - Hysteresis time: 2020-09-20 11:30:33
2020-09-20 11:27:59 - Zone: Sensor Reading 20.00
2020-09-20 11:27:59 - Zone: Weather Factor 0.5
2020-09-20 11:27:59 - Zone: DeadBand 0.5
2020-09-20 11:27:59 - Zone: Cut In Temperature 0
2020-09-20 11:27:59 - Zone: Cut Out Temperature 0
2020-09-20 11:27:59 - Zone: Mode 100
2020-09-20 11:27:59 - Zone ID: 34
2020-09-20 11:27:59 - Zone: First Floor Controller: 0 Controller Child: 31 Zone Status: 0
2020-09-20 11:27:59 - Zone: First Floor Stop Cause: Hysteresis active - Target C:0 Zone C:20.00
----------------------------------------------------------------------------------------
2020-09-20 11:27:59 - Hysteresis time: 2020-09-20 11:30:33
2020-09-20 11:27:59 - Zone: Sensor Reading 31.50
2020-09-20 11:27:59 - Zone: Weather Factor 0.5
2020-09-20 11:27:59 - Zone: DeadBand 0.5
2020-09-20 11:27:59 - Zone: Cut In Temperature 0
2020-09-20 11:27:59 - Zone: Cut Out Temperature 0
2020-09-20 11:27:59 - Zone: Mode 100
2020-09-20 11:27:59 - Zone ID: 35
2020-09-20 11:27:59 - Zone: Hot Water Controller: 0 Controller Child: 33 Zone Status: 0
2020-09-20 11:27:59 - Zone: Hot Water Stop Cause: Hysteresis active - Target C:0 Zone C:31.50
----------------------------------------------------------------------------------------
PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /var/www/cron/boiler.php on line 274
2020-09-20 11:27:59 - Zone ID: 58
2020-09-20 11:27:59 - Zone: Office Controller: 0 Controller Child: 3 Zone Status: 0
2020-09-20 11:27:59 - Zone: Office Stop Cause: No Schedule
----------------------------------------------------------------------------------------
PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /var/www/cron/boiler.php on line 274
2020-09-20 11:27:59 - Zone ID: 59
2020-09-20 11:27:59 - Zone: Hall Controller: 0 Controller Child: 3 Zone Status: 0
2020-09-20 11:27:59 - Zone: Hall Stop Cause: No Schedule
----------------------------------------------------------------------------------------
2020-09-20 11:27:59 - Zone: GIOP Relay Status: 1 (0=On, 1=Off)
2020-09-20 11:27:59 - Zone: GIOP Relay Status: 1 (0=On, 1=Off)
2020-09-20 11:28:00 - Zone: GIOP Relay Status: 1 (0=On, 1=Off)
2020-09-20 11:28:00 - Zone: GIOP Relay Status: 1 (0=On, 1=Off)
2020-09-20 11:28:00 - Zone: GIOP Relay Status: 1 (0=On, 1=Off)
2020-09-20 11:28:01 - Boiler Switched Off At: 2020-09-20 11:27:33
2020-09-20 11:28:01 - Boiler GIOP: 35 Status: 1 (0=On, 1=Off)
2020-09-20 11:28:01 - Boiler Fired Status: 0
2020-09-20 11:28:01 - Boiler Hysteresis Status: 1
----------------------------------------------------------------------------------------
2020-09-20 11:28:01 - Boiler Script Ended
****************************************************************************************
Can you let me have a dump of your database please, so I can reproduce the error
this is my current db without any changes
This should fix it :-) boiler.zip
boiler.php error is fixed now, i have two wired sensors connected to my rpi and they are working ok, and records are in nodes table but i can not see them under setting->sensors
job for tomorrow :-))
here is the database after some cleanup work. also graph wasnt working after your changes.
Hi,
I can see your wired sensors okay
This is odd, did you update my last Database? Reason: i have removed disabled zone and left the sensors and I wasn’t able to see them
The problem with your latest database is that the migration process uses the zone table as the basis for building the initial migrated temperature_sensors table, using the status field to determine if the senor is allocated. I did it this way as I could not use the nodes table to identify sensors by child id, as a single node table entry may equate to multiple sensors. This is also why the temperature_sensors table cannot be automatically update when a new node is added.
In the case of your cleaned-up database, simply use the Add Temperature Sensor GUI to add the 2 GPIO sensors.
Your database did show up an error in homelist.php, which I've fixed in the attached. homelist.zip
I see the basic setting up the system workflow as -
Did you update gateway.py, needed for graphs ?
Fixed a bug in migrate_sensors.php which stopped column sensor_id in table zone_sensors from being dropped
Fixed the GPIO Sensor Graphs, but graphs still a work in progress
Update for charts charts.zip
reason i send database after cleanup was so we have way to see sensors under setting. i.e what if i connect new gpio sensors or power on new mysensors temperature sensor?
i copied all files from your zip file, but i didnt kill gateway.py process to get new version running. homelist.php only related to my setup? i haven't made any changes to homelist.php
i m updating with your recent zip files and report back to you.
Hi,
If you add nodes which automatically create new nodes table entries, then at present you need to manually add new sensors. I guess it is possible to add temperature_sensors table entries at the same time in gateway.py and gpio_ds18b20.py
new homelist.php is a bug fix which I found using your latest database which had no add-ons
add sensor -> sensor.php is missing.
attached latest copies of everything update.zip
ah see what you mean, I'll re-fix model :-)
i added sensors now, and i see both entries in temperature_sensors without zone, this will create problem with piconnect
what's the issue with piconnect, the NULL zone_id ?
yes, PiConnect wouldn't work with Null values,
okay how about using zone_id = 0 to indicate an un_allocated zone ?
but there is nothing on other end of zone_id=0
yes if the temperature sensor is un-allocated then it can't have a valid zone_id, is that going to screw piconnect ?
Attached changed files for a zone_id = 0 version, does this resolve the piconnect problem ? Zone0.zip
Hi
Question about Zone Delete, from what I can see, the process is -
What's the reason for simply not deleting the relevant records at the db.php stage ?
Reason to keep deleting of records in PiConnect is to offer remote management of PiHome once PiConnect becomes available for general public. Hence sync set to 0 for sync data with PiConnect.
I understand, but can cause a potential problem, for example zone_log records purge set to 1, then boiler.php adds another record before piconnect,php runs and the zone deletion fails do FK constraint
That is why it is important to have correct delete sequence in piconnect.php which is correct at the moment.
That's not the issue, if -
db.php sets Purge = 1, then piconnect.php runs before boiler.php - OK db.php sets Purge = 1, then boiler.php runs before piconnect.php and boiler.php does not INSERT new zone log record - OK db.php sets Purge = 1, then boiler.php runs before piconnect.php and boiler.php does INSERT new zone log record - FK constraint error
If piconnect.php always runs before boiler.php then no problem, but I don't know how crontab orders multiple jobs that run at the same time interval
It would appear
So we have boiler.php starting before piconnect.php, without piconnect.php waiting for boiler.php to finish
Leading on from @scottagecheeseandcrackers comment about having zones simply measuring temperature, what do you all think about being able to display temperature sensors without having to setup a 'dummy' zone. This could be achieved by -
The home screen would look like this![sensor1](https://user-images.githubusercontent.com/46624596/93017263-31209900-f5bf-11ea-94b6-32baf75bb82a.JPG)