Skip to content

Commit 963278a

Browse files
committed
version bump
1 parent 71a7615 commit 963278a

File tree

6 files changed

+41
-14
lines changed

6 files changed

+41
-14
lines changed

DSMRloggerAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define PATH_DATA_FILES "https://cdn.jsdelivr.net/gh/mhendriks/DSMR-API-V2@latest/data"
2828

2929
static tm timeinfo;
30+
bool LEDenabled = true;
3031

3132
#include "version.h"
3233
#include <TimeLib.h> // https://github.com/PaulStoffregen/Time
@@ -190,7 +191,6 @@ Status P1Status = {0,0,"010101010101X",0,0,'Y'};
190191
uint32_t telegramCount = 0, telegramErrors = 0;
191192
bool showRaw = false;
192193
bool JsonRaw = false;
193-
bool LEDenabled = true;
194194
bool DSMR_NL = true;
195195
bool EnableHistory = true;
196196
bool FSmounted = false;

Network.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt) {
4949
WiFi.reconnect();
5050
if ( (WiFiReconnectCount++ > MaxWifiReconnect) && !WifiBoot ) P1Reboot();
5151
}
52+
digitalWrite(LED, HIGH); //off
5253
}
5354

5455
void onStationGotIP(const WiFiEventStationModeGotIP& evt) {
5556
LogFile("Wifi Connected",true);
56-
digitalWrite(LED, LOW); //ON
57+
digitalWrite(LED, !LEDenabled); //follow settings
5758
Debug (F("\nConnected to " )); Debugln (WiFi.SSID());
5859
Debug (F("IP address: " )); Debug (WiFi.localIP());
5960
Debug (F(" ( gateway: " )); Debug (WiFi.gatewayIP());Debug(" )\n\n");

OtherFiles.ino

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ void readSettings(bool show)
135135
CHANGE_INTERVAL_SEC(publishMQTTtimer, settingMQTTinterval);
136136
CHANGE_INTERVAL_MIN(reconnectMQTTtimer, 1);
137137
LEDenabled = doc["LED"];
138+
digitalWrite(LED, !LEDenabled);
139+
138140
if (doc.containsKey("ota")) strcpy(BaseOTAurl, doc["ota"]);
139141
if (doc.containsKey("enableHistory")) EnableHistory = doc["enableHistory"];
140142
const char* temp = doc["basic-auth"]["user"];
@@ -271,12 +273,22 @@ void updateSetting(const char *field, const char *newValue)
271273
CHANGE_INTERVAL_SEC(publishMQTTtimer, settingMQTTinterval);
272274
}
273275
if (!stricmp(field, "mqtt_toptopic")) strCopy(settingMQTTtopTopic, 20, newValue);
276+
274277
if (!stricmp(field, "ota")){
275278
//curl -i -H "Content-Type: application/json" -d "name":"ota","value":"ota.smart-stuff.nl/" -v http://dsmr-api.local/api/v2/dev/settings
276279
strcpy(BaseOTAurl, "http://");
277280
strncat(BaseOTAurl,newValue,sizeof(BaseOTAurl) -1);
278281
}
279282

283+
if (!stricmp(field, "b_auth_user")) strCopy(bAuthUser,25, newValue);
284+
if (!stricmp(field, "b_auth_pw")) strCopy(bAuthPW,25, newValue);
285+
286+
//booleans
287+
if (!stricmp(field, "led")) LEDenabled = (stricmp(newValue, "true") == 0?true:false);
288+
digitalWrite(LED, !LEDenabled);
289+
if (!stricmp(field, "hist")) EnableHistory = (stricmp(newValue, "true") == 0?true:false);
290+
// if (!stricmp(field, "ha_disc_enabl")) EnableHAdiscovery = (stricmp(newValue, "true") == 0?true:false);
291+
280292
writeSettings();
281293

282294
} // updateSetting()

