Merge branch 'dev-v1.3.0' of github.com:gskjold/AmsToMqttBridge into dev-v1.3.0

This commit is contained in:
Gunnar Skjold
2020-05-03 16:49:28 +02:00
14 changed files with 490 additions and 8 deletions

View File

@@ -61,3 +61,21 @@ lib_deps = ${common.lib_deps}
extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py
[env:az-delivery-devkit-v4]
platform = espressif32@1.11.2
board = az-delivery-devkit-v4
framework = ${common.framework}
lib_deps = ${common.lib_deps}
extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py
[env:esp32doit-devkit-v1]
platform = espressif32@1.11.2
board = esp32doit-devkit-v1
framework = ${common.framework}
lib_deps = ${common.lib_deps}
extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py

View File

@@ -177,6 +177,7 @@ void AmsConfiguration::clearMqtt() {
setMqttSubscribeTopic("");
setMqttUser("");
setMqttPassword("");
setMqttSsl(false);
}
void AmsConfiguration::setMqttChanged() {
@@ -191,7 +192,6 @@ void AmsConfiguration::ackMqttChange() {
mqttChanged = false;
}
byte AmsConfiguration::getAuthSecurity() {
return config.authSecurity;
}
@@ -278,6 +278,55 @@ void AmsConfiguration::setDebugLevel(uint8_t debugLevel) {
config.debugLevel = debugLevel;
}
int AmsConfiguration::getDomoELIDX() {
return config.domoELIDX;
}
int AmsConfiguration::getDomoVL1IDX() {
return config.domoVL1IDX;
}
int AmsConfiguration::getDomoVL2IDX() {
return config.domoVL2IDX;
}
int AmsConfiguration::getDomoVL3IDX() {
return config.domoVL3IDX;
}
int AmsConfiguration::getDomoCL1IDX() {
return config.domoCL1IDX;
}
void AmsConfiguration::setDomoELIDX(int domoELIDX) {
domoChanged |= config.domoELIDX != domoELIDX;
config.domoELIDX = domoELIDX;
}
void AmsConfiguration::setDomoVL1IDX(int domoVL1IDX) {
domoChanged |= config.domoVL1IDX != domoVL1IDX;
config.domoVL1IDX = domoVL1IDX;
}
void AmsConfiguration::setDomoVL2IDX(int domoVL2IDX) {
domoChanged |= config.domoVL2IDX != domoVL2IDX;
config.domoVL2IDX = domoVL2IDX;
}
void AmsConfiguration::setDomoVL3IDX(int domoVL3IDX) {
domoChanged |= config.domoVL3IDX != domoVL3IDX;
config.domoVL3IDX = domoVL3IDX;
}
void AmsConfiguration::setDomoCL1IDX(int domoCL1IDX) {
domoChanged |= config.domoCL1IDX != domoCL1IDX;
config.domoCL1IDX = domoCL1IDX;
}
void AmsConfiguration::clearDomo() {
setDomoELIDX(0);
setDomoVL1IDX(0);
setDomoVL2IDX(0);
setDomoVL3IDX(0);
setDomoCL1IDX(0);
}
bool AmsConfiguration::pinUsed(uint8_t pin) {
if(pin == 0xFF)
return false;
@@ -410,6 +459,13 @@ void AmsConfiguration::setVccBootLimit(double vccBootLimit) {
else
config.vccBootLimit = max(2.5, min(vccBootLimit, 3.5)) * 10;
}
bool AmsConfiguration::isDomoChanged() {
return domoChanged;
}
void AmsConfiguration::ackDomoChange() {
domoChanged = false;
}
bool AmsConfiguration::hasConfig() {
if(configVersion == 0) {
@@ -628,6 +684,29 @@ bool AmsConfiguration::loadConfig81(int address) {
address += readInt(address, &i);
setDebugLevel(i);
bool domo = false;
address += readBool(address, &domo);
if(domo) {
int domoELIDX;
address += readInt(address, &domoELIDX);
setDomoELIDX(domoELIDX);
int domoVL1IDX;
address += readInt(address, &domoVL1IDX);
setDomoVL1IDX(domoVL1IDX);
int domoVL2IDX;
address += readInt(address, &domoVL2IDX);
setDomoVL2IDX(domoVL2IDX);
int domoVL3IDX;
address += readInt(address, &domoVL3IDX);
setDomoVL3IDX(domoVL3IDX);
int domoCL1IDX;
address += readInt(address, &domoCL1IDX);
setDomoCL1IDX(domoCL1IDX);
} else {
clearDomo();
}
ackWifiChange();
return true;
@@ -730,5 +809,13 @@ void AmsConfiguration::print(Print* debugger)
debugger->printf("AP pin: %i\r\n", this->getApPin());
debugger->printf("Temperature pin: %i\r\n", this->getTempSensorPin());
if(this->getDomoELIDX() > 0) {
debugger->printf("Domoticz ELIDX: %i\r\n", this->getDomoELIDX());
debugger->printf("Domoticz VL1IDX: %i\r\n", this->getDomoVL1IDX());
debugger->printf("Domoticz VL2IDX: %i\r\n", this->getDomoVL2IDX());
debugger->printf("Domoticz VL3IDX: %i\r\n", this->getDomoVL3IDX());
debugger->printf("Domoticz CL1IDX: %i\r\n", this->getDomoCL1IDX());
}
debugger->println("-----------------------------------------------");
}

View File

@@ -45,6 +45,12 @@ struct ConfigObject {
uint8_t vccPin;
uint16_t vccMultiplier;
uint8_t vccBootLimit;
int domoELIDX;
int domoVL1IDX;
int domoVL2IDX;
int domoVL3IDX;
int domoCL1IDX;
};
class AmsConfiguration {
@@ -154,7 +160,23 @@ public:
void setVccBootLimit(double vccBootLimit);
void print(Print* debugger);
int getDomoELIDX();
int getDomoVL1IDX();
int getDomoVL2IDX();
int getDomoVL3IDX();
int getDomoCL1IDX();
double getDomoEnergy();
void setDomoELIDX(int domoELIDX);
void setDomoVL1IDX(int domoVL1IDX);
void setDomoVL2IDX(int domoVL2IDX);
void setDomoVL3IDX(int domoVL3IDX);
void setDomoCL1IDX(int domoCL1IDX);
void clearDomo();
bool isDomoChanged();
void ackDomoChange();
protected:
private:
@@ -198,9 +220,15 @@ private:
0xFF, // Temp sensor
0xFF, // Vcc
100, // Multiplier
0 // Boot limit
0, // Boot limit
//Domoticz
0, // ELIDX
0, // VL1IDX
0, // VL2IDX
0, // VL3IDX
0 // CL1IDX
};
bool wifiChanged, mqttChanged;
bool wifiChanged, mqttChanged, domoChanged;
const int EEPROM_SIZE = 2048;
const int EEPROM_CHECK_SUM = 82; // Used to check if config is stored. Change if structure changes

View File

@@ -258,6 +258,9 @@ unsigned long lastSuccessfulRead = 0;
unsigned long lastErrorBlink = 0;
int lastError = 0;
// domoticz energy init
double energy = -1.0;
void loop() {
Debug.handle();
unsigned long now = millis();
@@ -514,6 +517,156 @@ void readHanPort() {
String msg;
serializeJson(json, msg);
mqtt.publish(config.getMqttPublishTopic(), msg.c_str());
//
// Start DOMOTICZ
//
} else if(config.getMqttPayloadFormat() == 3) {
//
// This part is also publishing standard json message for now. May be removed.
//
StaticJsonDocument<512> json;
hanToJson(json, data, hw, temperature);
if (Debug.isActive(RemoteDebug::INFO)) {
debugI("Sending data to MQTT");
if (Debug.isActive(RemoteDebug::DEBUG)) {
serializeJsonPretty(json, Debug);
}
}
String msg;
serializeJson(json, msg);
mqtt.publish(config.getMqttPublishTopic(), msg.c_str()); // keep for now, this is identical to option 0.
//
// Special MQTT messages for DOMOTIZ (https://www.domoticz.com/wiki/MQTT)
// -All messages should be published to topic "domoticz/in"
//
// message msg_PE : send active power and and cumulative energy consuption to virtual meter "Electricity (instant and counter)"
//
// /json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=POWER;ENERGY
//
// MQTT sample message: {"command": "udevice", "idx" : IDX , "nvalue" : 0, "svalue" : "POWER;ENERGY"}
// IDX = id of your device (This number can be found in the devices tab in the column "IDX")
// POWER = current power (Watt)
// ENERGY = cumulative energy in Watt-hours (Wh) This is an incrementing counter.
// (if you choose as type "Energy read : Computed", this is just a "dummy" counter, not updatable because it's the result of DomoticZ calculs from POWER)
//
// message msg_V1 : send Voltage of L1 to virtual Voltage meter
//
// /json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=VOLTAGE
//
// MQTT sample message: {"command": "udevice", "idx" : IDX , "nvalue" : 0, "svalue" : "VOLTAGE"}
// IDX = id of your device (This number can be found in the devices tab in the column "IDX")
// VOLTAGE = Voltage (V)
//
int idx1 = config.getDomoELIDX();
if (idx1 > 0) {
String PowerEnergy;
int p;
// double energy = config.getDomoEnergy();
double tmp_energy;
StaticJsonDocument<200> json_PE;
p = data.getActiveImportPower();
// cumulative energy is given only once pr hour. check if value is different from 0 and store last valid value on global variable.
tmp_energy = data.getActiveImportCounter();
if (tmp_energy > 1.0) energy = tmp_energy;
// power_unit: watt, energy_unit: watt*h. Stored as kwh, need watth
PowerEnergy = String((double) p/1.0) + ";" + String((double) energy*1000.0) ;
json_PE["command"] = "udevice";
json_PE["idx"] = idx1;
json_PE["nvalue"] = 0;
json_PE["svalue"] = PowerEnergy;
// Stringify the json
String msg_PE;
serializeJson(json_PE, msg_PE);
// publish power data directly to domoticz/in, but only after first reading of total power, once an hour... . (otherwise total consumtion will be wrong.)
if (energy > 0.0 ) mqtt.publish("domoticz/in", msg_PE.c_str());
}
int idxu1 =config.getDomoVL1IDX();
if (idxu1 > 0){
StaticJsonDocument<200> json_u1;
double u1;
//
// prepare message msg_u1 for virtual Voltage meter"
//
u1 = data.getL1Voltage();
if (u1 > 0.1){
json_u1["command"] = "udevice";
json_u1["idx"] = idxu1;
json_u1["nvalue"] = 0;
json_u1["svalue"] = String(u1);
// Stringify the json
String msg_u1;
serializeJson(json_u1, msg_u1);
// publish power data directly to domoticz/in
mqtt.publish("domoticz/in", msg_u1.c_str());
}
}
int idxu2 =config.getDomoVL2IDX();
if (idxu2 > 0){
StaticJsonDocument<200> json_u2;
double u2;
//
// prepare message msg_u2 for virtual Voltage meter"
//
u2 = data.getL2Voltage();
if (u2 > 0.1){
json_u2["command"] = "udevice";
json_u2["idx"] = idxu2;
json_u2["nvalue"] = 0;
json_u2["svalue"] = String(u2);
// Stringify the json
String msg_u2;
serializeJson(json_u2, msg_u2);
// publish power data directly to domoticz/in
mqtt.publish("domoticz/in", msg_u2.c_str());
}
}
int idxu3 =config.getDomoVL3IDX();
if (idxu3 > 0){
StaticJsonDocument<200> json_u3;
double u3;
//
// prepare message msg_u3 for virtual Voltage meter"
//
u3 = data.getL3Voltage();
if (u3 > 0.1){
json_u3["command"] = "udevice";
json_u3["idx"] = idxu3;
json_u3["nvalue"] = 0;
json_u3["svalue"] = String(u3);
// Stringify the json
String msg_u3;
serializeJson(json_u3, msg_u3);
// publish power data directly to domoticz/in
mqtt.publish("domoticz/in", msg_u3.c_str());
}
}
int idxi1 =config.getDomoCL1IDX();
if (idxi1 > 0){
StaticJsonDocument<200> json_i1;
double i1, i2, i3;
String Ampere3;
//
// prepare message msg_i1 for virtual Current/Ampere 3phase mater"
//
i1 = data.getL1Current();
i2 = data.getL2Current();
i3 = data.getL3Current();
Ampere3 = String(i1) + ";" + String(i2) + ";" + String(i3) ;
json_i1["command"] = "udevice";
json_i1["idx"] = idxi1;
json_i1["nvalue"] = 0;
json_i1["svalue"] = Ampere3;
// Stringify the json
String msg_i1;
serializeJson(json_i1, msg_i1);
// publish power data directly to domoticz/in
if (i1 > 0.0) mqtt.publish("domoticz/in", msg_i1.c_str());
}
//
// End DOMOTICZ
//
} else if(config.getMqttPayloadFormat() == 1 || config.getMqttPayloadFormat() == 2) {
mqtt.publish(String(config.getMqttPublishTopic()) + "/meter/dlms/timestamp", String(data.getPackageTimestamp()));
switch(data.getListType()) {

View File

@@ -9,6 +9,7 @@
#include "root/configwifi_html.h"
#include "root/configmqtt_html.h"
#include "root/configweb_html.h"
#include "root/configdomoticz_html.h"
#include "root/configsystem_html.h"
#include "root/restartwait_html.h"
#include "root/boot_css.h"
@@ -34,6 +35,7 @@ void AmsWebServer::setup(AmsConfiguration* config, MQTTClient* mqtt) {
server.on("/config-wifi", HTTP_GET, std::bind(&AmsWebServer::configWifiHtml, this));
server.on("/config-mqtt", HTTP_GET, std::bind(&AmsWebServer::configMqttHtml, this));
server.on("/config-web", HTTP_GET, std::bind(&AmsWebServer::configWebHtml, this));
server.on("/config-domoticz",HTTP_GET, std::bind(&AmsWebServer::configDomoticzHtml, this));
server.on("/boot.css", HTTP_GET, std::bind(&AmsWebServer::bootCss, this));
server.on("/gaugemeter.js", HTTP_GET, std::bind(&AmsWebServer::gaugemeterJs, this));
server.on("/data.json", HTTP_GET, std::bind(&AmsWebServer::dataJson, this));
@@ -268,7 +270,7 @@ void AmsWebServer::configMqttHtml() {
html.replace("${config.mqttUser}", config->getMqttUser());
html.replace("${config.mqttPassword}", config->getMqttPassword());
html.replace("${config.mqttPayloadFormat}", String(config->getMqttPayloadFormat()));
for(int i = 0; i<3; i++) {
for(int i = 0; i<4; i++) {
html.replace("${config.mqttPayloadFormat" + String(i) + "}", config->getMqttPayloadFormat() == i ? "selected" : "");
}
@@ -296,6 +298,38 @@ void AmsWebServer::configMqttHtml() {
server.send(200, "text/html", html);
}
void AmsWebServer::configDomoticzHtml() {
printD("Serving /config/domoticz.html over http...");
if(!checkSecurity(1))
return;
String html = String((const __FlashStringHelper*) CONFIGDOMOTICZ_HTML);
html.replace("${version}", VERSION);
if(WiFi.getMode() != WIFI_AP) {
html.replace("boot.css", BOOTSTRAP_URL);
}
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
server.sendHeader("Pragma", "no-cache");
html.replace("${config.domo}", config->getDomoELIDX() <= 0 ? "" : "checked");
if(config->getDomoELIDX() > 0){ html.replace("${config.domoELIDX}", String(config->getDomoELIDX()));
} else { html.replace("${config.domoELIDX}", ""); }
if(config->getDomoVL1IDX() > 0){ html.replace("${config.domoVL1IDX}", String(config->getDomoVL1IDX()));
} else { html.replace("${config.domoVL1IDX}", ""); }
if(config->getDomoVL2IDX() > 0){ html.replace("${config.domoVL2IDX}", String(config->getDomoVL2IDX()));
} else { html.replace("${config.domoVL2IDX}", ""); }
if(config->getDomoVL3IDX() > 0){ html.replace("${config.domoVL3IDX}", String(config->getDomoVL3IDX()));
} else { html.replace("${config.domoVL3IDX}", ""); }
if(config->getDomoCL1IDX() > 0){ html.replace("${config.domoCL1IDX}", String(config->getDomoCL1IDX()));
} else { html.replace("${config.domoCL1IDX}", ""); }
server.setContentLength(html.length());
server.send(200, "text/html", html);
}
void AmsWebServer::configWebHtml() {
printD("Serving /config-web.html over http...");
@@ -471,6 +505,18 @@ void AmsWebServer::dataJson() {
json.createNestedObject("mqtt");
json["mqtt"]["lastError"] = (int) mqtt->lastError();
String domoStatus;
if(String(config->getDomoELIDX()).isEmpty()) {
domoStatus = "secondary";
} else if(mqtt->connected() && config->getMqttPayloadFormat() == 3 && config->getDomoELIDX() > 0) {
domoStatus = "success";
} else if(mqtt->lastError() == 0) {
domoStatus = "warning";
} else {
domoStatus = "danger";
}
json["status"]["domo"] = domoStatus;
serializeJson(json, jsonStr);
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
@@ -617,6 +663,20 @@ void AmsWebServer::handleSave() {
}
}
if(server.hasArg("domoConfig") && server.arg("domoConfig") == "true") {
if(server.hasArg("domo") && server.arg("domo") == "true") {
config->setDomoELIDX(server.arg("domoELIDX").toInt());
config->setDomoVL1IDX(server.arg("domoVL1IDX").toInt());
config->setDomoVL2IDX(server.arg("domoVL2IDX").toInt());
config->setDomoVL3IDX(server.arg("domoVL3IDX").toInt());
config->setDomoCL1IDX(server.arg("domoCL1IDX").toInt());
} else {
config->clearDomo();
}
}
if(server.hasArg("authConfig") && server.arg("authConfig") == "true") {
config->setAuthSecurity((byte)server.arg("authSecurity").toInt());
if(config->getAuthSecurity() > 0) {

View File

@@ -61,6 +61,7 @@ private:
void configWifiHtml();
void configMqttHtml();
void configWebHtml();
void configDomoticzHtml();
void bootCss();
void gaugemeterJs();
void dataJson();

120
web/configdomoticz.html Normal file
View File

@@ -0,0 +1,120 @@
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AMS reader - WiFi configuration</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="boot.css"/>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<body class="bg-light">
<main role="main" class="container">
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bg-purple rounded mt-2 mb-4" style="background-color: var(--purple);">
<a href="/" class=""><h6 class="navbar-brand">AMS reader <small>${version}</small></h6></a>
<div class="navbar-nav-scroll">
<ul class="navbar-nav bd-navbar-nav flex-row">
<li class="nav-item">
<a class="nav-link " href="/config-meter">Meter</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-wifi">WiFi</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-mqtt">MQTT</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link active " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config-system">System</a>
</li>
</ul>
</div>
<ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
<li class="nav-item">
<a class="nav-link p-2" href="https://github.com/gskjold/AmsToMqttBridge" target="_blank" rel="noopener" aria-label="GitHub">
<svg class="d-inline-block align-text-top" style="width: 2rem; height: 2rem;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 499.36" focusable="false"><title>GitHub</title><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"></path></svg>
</a>
</li>
</ul>
</header>
<form method="post" action="/save">
<input type="hidden" name="domoConfig" value="true"/>
<div class="my-3 p-3 bg-white rounded shadow">
<div class="text"></div>Domoticz Configuration. Requires that a Domoticz MQTT-message-broker is setup. HOWTO: https://www.domoticz.com/wiki/MQTT. <br/>(This implementation assumes that the host defined on the MQTT tab is used.) <br/><br/>The following virtual sensors can currently be used: <br/>
"Electricity (instant and counter)", "Electricity Current/Ampere 3 Phase" and "Voltage", see https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's <br/><br/>
Create the sensors in Domoticz under Hardware > Dummy > Create virtual sensor, and use the IDX assigned to the sensor as input here. <br/><br/>
"Electricity (instant and counter)" relies on Total energy import "tPI" and will not start before the first value is read (once an hour). </div>
</div>
<div class="row">
<div class="col-md-4">
<div class="row form-group">
<label class="col-4">Enable</label>
<div class="col-4">
<input id="domoEnable" type="checkbox" name="domo" value="true" ${config.domo}/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="row form-group">
<label class="col-6">Electricity IDX</label>
<div class="col-6">
<input type="text" class="form-control domo-config" name="domoELIDX" value="${config.domoELIDX}"/>
</div>
</div>
<div class="row form-group">
<label class="col-6">Current (3 Phase) IDX</label>
<div class="col-6">
<input type="text" class="form-control domo-config" name="domoCL1IDX" value="${config.domoCL1IDX}"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="row form-group">
<label class="col-6">Voltage L1 IDX</label>
<div class="col-6">
<input type="text" class="form-control domo-config" name="domoVL1IDX" value="${config.domoVL1IDX}"/>
</div>
</div>
<div class="row form-group">
<label class="col-6">Voltage L2 IDX</label>
<div class="col-6">
<input type="text" class="form-control domo-config" name="domoVL2IDX" value="${config.domoVL2IDX}"/>
</div>
</div><div class="row form-group">
<label class="col-6">Voltage L3 IDX</label>
<div class="col-6">
<input type="text" class="form-control domo-config" name="domoVL3IDX" value="${config.domoVL3IDX}"/>
</div>
</div>
</div>
</div>
</div>
<hr/>
<div class="row form-group">
<div class="col-6">
<a href="/" class="btn btn-outline-secondary">Back</a>
</div>
<div class="col-6 text-right">
<button class="btn btn-primary">Save</button>
</div>
</div>
</form>
</main>
<script>
$('#domoEnable').on('change', function() {
var inputs = $('.domo-config');
inputs.prop('disabled', !$(this).is(':checked'));
});
$(function() {
$('#domoEnable').trigger('change');
});
</script>
</body>
</html>

View File

@@ -25,6 +25,9 @@
<a class="nav-link" href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config-system">System</a>
</li>
</ul>

View File

@@ -25,6 +25,9 @@
<li class="nav-item">
<a class="nav-link" href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config-system">System</a>
</li>
@@ -56,6 +59,7 @@
<option value="0" ${config.mqttPayloadFormat0}>JSON</option>
<option value="1" ${config.mqttPayloadFormat1}>Raw (minimal)</option>
<option value="2" ${config.mqttPayloadFormat2}>Raw (full)</option>
<option value="3" ${config.mqttPayloadFormat3}>Domoticz</option>
</select>
</div>
</div>

View File

@@ -25,9 +25,12 @@
<a class="nav-link" href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/config-system">System</a>
</li>
</ul>
</ul>
</div>
<ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
<li class="nav-item">

View File

@@ -25,6 +25,9 @@
<li class="nav-item">
<a class="nav-link active" href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config-system">System</a>
</li>

View File

@@ -25,6 +25,9 @@
<li class="nav-item">
<a class="nav-link" href="/config-web">Web</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/config-domoticz">Domoticz</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config-system">System</a>
</li>

View File

@@ -52,7 +52,7 @@
</head>
<body class="bg-light">
<main role="main" class="container">
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row rounded mt-2 mb-4" style="background-color: var(--purple);">
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row rounded mt-2 mb-4" style="background-color: var(--purple);">
<a href="/" class=""><h6 class="navbar-brand">AMS reader <small>${version}</small></h6></a>
<div class="navbar-nav-scroll">
<ul class="navbar-nav bd-navbar-nav flex-row">

View File

@@ -167,7 +167,6 @@ var fetch = function() {
append: "W"
});
}
setStatus("mqtt", "secondary");
setStatus("wifi", "secondary");
setStatus("han", "secondary");