diff -r 49580ca85ab7 -r 92b546d4a839 www-thermferm/global.php --- a/www-thermferm/global.php Sat Jul 14 17:21:25 2018 +0200 +++ b/www-thermferm/global.php Sat Jul 14 21:15:20 2018 +0200 @@ -1,6 +1,6 @@ * @@ -52,7 +52,11 @@ if (isset($_POST['LCDcols'])) $cmd[] = "LCD_COLS,".$_POST['LCDcols']; if (isset($_POST['LCDrows'])) - $cmd[] = "LCD_ROWS,".$_POST['LCDrows']; + $cmd[] = "LCD_ROWS,".$_POST['LCDrows']; + $cmd[] = "MQTT_HOST,".$_POST['MQTThost']; + $cmd[] = "MQTT_POST,".$_POST['MQTTport']; + $cmd[] = "MQTT_USER,".$_POST['MQTTuser']; + $cmd[] = "MQTT_PASS,".$_POST['MQTTpass']; $cmd[] = "."; send_array($cmd); } @@ -64,6 +68,10 @@ unset($_POST['TempHumIdx']); unset($_POST['LCDcols']); unset($_POST['LCDrows']); + unset($_POST['MQTThost']); + unset($_POST['MQTTport']); + unset($_POST['MQTTuser']); + unset($_POST['MQTTpass']); unset($_POST['key']); load('maintenance.php'); } @@ -74,7 +82,9 @@ if (isset($_POST['Name']) && isset($_POST['Port']) && isset($_POST['TempAddress']) && isset($_POST['HumAddress']) && - isset($_POST['TempHumIdx']) && isset($_POST['key'])) { + isset($_POST['TempHumIdx']) && isset($_POST['key']) && + isset($_POST['MQTThost']) && isset($_POST['MQTTport']) && + isset($_POST['MQTTuser']) && isset($_POST['MQTTpass'])) { if ($_POST['key'] == 'Cancel') return 99; @@ -207,7 +217,7 @@ } if ($f[0] == "TEMP_HUM_IDX") { $outstr .= ' '.PHP_EOL; - $outstr .= ' Temp/Humidity domoticz index'.PHP_EOL; + $outstr .= ' Domoticz TH index'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; } @@ -223,6 +233,36 @@ $outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; } + if ($f[0] == "MQTT_HOST") { + $outstr .= ' '.PHP_EOL; + $outstr .= ' MQTT host'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + } + if ($f[0] == "MQTT_PORT") { + $outstr .= ' '.PHP_EOL; + $outstr .= ' MQTT port'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + } + if ($f[0] == "MQTT_USER") { + $outstr .= ' '.PHP_EOL; + $outstr .= ' MQTT username'.PHP_EOL; + if (strcmp($f[1], "(null)") == 0) { + $f[1] = ""; + } + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + } + if ($f[0] == "MQTT_PASS") { + $outstr .= ' '.PHP_EOL; + $outstr .= ' MQTT password'.PHP_EOL; + if (strcmp($f[1], "(null)") == 0) { + $f[1] = ""; + } + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + } $i++; } }