edge/DSMRindex.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,8 +1833,7 @@ function handle_menu_click()
18331833
data = json;
18341834
for( let i in data )
18351835
{
1836-
if(i=="hist") next;
1837-
1836+
if ( i == "conf") continue;
18381837
console.log("["+i+"]=>["+data[i].value+"]");
18391838
var settings = document.getElementById('settings_table');
18401839
if( ( document.getElementById("settingR_"+i)) == null )
@@ -1852,7 +1851,12 @@ function handle_menu_click()
18521851

18531852
var sInput = document.createElement("INPUT");
18541853
sInput.setAttribute("id", "setFld_"+i);
1855-
1854+
if ( data[i].type === undefined ) {
1855+
sInput.setAttribute("type", "checkbox");
1856+
sInput.checked = data[i];
1857+
sInput.style.width = "auto";
1858+
}
1859+
else {
18561860
switch(data[i].type){
18571861
case "s":
18581862
sInput.setAttribute("type", "text");
@@ -1873,6 +1877,7 @@ function handle_menu_click()
18731877
break;
18741878
}
18751879
sInput.setAttribute("value", data[i].value);
1880+
}
18761881
sInput.addEventListener('change',
18771882
function() { setBackGround("setFld_"+i, "lightgray"); },
18781883
false
@@ -2147,10 +2152,17 @@ function handle_menu_click()
21472152
{
21482153
for(var i in data)
21492154
{
2150-
if ( (i=="hist") || ( document.getElementById("setFld_"+i) == null) ) continue;
2155+
if ( document.getElementById("setFld_"+i) == null ) continue;
21512156
var fldId = i;
21522157
var newVal = document.getElementById("setFld_"+fldId).value;
2153-
if (data[i].value != newVal)
2158+
if ( data[i].value === undefined ) {
2159+
newVal = document.getElementById("setFld_"+fldId).checked;
2160+
if (data[i] != newVal) {
2161+
console.log("save data ["+i+"] => from["+data[i]+"] to["+newVal+"]");
2162+
sendPostSetting(fldId, newVal);
2163+
}
2164+
}
2165+
else if (data[i].value != newVal)
21542166
{
21552167
console.log("save data ["+i+"] => from["+data[i].value+"] to["+newVal+"]");
21562168
sendPostSetting(fldId, newVal);
@@ -2705,12 +2717,14 @@ function handle_menu_click()
27052717
,[ "GasAvailable", "Gasmeter beschikbaar? <br>[True = geen check op basis van meterdata]<br>[False = wel checken]"]
27062718
,[ "water", "Watersensor aanwezig"]
27072719
,[ "water_enabl", "Watersensor aanwezig"]
2720+
,[ "b_auth_user", "Basic Auth. Gebruiker"]
2721+
,[ "b_auth_pw", "Basic Auth. Wachtwoord"]
27082722
,[ "led", "LED aan"]
27092723
,[ "ha_disc_enabl", "HA Auto discovery"]
27102724
,[ "ota_url", "Update url (zonder http://)"]
27112725
,[ "hist", "Metergegevens lokaal opslaan"]
27122726
,[ "auto_update", "Automatisch updaten"]
2713-
,[ "pre40", "SMR 2 & 3 support"]
2727+
,[ "pre40", "SMR 2 & 3 support"]
27142728
];
27152729

27162730
/*

edge/DSMRversion.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.5.3 - fixes reading telegram
1+
v3.5.6 - Belgium peak values + fixes

version.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define _VERSION_MAJOR 3
33
#define _VERSION_MINOR 5
44
#define _VERSION_PATCH 6
5-
#define _VERSION_BUILD 1159
6-
#define _VERSION_DATE "10/01/2023"
7-
#define _VERSION_TIME "00:02:59"
5+
#define _VERSION_BUILD 1164
6+
#define _VERSION_DATE "11/01/2023"
7+
#define _VERSION_TIME "08:59:51"
88
#define _VERSION_ONLY "3.5.6"
9-
#define _VERSION_NOBUILD "3.5.6 (10/01/2023)"
10-
#define _VERSION "3.5.6+1159 (10/01/2023)"
9+
#define _VERSION_NOBUILD "3.5.6 (11/01/2023)"
10+
#define _VERSION "3.5.6+1164 (11/01/2023)"
1111
//The version information is created automatically, more information here: https://github.com/rvdbreemen/autoinc-semver

0 commit comments

Comments
 (0)