mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-29 10:16:21 +02:00
0.7.24
* merge PR #1069 make MqTT client ID configurable * fix #1016, general MqTT status depending on inverter state machine * changed icon for fully available inverter to a filled check mark #1070 * fixed `last_success` update with MqTT #1068 * removed `improv` esp-web-installer script, because it is not fully functional at this time
This commit is contained in:
parent
b586d7e623
commit
85dae3805f
8 changed files with 34 additions and 23 deletions
|
@ -1,5 +1,12 @@
|
|||
# Development Changes
|
||||
|
||||
## 0.7.24 - 2023-08-05
|
||||
* merge PR #1069 make MqTT client ID configurable
|
||||
* fix #1016, general MqTT status depending on inverter state machine
|
||||
* changed icon for fully available inverter to a filled check mark #1070
|
||||
* fixed `last_success` update with MqTT #1068
|
||||
* removed `improv` esp-web-installer script, because it is not fully functional at this time
|
||||
|
||||
## 0.7.23 - 2023-08-04
|
||||
* merge PR #1056, visualization html
|
||||
* update MqTT library to 1.4.4
|
||||
|
|
|
@ -97,7 +97,7 @@ void app::setup() {
|
|||
|
||||
mPubSerial.setup(mConfig, &mSys, &mTimestamp);
|
||||
|
||||
mImprov.setup(this, mConfig->sys.deviceName, mVersion);
|
||||
//mImprov.setup(this, mConfig->sys.deviceName, mVersion);
|
||||
|
||||
regularTickers();
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ void app::setup() {
|
|||
//-----------------------------------------------------------------------------
|
||||
void app::loop(void) {
|
||||
mInnerLoopCb();
|
||||
mImprov.tickSerial();
|
||||
//mImprov.tickSerial();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "utils/crc.h"
|
||||
#include "utils/dbg.h"
|
||||
#include "utils/scheduler.h"
|
||||
#include "utils/improv.h"
|
||||
//#include "utils/improv.h"
|
||||
#include "web/RestApi.h"
|
||||
#include "web/web.h"
|
||||
#include "wifi/ahoywifi.h"
|
||||
|
@ -304,7 +304,7 @@ class app : public IApp, public ah::Scheduler {
|
|||
PayloadType mPayload;
|
||||
MiPayloadType mMiPayload;
|
||||
PubSerialType mPubSerial;
|
||||
Improv mImprov;
|
||||
//Improv mImprov;
|
||||
#ifdef ESP32
|
||||
CmtRadioType mCmtRadio;
|
||||
HmsPayloadType mHmsPayload;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 7
|
||||
#define VERSION_PATCH 23
|
||||
#define VERSION_PATCH 24
|
||||
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
|
@ -85,7 +85,7 @@ enum {MQTT_STATUS_OFFLINE = 0, MQTT_STATUS_PARTIAL, MQTT_STATUS_ONLINE};
|
|||
#define NTP_ADDR_LEN 32 // DNS Name
|
||||
|
||||
#define MQTT_ADDR_LEN 64 // DNS Name
|
||||
#define MQTT_CLIENTID_LEN 65
|
||||
#define MQTT_CLIENTID_LEN 22 // number of chars is limited to 23 up to v3.1 of MQTT
|
||||
#define MQTT_USER_LEN 65 // there is another byte necessary for \0
|
||||
#define MQTT_PWD_LEN 65
|
||||
#define MQTT_TOPIC_LEN 65
|
||||
|
|
|
@ -76,9 +76,8 @@ class PubMqtt {
|
|||
|
||||
if((strlen(mCfgMqtt->user) > 0) && (strlen(mCfgMqtt->pwd) > 0))
|
||||
mClient.setCredentials(mCfgMqtt->user, mCfgMqtt->pwd);
|
||||
if(strlen(mCfgMqtt->clientId) > 0)
|
||||
{
|
||||
snprintf(mClientId, 24, "%s-", mCfgMqtt->clientId);
|
||||
if(strlen(mCfgMqtt->clientId) > 0) {
|
||||
snprintf(mClientId, 23, "%s-", mCfgMqtt->clientId);
|
||||
mClient.setClientId(mCfgMqtt->clientId);
|
||||
} else{
|
||||
snprintf(mClientId, 24, "%s-", mDevName);
|
||||
|
@ -485,8 +484,13 @@ class PubMqtt {
|
|||
|
||||
// inverter status
|
||||
iv->isProducing(); // recalculate status
|
||||
if (iv->isAvailable())
|
||||
if (InverterStatus::OFF < iv->status) {
|
||||
anyAvail = true;
|
||||
|
||||
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/last_success", iv->config->name);
|
||||
snprintf(mVal, 40, "%d", iv->getLastTs(rec));
|
||||
publish(mSubTopic, mVal, true);
|
||||
}
|
||||
else // inverter is enabled but not available
|
||||
allAvail = false;
|
||||
|
||||
|
@ -501,10 +505,6 @@ class PubMqtt {
|
|||
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/available", iv->config->name);
|
||||
snprintf(mVal, 40, "%d", (uint8_t)iv->status);
|
||||
publish(mSubTopic, mVal, true);
|
||||
|
||||
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/last_success", iv->config->name);
|
||||
snprintf(mVal, 40, "%d", iv->getLastTs(rec));
|
||||
publish(mSubTopic, mVal, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,10 @@ iconSuccess = [
|
|||
"M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"
|
||||
];
|
||||
|
||||
iconSuccessFull = [
|
||||
"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"
|
||||
];
|
||||
|
||||
/**
|
||||
* GENERIC FUNCTIONS
|
||||
*/
|
||||
|
|
|
@ -119,10 +119,12 @@
|
|||
function parseIv(obj) {
|
||||
var p = div(["none"]);
|
||||
for(var i of obj) {
|
||||
var icon = iconWarn;
|
||||
var cl = "icon-warn";
|
||||
avail = "";
|
||||
var icon = iconSuccess;
|
||||
var cl = "icon-success";
|
||||
var avail = "";
|
||||
if(false == i["enabled"]) {
|
||||
icon = iconWarn;
|
||||
cl = "icon-warn";
|
||||
avail = "disabled";
|
||||
}
|
||||
else if(false == i["is_avail"]) {
|
||||
|
@ -131,16 +133,14 @@
|
|||
avail = "not yet available";
|
||||
}
|
||||
else if(0 == i["ts_last_success"]) {
|
||||
icon = iconSuccess;
|
||||
avail = "available but no data was received until now";
|
||||
}
|
||||
else {
|
||||
icon = iconSuccess;
|
||||
avail = "available and is ";
|
||||
if(false == i["is_producing"])
|
||||
avail += "not ";
|
||||
else
|
||||
cl = "icon-success";
|
||||
icon = iconSuccessFull;
|
||||
avail += "producing";
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@
|
|||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-sm-3 my-2">Client Id (optional)</div>
|
||||
<div class="col-12 col-sm-9"><input type="text" name="clientId"/></div>
|
||||
<div class="col-12 col-sm-9"><input type="text" name="mqttClientId"/></div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-sm-3 my-2">Username (optional)</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue