# HG changeset patch # User Michiel Broek # Date 1714048007 -7200 # Node ID 13555c27b5929019547b20fadf268998b7999c9e # Parent b435bf0bf24a39db83456936a745aa79d0fd1801 Version 0.9.19a6. Fixes after a short trial on the production controller. Fixed json for alternate beer termperature sensor. Fixed division by 1000 for the room temperature and humidity values. The dropdown list for devices shows the address instead of description in the list. diff -r b435bf0bf24a -r 13555c27b592 configure --- a/configure Wed Apr 24 21:58:27 2024 +0200 +++ b/configure Thu Apr 25 14:26:47 2024 +0200 @@ -2037,7 +2037,7 @@ PACKAGE="mbsePi-apps" -VERSION="0.9.19a5" +VERSION="0.9.19a6" COPYRIGHT="Copyright (C) 2014-2024 Michiel Broek, All Rights Reserved" CYEARS="2014-2024" diff -r b435bf0bf24a -r 13555c27b592 configure.ac --- a/configure.ac Wed Apr 24 21:58:27 2024 +0200 +++ b/configure.ac Thu Apr 25 14:26:47 2024 +0200 @@ -8,7 +8,7 @@ dnl General settings dnl After changeing the version number, run autoconf! PACKAGE="mbsePi-apps" -VERSION="0.9.19a5" +VERSION="0.9.19a6" COPYRIGHT="Copyright (C) 2014-2024 Michiel Broek, All Rights Reserved" CYEARS="2014-2024" AC_SUBST(PACKAGE) diff -r b435bf0bf24a -r 13555c27b592 thermferm/mqtt.c --- a/thermferm/mqtt.c Wed Apr 24 21:58:27 2024 +0200 +++ b/thermferm/mqtt.c Thu Apr 25 14:26:47 2024 +0200 @@ -951,6 +951,10 @@ if (unit->beer_address) { payload = xstrcat(payload, (char *)",\"beer\":{\"address\":\""); payload = xstrcat(payload, unit->beer_address); + if (unit->beer_address2) { + payload = xstrcat(payload, (char *)"\",\"address2\":\""); + payload = xstrcat(payload, unit->beer_address2); + } payload = xstrcat(payload, (char *)"\",\"state\":\""); payload = xstrcat(payload, (char *)DEVPRESENT[unit->beer_state]); payload = xstrcat(payload, (char *)"\",\"temperature\":"); @@ -1519,7 +1523,7 @@ payload = xstrcat(payload, (char *)"\",\"state\":\""); payload = xstrcat(payload, (char *)DEVPRESENT[Config.temp_state]); payload = xstrcat(payload, (char *)"\",\"value\":"); - sprintf(buf, "%d", Config.temp_value); + sprintf(buf, "%.1f", Config.temp_value / 1000.0); payload = xstrcat(payload, buf); payload = xstrcat(payload, (char *)"}"); } @@ -1531,7 +1535,7 @@ payload = xstrcat(payload, (char *)"\",\"state\":\""); payload = xstrcat(payload, (char *)DEVPRESENT[Config.hum_state]); payload = xstrcat(payload, (char *)"\",\"value\":"); - sprintf(buf, "%d", Config.hum_value); + sprintf(buf, "%.1f", Config.hum_value / 1000.0); payload = xstrcat(payload, buf); payload = xstrcat(payload, (char *)"}"); } @@ -1653,14 +1657,14 @@ payload = xstrcat(payload, (char *)"\"THB\":{"); if (Config.temp_uuid) { payload = xstrcat(payload, (char *)"\"temperature\":"); - sprintf(buf, "%d", Config.temp_value); + sprintf(buf, "%.1f", Config.temp_value / 1000.0); payload = xstrcat(payload, buf); } if (Config.temp_uuid && Config.hum_uuid) payload = xstrcat(payload, (char *)","); if (Config.hum_uuid) { payload = xstrcat(payload, (char *)"\"humidity\":"); - sprintf(buf, "%d", Config.hum_value); + sprintf(buf, "%.1f", Config.hum_value / 1000.0); payload = xstrcat(payload, buf); } payload = xstrcat(payload, (char *)"}"); diff -r b435bf0bf24a -r 13555c27b592 thermferm/rdconfig.c --- a/thermferm/rdconfig.c Wed Apr 24 21:58:27 2024 +0200 +++ b/thermferm/rdconfig.c Thu Apr 25 14:26:47 2024 +0200 @@ -636,12 +636,11 @@ unit->air_temperature = ival; xmlFree(key); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS"))) { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS2"))) { + unit->beer_address2 = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + } else if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS"))) { unit->beer_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS2"))) { - unit->beer_address2 = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - } if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_STATE"))) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (sscanf((const char *)key, "%d", &ival) == 1) diff -r b435bf0bf24a -r 13555c27b592 thermferm/server.c --- a/thermferm/server.c Wed Apr 24 21:58:27 2024 +0200 +++ b/thermferm/server.c Thu Apr 25 14:26:47 2024 +0200 @@ -740,7 +740,7 @@ srv_send(s, (char *)"TEMP_VALUE,%.1f", Config.temp_value / 1000.0); srv_send(s, (char *)"HUM_UUID,%s", Config.hum_uuid); srv_send(s, (char *)"HUM_STATE,%s", DEVPRESENT[Config.hum_state]); - srv_send(s, (char *)"HUM_VALUE,%.0f", Config.hum_value / 1000.0); + srv_send(s, (char *)"HUM_VALUE,%.1f", Config.hum_value / 1000.0); srv_send(s, (char *)"TEMP_HUM_IDX,%d", Config.temp_hum_idx); srv_send(s, (char *)"LCD_COLS,%d", Config.lcd_cols); srv_send(s, (char *)"LCD_ROWS,%d", Config.lcd_rows); diff -r b435bf0bf24a -r 13555c27b592 www/drop_contacts.php --- a/www/drop_contacts.php Wed Apr 24 21:58:27 2024 +0200 +++ b/www/drop_contacts.php Thu Apr 25 14:26:47 2024 +0200 @@ -65,7 +65,7 @@ if ($item['direction'] == "IN_BIN") { $sensors[] = array( 'uuid' => $item['uuid'], - 'name' => $item['description']." ".$item['comment'] + 'name' => $item['address']." ".$item['comment'] ); } } diff -r b435bf0bf24a -r 13555c27b592 www/drop_switches.php --- a/www/drop_switches.php Wed Apr 24 21:58:27 2024 +0200 +++ b/www/drop_switches.php Thu Apr 25 14:26:47 2024 +0200 @@ -65,7 +65,7 @@ if ($item['direction'] == "OUT_BIN") { $sensors[] = array( 'uuid' => $item['uuid'], - 'name' => $item['description']." ".$item['comment'] + 'name' => $item['address']." ".$item['comment'] ); } } diff -r b435bf0bf24a -r 13555c27b592 www/drop_tempsensors.php --- a/www/drop_tempsensors.php Wed Apr 24 21:58:27 2024 +0200 +++ b/www/drop_tempsensors.php Thu Apr 25 14:26:47 2024 +0200 @@ -65,7 +65,7 @@ if ($item['direction'] == "IN_ANALOG") { $sensors[] = array( 'uuid' => $item['uuid'], - 'name' => $item['description']." ".$item['comment'] + 'name' => $item['address']." ".$item['comment'] ); } } diff -r b435bf0bf24a -r 13555c27b592 www/js/fermenter.js --- a/www/js/fermenter.js Wed Apr 24 21:58:27 2024 +0200 +++ b/www/js/fermenter.js Thu Apr 25 14:26:47 2024 +0200 @@ -169,7 +169,7 @@ }); function updateScreen() { - $('#room_thb').html((global.temp_value / 1000.0) + '°C  ' + (global.hum_value / 1000.0) + '% humidity'); + $('#room_thb').html(global.temp_value + '°C  ' + global.hum_value + '% humidity'); $('#info_system').html(record.unit); $('#info_beer').html(record.beercode + ' - ' + record.beername); $('#info_mode').jqxDropDownList('selectItem', record.mode); diff -r b435bf0bf24a -r 13555c27b592 www/js/set_fermenters.js --- a/www/js/set_fermenters.js Wed Apr 24 21:58:27 2024 +0200 +++ b/www/js/set_fermenters.js Thu Apr 25 14:26:47 2024 +0200 @@ -78,6 +78,7 @@ { name: 'air_address', map: 'air>address' }, { name: 'air_idx', map: 'air>idx', type: 'int' }, { name: 'beer_address', map: 'beer>address' }, + { name: 'beer_address2', map: 'beer>address2' }, { name: 'beer_idx', map: 'beer>idx', type: 'int' }, { name: 'chiller_address', map: 'chiller>address' }, { name: 'chiller_idx', map: 'chiller>idx', type: 'int' },