[ 'verify_peer' => false, 'verify_peer_name' => false, ], ]); } } $response = @file_get_contents($endpointUrl, false, $context ?: null); if ($response === false && strcasecmp($scheme, 'https') === 0) { $fallbackUrl = preg_replace('#^https#i', 'http', $endpointUrl); $response = @file_get_contents($fallbackUrl); if ($response !== false) { $endpointUrl = $fallbackUrl; } } if ($response === false) { throw new RuntimeException('Unable to reach shared endpoint: ' . $endpointUrl); } try { $payload = json_decode($response, true, flags: JSON_THROW_ON_ERROR); } catch (JsonException $exception) { throw new RuntimeException('Malformed JSON from shared endpoint', 0, $exception); } if (($payload['status'] ?? null) !== 'ok') { $message = $payload['message'] ?? 'unknown error'; throw new RuntimeException('Shared endpoint returned an error: ' . $message); } if (!isset($payload['items']) || !is_array($payload['items'])) { $snippet = substr(strip_tags($response), 0, 200); throw new RuntimeException('Shared endpoint response missing items. Snippet: ' . $snippet); } foreach ($payload['items'] as $item) { $tagKey = str_pad((string) $item['tagId'], 5, '0', STR_PAD_LEFT); $value[$item['name']] = $item['value']; $rounded[$item['name']] = $item['rounded1']; $rounded1[$item['name']] = $item['rounded2']; $roundedid[$tagKey] = $item['rounded2']; $ID[$tagKey] = $item['value']; } $endpointDataLoaded = true; } catch (Throwable $exception) { $endpointErrorMessage = $exception->getMessage(); error_log('Milling shared endpoint failed: ' . $endpointErrorMessage); } $dataSourceLabel = 'Shared endpoint'; if (!$endpointDataLoaded) { require __DIR__ . '/../items.php'; require __DIR__ . '/../items2dec.php'; $dataSourceLabel = 'Legacy items.php data'; } $formatValue = static function (string $key) use (&$value): string { return number_format((float)($value[$key] ?? 0), 0, '.', ''); }; $formatNumber = static function ($number): string { return number_format((float)$number, 0, '.', ''); }; $roundNumber = static function ($number): string { return (string) round((float)$number); }; $unixtime=time(); $unix5am=mktime(10, 00, 00); if ($unixtime<=$unix5am) { $unixtime += 86400; } $since5am=($unixtime-$unix5am)/3600; $avgtonstoday=round($value['W TONS GROUND']/$since5am*24, 0); ob_start(); ?> ' . $formatValue('WEIGHT_WSP') . ''; } if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) { echo ''; } ?> Tons/Hr"; } if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) { echo ""; } ?> '; } if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) { echo ''; } ?> Tons/Hr"; } if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) { echo ""; } ?> Auto"; } if ($value['MILL1AUTOMAN1'] == 0) { echo ""; } ?>
Steam
Data source:
Endpoint error:
Exhaust Pressure: PSI
Live Steam Pressure: PSI
Tank Levels
Juice Tank 1 Level:
Juice Tank 2 Level:
Total Syrup:
YTD Grinding Info
Total Tons Ground
East Mills Tons Ground
West Mills Tons Ground
Daily Grinding Totals
Record Of Tons On
Total Of Tons Ground Yesterday
Total Of Tons Ground
Total Of Tons Projected
Total Rate Of Tons/HR
East West
Tons Per Hour: Tons/Hr
Avg Tons Per Hour: Tons/15
Tons Ground: Tons
AVG TCD: Tons
Run Hours Today: Hours
Loss Time Today: Hours
Previous Day TCD: Tons
Previous Day Run Hours: Hours
Previous Day PPH/Ton: PPH/Ton
Previous Day IMB 5: Tons
Previous Day IMB 6: Tons
Imibition 5 Flow: GPM
Imibition 5 Total: GPM
Imibition 6 Flow: GPM
Imibition 6 Total: GPM
Imibition 5 SP: GPM
Imibition 6 SP: GPM
Main Carrier
East West
MCC FPM: FPM
MCC Output: %
MCC Tons: Tons
Mill 1
Chute Level: %
Turbin Speed: RPM
Turbin Output: %
Set Point East: ' . $formatValue('MILL1WSP') . '%
Set Point West: %
Manual
Mill 2
East West
Chute Level: %
Turbin Speed: RPM
Mill 3
Chute Level: %
Turbin Speed: RPM
Mill 4
Chute Level: %
Turbin Speed: RPM
Mill 5
Chute Level: %
Turbin Speed: RPM
Mill 6
Chute Level: %
Turbin Speed: RPM

Control"; } if ($value['KC3'] == 0) { echo ""; } ?>
Shredder
Turbin Speed: RPM
Knife
Control"; } if ($value['KC1'] == 0) { echo ""; } ?>
Knife 1
Turbin Speed: RPM
Output: %
Knife
Control"; } if ($value['KC2'] == 0) { echo ""; } ?>
Knife 2
Turbin Speed: RPM
Output: %
Knife
Control"; } if ($value['KC3'] == 0) { echo ""; } ?>
Knife 3
Turbin Speed: RPM
Output: %
Knife