Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mhendriks committed Jan 11, 2023
1 parent 71a7615 commit 963278a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DSMRloggerAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define PATH_DATA_FILES "https://cdn.jsdelivr.net/gh/mhendriks/DSMR-API-V2@latest/data"

static tm timeinfo;
bool LEDenabled = true;

#include "version.h"
#include <TimeLib.h> // https://github.com/PaulStoffregen/Time
Expand Down Expand Up @@ -190,7 +191,6 @@ Status P1Status = {0,0,"010101010101X",0,0,'Y'};
uint32_t telegramCount = 0, telegramErrors = 0;
bool showRaw = false;
bool JsonRaw = false;
bool LEDenabled = true;
bool DSMR_NL = true;
bool EnableHistory = true;
bool FSmounted = false;
Expand Down
3 changes: 2 additions & 1 deletion Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt) {
WiFi.reconnect();
if ( (WiFiReconnectCount++ > MaxWifiReconnect) && !WifiBoot ) P1Reboot();
}
digitalWrite(LED, HIGH); //off
}

void onStationGotIP(const WiFiEventStationModeGotIP& evt) {
LogFile("Wifi Connected",true);
digitalWrite(LED, LOW); //ON
digitalWrite(LED, !LEDenabled); //follow settings
Debug (F("\nConnected to " )); Debugln (WiFi.SSID());
Debug (F("IP address: " )); Debug (WiFi.localIP());
Debug (F(" ( gateway: " )); Debug (WiFi.gatewayIP());Debug(" )\n\n");
Expand Down
12 changes: 12 additions & 0 deletions OtherFiles.ino
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void readSettings(bool show)
CHANGE_INTERVAL_SEC(publishMQTTtimer, settingMQTTinterval);
CHANGE_INTERVAL_MIN(reconnectMQTTtimer, 1);
LEDenabled = doc["LED"];
digitalWrite(LED, !LEDenabled);

if (doc.containsKey("ota")) strcpy(BaseOTAurl, doc["ota"]);
if (doc.containsKey("enableHistory")) EnableHistory = doc["enableHistory"];
const char* temp = doc["basic-auth"]["user"];
Expand Down Expand Up @@ -271,12 +273,22 @@ void updateSetting(const char *field, const char *newValue)
CHANGE_INTERVAL_SEC(publishMQTTtimer, settingMQTTinterval);
}
if (!stricmp(field, "mqtt_toptopic")) strCopy(settingMQTTtopTopic, 20, newValue);

if (!stricmp(field, "ota")){
//curl -i -H "Content-Type: application/json" -d "name":"ota","value":"ota.smart-stuff.nl/" -v http://dsmr-api.local/api/v2/dev/settings
strcpy(BaseOTAurl, "http://");
strncat(BaseOTAurl,newValue,sizeof(BaseOTAurl) -1);
}

if (!stricmp(field, "b_auth_user")) strCopy(bAuthUser,25, newValue);
if (!stricmp(field, "b_auth_pw")) strCopy(bAuthPW,25, newValue);

//booleans
if (!stricmp(field, "led")) LEDenabled = (stricmp(newValue, "true") == 0?true:false);
digitalWrite(LED, !LEDenabled);
if (!stricmp(field, "hist")) EnableHistory = (stricmp(newValue, "true") == 0?true:false);
// if (!stricmp(field, "ha_disc_enabl")) EnableHAdiscovery = (stricmp(newValue, "true") == 0?true:false);

writeSettings();

} // updateSetting()
Expand Down
26 changes: 20 additions & 6 deletions edge/DSMRindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -1833,8 +1833,7 @@ function handle_menu_click()
data = json;
for( let i in data )
{
if(i=="hist") next;

if ( i == "conf") continue;
console.log("["+i+"]=>["+data[i].value+"]");
var settings = document.getElementById('settings_table');
if( ( document.getElementById("settingR_"+i)) == null )
Expand All @@ -1852,7 +1851,12 @@ function handle_menu_click()

var sInput = document.createElement("INPUT");
sInput.setAttribute("id", "setFld_"+i);

if ( data[i].type === undefined ) {
sInput.setAttribute("type", "checkbox");
sInput.checked = data[i];
sInput.style.width = "auto";
}
else {
switch(data[i].type){
case "s":
sInput.setAttribute("type", "text");
Expand All @@ -1873,6 +1877,7 @@ function handle_menu_click()
break;
}
sInput.setAttribute("value", data[i].value);
}
sInput.addEventListener('change',
function() { setBackGround("setFld_"+i, "lightgray"); },
false
Expand Down Expand Up @@ -2147,10 +2152,17 @@ function handle_menu_click()
{
for(var i in data)
{
if ( (i=="hist") || ( document.getElementById("setFld_"+i) == null) ) continue;
if ( document.getElementById("setFld_"+i) == null ) continue;
var fldId = i;
var newVal = document.getElementById("setFld_"+fldId).value;
if (data[i].value != newVal)
if ( data[i].value === undefined ) {
newVal = document.getElementById("setFld_"+fldId).checked;
if (data[i] != newVal) {
console.log("save data ["+i+"] => from["+data[i]+"] to["+newVal+"]");
sendPostSetting(fldId, newVal);
}
}
else if (data[i].value != newVal)
{
console.log("save data ["+i+"] => from["+data[i].value+"] to["+newVal+"]");
sendPostSetting(fldId, newVal);
Expand Down Expand Up @@ -2705,12 +2717,14 @@ function handle_menu_click()
,[ "GasAvailable", "Gasmeter beschikbaar? <br>[True = geen check op basis van meterdata]<br>[False = wel checken]"]
,[ "water", "Watersensor aanwezig"]
,[ "water_enabl", "Watersensor aanwezig"]
,[ "b_auth_user", "Basic Auth. Gebruiker"]
,[ "b_auth_pw", "Basic Auth. Wachtwoord"]
,[ "led", "LED aan"]
,[ "ha_disc_enabl", "HA Auto discovery"]
,[ "ota_url", "Update url (zonder http://)"]
,[ "hist", "Metergegevens lokaal opslaan"]
,[ "auto_update", "Automatisch updaten"]
,[ "pre40", "SMR 2 & 3 support"]
,[ "pre40", "SMR 2 & 3 support"]
];

/*
Expand Down
2 changes: 1 addition & 1 deletion edge/DSMRversion.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.5.3 - fixes reading telegram
v3.5.6 - Belgium peak values + fixes
10 changes: 5 additions & 5 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#define _VERSION_MAJOR 3
#define _VERSION_MINOR 5
#define _VERSION_PATCH 6
#define _VERSION_BUILD 1159
#define _VERSION_DATE "10/01/2023"
#define _VERSION_TIME "00:02:59"
#define _VERSION_BUILD 1164
#define _VERSION_DATE "11/01/2023"
#define _VERSION_TIME "08:59:51"
#define _VERSION_ONLY "3.5.6"
#define _VERSION_NOBUILD "3.5.6 (10/01/2023)"
#define _VERSION "3.5.6+1159 (10/01/2023)"
#define _VERSION_NOBUILD "3.5.6 (11/01/2023)"
#define _VERSION "3.5.6+1164 (11/01/2023)"
//The version information is created automatically, more information here: https://github.com/rvdbreemen/autoinc-semver

0 comments on commit 963278a

Please sign in to comment.