A datalogger for a solar inverter. Stores data in influxdb and displays it in grafana. Has load diverting capability, to use the inverter's excess power
Found an issue where daily data wasn't being updated. This was if you used the create retention policy from the read me file. This was a command left from some testing and didn't get updated. If you have this issue, try these commands from within influx. Should make autogen the default policy (most things are expecting this), copy any data from huawei_rt (retention policy) into autogen, delete huawei_rt, run the continuous query command to populate any data you missed and update autogen to actually delete old data.
You might want to run fill_daily_blanks.py to fill any blanks
use logger;
ALTER RETENTION POLICY autogen on logger DEFAULT;
select * into logger.autogen.Huawei from logger.huawei_rt.Huawei;
DROP RETENTION POLICY huawei_rt on logger;
SELECT first(M_PExp) AS M_PExp, first(M_PTot) AS M_PTot, first(P_accum) AS P_accum, first(P_daily) AS P_daily, first(P_peak) AS P_peak, mean("M_A-I") AS "M_A-I", mean("M_A-U") AS "M_A-U", mean("M_B-I") AS "M_B-I", mean("M_B-U") AS "M_B-U", mean("M_C-I") AS "M_C-I", mean("M_C-U") AS "M_C-U", mean("U_A-B") AS "U_A-B", mean("η") AS "η", mean(Frequency) AS Frequency, mean(I_A) AS I_A, mean(M_Freq) AS M_Freq, mean(M_PF) AS M_PF, mean(M_U_AB) AS M_U_AB, mean(M_U_BC) AS M_U_BC, mean(M_U_CA) AS M_U_CA, mean(P_active) AS P_active, mean(P_reactive) AS P_reactive, mean(PF) AS PF, mean(PV_In) AS PV_In, mean(PV_P) AS PV_P, mean(PV_Un) AS PV_Un, mean(Temp) AS Temp, mean(U_A) AS U_A, mean(U_B) AS U_B, percentile("M_A-I", 20) AS "M_A-I_p20", percentile("M_A-I", 95) AS "M_A-I_p95", percentile("M_A-U", 20) AS "M_A-U_p20", percentile("M_A-U", 95) AS "M_A-U_p95", percentile("M_B-I", 20) AS "M_B-I_p20", percentile("M_B-I", 95) AS "M_B-I_p95", percentile("M_B-U", 20) AS "M_B-U_p20", percentile("M_B-U", 95) AS "M_B-U_p95", percentile("M_C-I", 20) AS "M_C-I_p20", percentile("M_C-I", 95) AS "M_C-I_p95", percentile("M_C-U", 20) AS "M_C-U_p20", percentile("M_C-U", 95) AS "M_C-U_p95", percentile("U_A-B", 20) AS "U_A-B_p20", percentile("U_A-B", 95) AS "U_A-B_p95", percentile(I_A, 20) AS I_A_p20, percentile(I_A, 95) AS I_A_p95, percentile(M_PF, 20) AS M_PF_p20, percentile(M_PF, 95) AS M_PF_p95, percentile(M_U_AB, 20) AS M_U_AB_p20, percentile(M_U_AB, 95) AS M_U_AB_p95, percentile(M_U_BC, 20) AS M_U_BC_p20, percentile(M_U_BC, 95) AS M_U_BC_p95, percentile(M_U_CA, 20) AS M_U_CA_p20, percentile(M_U_CA, 95) AS M_U_CA_p95, percentile(P_active, 20) AS P_active_p20, percentile(P_active, 95) AS P_active_p95, percentile(P_reactive, 20) AS P_reactive_p20, percentile(P_reactive, 95) AS P_reactive_p95, percentile(PV_In, 20) AS PV_In_p20, percentile(PV_In, 95) AS PV_In_p95, percentile(PV_P, 20) AS PV_P_p20, percentile(PV_P, 95) AS PV_P_p95, percentile(PV_Un, 20) AS PV_Un_p20, percentile(PV_Un, 95) AS PV_Un_p95, percentile(U_A, 20) AS U_A_p20, percentile(U_A, 95) AS U_A_p95, percentile(U_B, 20) AS U_B_p20, percentile(U_B, 95) AS U_B_p95, mean("M_A-P") + 0.000 AS "M_A-P", mean("M_B-P") + 0.000 AS "M_B-P", mean("M_C-P") + 0.000 AS "M_C-P", mean(M_P) + 0.000 AS M_P, mean(M_Pr) + 0.000 AS M_Pr, percentile("M_A-P", 20) + 0.000 AS "M_A-P_p20", percentile("M_A-P", 95) + 0.000 AS "M_A-P_p95", percentile("M_B-P", 20) + 0.000 AS "M_B-P_p20", percentile("M_B-P", 95) + 0.000 AS "M_B-P_p95", percentile("M_C-P", 20) + 0.000 AS "M_C-P_p20", percentile("M_C-P", 95) + 0.000 AS "M_C-P_p95", percentile(M_P, 20) + 0.000 AS M_P_p20, percentile(M_P, 95) + 0.000 AS M_P_p95, percentile(M_Pr, 20) + 0.000 AS M_Pr_p20, percentile(M_Pr, 95) + 0.000 AS M_Pr_p95 INTO logger_ds.autogen.Huawei FROM logger.autogen.Huawei GROUP BY time(5m);
ALTER RETENTION POLICY autogen on logger DURATION 70d REPLICATION 1 SHARD DURATION 15d DEFAULT;
Found an issue where daily data wasn't being updated. This was if you used the create retention policy from the read me file. This was a command left from some testing and didn't get updated. If you have this issue, try these commands from within influx. Should make autogen the default policy (most things are expecting this), copy any data from huawei_rt (retention policy) into autogen, delete huawei_rt, run the continuous query command to populate any data you missed and update autogen to actually delete old data.
You might want to run fill_daily_blanks.py to fill any blanks