Thu, 10 Jan 2019 20:22:06 +0100
Added configuration settings for MQTT in config.php. Finished screen box sizes for the fermenters monitor. Select beername and code from the current brew products and send it to the fermenter. Added switch commands to the fermenter. Delay data get from the fermenter after sending any command so there is time to process the commands. Turn switches off when the mode changes. Removed 0.2 degrees setpoint diffs for low and high, the fermenter must deal with it. Prevent turning the heater and cooler together on.
57
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | require_once('config.php'); |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | |
65
5d5c67818d11
Fermentable editor checks. Fermentables dropdown list shows a frienlier list
Michiel Broek <mbroek@mbse.eu>
parents:
57
diff
changeset
|
4 | $query = "SELECT * FROM inventory_fermentables ORDER BY supplier,name"; |
57
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | $connect = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | if (! $connect) { |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | echo "[]"; |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | return; |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | } |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | $result = mysqli_query($connect, $query); |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | $fermentables[] = array( |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | 'record' => $row['record'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | 'name' => $row['name'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | 'type' => $row['type'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | 'yield' => $row['yield'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | 'color' => $row['color'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | 'add_after_boil' => $row['add_after_boil'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | 'origin' => $row['origin'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | 'supplier' => $row['supplier'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | 'coarse_fine_diff' => $row['coarse_fine_diff'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | 'moisture' => $row['moisture'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | 'diastatic_power' => $row['diastatic_power'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | 'protein' => $row['protein'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | 'max_in_batch' => $row['max_in_batch'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | 'recommend_mash' => $row['recommend_mash'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | 'graintype' => $row['graintype'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | 'di_ph' => $row['di_ph'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | 'inventory' => $row['inventory'], |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | 'cost' => $row['cost'] |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | ); |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | } |
bb9a06aa9acd
Completed framework inline fermentables editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | echo json_encode($fermentables); |