mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-09 14:11:39 +02:00
ZE optimize Code, Log
This commit is contained in:
parent
bc91c0c94f
commit
45b1d657ce
4 changed files with 375 additions and 330 deletions
|
@ -74,7 +74,7 @@ void app::setup() {
|
||||||
#if defined(PLUGIN_ZEROEXPORT) || defined(ENABLE_MQTT)
|
#if defined(PLUGIN_ZEROEXPORT) || defined(ENABLE_MQTT)
|
||||||
mCommunication.addPowerLimitAckListener([this] (Inverter<> *iv) {
|
mCommunication.addPowerLimitAckListener([this] (Inverter<> *iv) {
|
||||||
#if defined(PLUGIN_ZEROEXPORT)
|
#if defined(PLUGIN_ZEROEXPORT)
|
||||||
mZeroExport.resetWaitLimitAck(iv);
|
mZeroExport.eventAckSetLimit(iv);
|
||||||
#endif /*PLUGIN_ZEROEXPORT*/
|
#endif /*PLUGIN_ZEROEXPORT*/
|
||||||
#if defined(ENABLE_MQTT)
|
#if defined(ENABLE_MQTT)
|
||||||
mMqtt.setPowerLimitAck(iv);
|
mMqtt.setPowerLimitAck(iv);
|
||||||
|
@ -83,17 +83,17 @@ void app::setup() {
|
||||||
#endif /*defined(PLUGIN_ZEROEXPORT) || defined(ENABLE_MQTT)*/
|
#endif /*defined(PLUGIN_ZEROEXPORT) || defined(ENABLE_MQTT)*/
|
||||||
#if defined(PLUGIN_ZEROEXPORT)
|
#if defined(PLUGIN_ZEROEXPORT)
|
||||||
mCommunication.addPowerPowerAckListener([this] (Inverter<> *iv) {
|
mCommunication.addPowerPowerAckListener([this] (Inverter<> *iv) {
|
||||||
mZeroExport.resetWaitPowerAck(iv);
|
mZeroExport.eventAckSetPower(iv);
|
||||||
});
|
});
|
||||||
#endif /*PLUGIN_ZEROEXPORT*/
|
#endif /*PLUGIN_ZEROEXPORT*/
|
||||||
#if defined(PLUGIN_ZEROEXPORT)
|
#if defined(PLUGIN_ZEROEXPORT)
|
||||||
mCommunication.addPowerRebootAckListener([this] (Inverter<> *iv) {
|
mCommunication.addPowerRebootAckListener([this] (Inverter<> *iv) {
|
||||||
mZeroExport.resetWaitRebootAck(iv);
|
mZeroExport.eventAckSetReboot(iv);
|
||||||
});
|
});
|
||||||
#endif /*PLUGIN_ZEROEXPORT*/
|
#endif /*PLUGIN_ZEROEXPORT*/
|
||||||
#if defined(PLUGIN_ZEROEXPORT)
|
#if defined(PLUGIN_ZEROEXPORT)
|
||||||
mCommunication.addNewDataListener([this] (Inverter<> *iv) {
|
mCommunication.addNewDataListener([this] (Inverter<> *iv) {
|
||||||
mZeroExport.newDataAvailable(iv);
|
mZeroExport.eventNewDataAvailable(iv);
|
||||||
});
|
});
|
||||||
#endif /*PLUGIN_ZEROEXPORT*/
|
#endif /*PLUGIN_ZEROEXPORT*/
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,6 @@ enum class zeroExportState : uint8_t {
|
||||||
SETREBOOT,
|
SETREBOOT,
|
||||||
SETPOWER,
|
SETPOWER,
|
||||||
SETLIMIT,
|
SETLIMIT,
|
||||||
PUBLISH,
|
|
||||||
EMERGENCY,
|
EMERGENCY,
|
||||||
FINISH,
|
FINISH,
|
||||||
ERROR
|
ERROR
|
||||||
|
@ -270,16 +269,16 @@ typedef struct {
|
||||||
int32_t power;
|
int32_t power;
|
||||||
int32_t limit;
|
int32_t limit;
|
||||||
int32_t limitNew;
|
int32_t limitNew;
|
||||||
uint8_t waitLimitAck;
|
uint8_t waitAckSetLimit;
|
||||||
uint8_t waitPowerAck;
|
uint8_t waitAckSetPower;
|
||||||
uint8_t waitRebootAck;
|
uint8_t waitAckSetReboot;
|
||||||
unsigned long limitTsp;
|
unsigned long limitTsp;
|
||||||
float dcVoltage;
|
|
||||||
bool state;
|
bool state;
|
||||||
//
|
//
|
||||||
int8_t doReboot;
|
int8_t doReboot;
|
||||||
int8_t doPower;
|
int8_t doPower;
|
||||||
int8_t doLimit;
|
int8_t doLimit;
|
||||||
|
float dcVoltage;
|
||||||
} zeroExportGroupInverter_t;
|
} zeroExportGroupInverter_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -711,12 +710,13 @@ class settings {
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin = 10;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin = 10;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax = 600;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax = 600;
|
||||||
//
|
//
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitLimitAck = false;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitAckSetLimit = false;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitPowerAck = false;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitAckSetPower = false;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitRebootAck = false;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitAckSetReboot = false;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].doReboot = -1;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].doReboot = -1;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].doPower = -1;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].doPower = -1;
|
||||||
mCfg.plugin.zeroExport.groups[group].inverters[inv].doLimit = -1;
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].doLimit = -1;
|
||||||
|
mCfg.plugin.zeroExport.groups[group].inverters[inv].dcVoltage = 0;
|
||||||
}
|
}
|
||||||
// Battery
|
// Battery
|
||||||
mCfg.plugin.zeroExport.groups[group].battEnabled = false;
|
mCfg.plugin.zeroExport.groups[group].battEnabled = false;
|
||||||
|
@ -734,7 +734,7 @@ class settings {
|
||||||
mCfg.plugin.zeroExport.groups[group].state = zeroExportState::INIT;
|
mCfg.plugin.zeroExport.groups[group].state = zeroExportState::INIT;
|
||||||
mCfg.plugin.zeroExport.groups[group].lastRun = 0;
|
mCfg.plugin.zeroExport.groups[group].lastRun = 0;
|
||||||
mCfg.plugin.zeroExport.groups[group].lastRefresh = 0;
|
mCfg.plugin.zeroExport.groups[group].lastRefresh = 0;
|
||||||
mCfg.plugin.zeroExport.groups[group].wait = 0;
|
mCfg.plugin.zeroExport.groups[group].wait = 60000;
|
||||||
mCfg.plugin.zeroExport.groups[group].pm_P = 0;
|
mCfg.plugin.zeroExport.groups[group].pm_P = 0;
|
||||||
mCfg.plugin.zeroExport.groups[group].pm_P1 = 0;
|
mCfg.plugin.zeroExport.groups[group].pm_P1 = 0;
|
||||||
mCfg.plugin.zeroExport.groups[group].pm_P2 = 0;
|
mCfg.plugin.zeroExport.groups[group].pm_P2 = 0;
|
||||||
|
|
|
@ -26,6 +26,23 @@ Abfrage:
|
||||||
Ergebnis:
|
Ergebnis:
|
||||||
{"ble":{},"cloud":{"connected":true},"em:0":{"id":0,"a_current":1.269,"a_voltage":228.5,"a_act_power":239.8,"a_aprt_power":289.7,"a_pf":0.86,"a_freq":50.0,"b_current":0.348,"b_voltage":227.5,"b_act_power":24.7,"b_aprt_power":79.0,"b_pf":0.58,"b_freq":50.0,"c_current":0.378,"c_voltage":228.5,"c_act_power":42.3,"c_aprt_power":86.3,"c_pf":0.66,"c_freq":50.0,"n_current":null,"total_current":1.995,"total_act_power":306.811,"total_aprt_power":455.018, "user_calibrated_phase":[]},"emdata:0":{"id":0,"a_total_act_energy":648103.86,"a_total_act_ret_energy":0.00,"b_total_act_energy":142793.47,"b_total_act_ret_energy":171396.02,"c_total_act_energy":493778.01,"c_total_act_ret_energy":0.00,"total_act":1284675.34, "total_act_ret":171396.02},"eth":{"ip":null},"modbus":{},"mqtt":{"connected":false},"script:1":{"id":1,"running":true,"mem_used":1302,"mem_peak":3094,"mem_free":23898},"sys":{"mac":"3CE90E6EBE5C","restart_required":false,"time":"18:09","unixtime":1712074162,"uptime":3180551,"ram_size":240004,"ram_free":96584,"fs_size":524288,"fs_free":176128,"cfg_rev":23,"kvs_rev":9104,"schedule_rev":0,"webhook_rev":0,"available_updates":{},"reset_reason":3},"temperature:0":{"id": 0,"tC":46.2, "tF":115.1},"wifi":{"sta_ip":"192.168.0.69","status":"got ip","ssid":"Riker","rssi":-70},"ws":{"connected":false}}
|
{"ble":{},"cloud":{"connected":true},"em:0":{"id":0,"a_current":1.269,"a_voltage":228.5,"a_act_power":239.8,"a_aprt_power":289.7,"a_pf":0.86,"a_freq":50.0,"b_current":0.348,"b_voltage":227.5,"b_act_power":24.7,"b_aprt_power":79.0,"b_pf":0.58,"b_freq":50.0,"c_current":0.378,"c_voltage":228.5,"c_act_power":42.3,"c_aprt_power":86.3,"c_pf":0.66,"c_freq":50.0,"n_current":null,"total_current":1.995,"total_act_power":306.811,"total_aprt_power":455.018, "user_calibrated_phase":[]},"emdata:0":{"id":0,"a_total_act_energy":648103.86,"a_total_act_ret_energy":0.00,"b_total_act_energy":142793.47,"b_total_act_ret_energy":171396.02,"c_total_act_energy":493778.01,"c_total_act_ret_energy":0.00,"total_act":1284675.34, "total_act_ret":171396.02},"eth":{"ip":null},"modbus":{},"mqtt":{"connected":false},"script:1":{"id":1,"running":true,"mem_used":1302,"mem_peak":3094,"mem_free":23898},"sys":{"mac":"3CE90E6EBE5C","restart_required":false,"time":"18:09","unixtime":1712074162,"uptime":3180551,"ram_size":240004,"ram_free":96584,"fs_size":524288,"fs_free":176128,"cfg_rev":23,"kvs_rev":9104,"schedule_rev":0,"webhook_rev":0,"available_updates":{},"reset_reason":3},"temperature:0":{"id": 0,"tC":46.2, "tF":115.1},"wifi":{"sta_ip":"192.168.0.69","status":"got ip","ssid":"Riker","rssi":-70},"ws":{"connected":false}}
|
||||||
|
|
||||||
|
Shelly PM Mini Gen3
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Stand: 04.04.2024
|
||||||
|
|
||||||
|
Abfrage:
|
||||||
|
rpc/PM1.GetStatus?id=0
|
||||||
|
|
||||||
|
Ergebnis:
|
||||||
|
{"id":0, "voltage":226.0, "current":0.384, "apower":-55.0 ,"freq":50.0,"aenergy":{"total":11755.618,"by_minute":[1063.082,1700.931,1275.698],"minute_ts":1712248200},"ret_aenergy":{"total":10973.555,"by_minute":[1063.082,1700.931,1275.698],"minute_ts":1712248200}}
|
||||||
|
|
||||||
|
Abfrage:
|
||||||
|
rpc/Shelly.GetStatus
|
||||||
|
|
||||||
|
Ergebnis:
|
||||||
|
{"ble":{},"cloud":{"connected":true},"mqtt":{"connected":false},"pm1:0":{"id":0, "voltage":228.5, "current":0.451, "apower":-67.1 ,"freq":50.1,"aenergy":{"total":11754.555,"by_minute":[1700.931,1275.698,1913.547],"minute_ts":1712248140},"ret_aenergy":{"total":10972.492,"by_minute":[1700.931,1275.698,1913.547],"minute_ts":1712248140}},"sys":{"mac":"ECDA3BC63CC8","restart_required":false,"time":"18:29","unixtime":1712248162,"uptime":13723,"ram_size":260764,"ram_free":146460,"fs_size":1048576,"fs_free":729088,"cfg_rev":11,"kvs_rev":2,"schedule_rev":0,"webhook_rev":0,"available_updates":{},"reset_reason":1},"wifi":{"sta_ip":"192.168.0.57","status":"got ip","ssid":"Riker","rssi":-30},"ws":{"connected":false}}
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Tasmota
|
Tasmota
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue