06.06.2018, 13:41
Hi,
I'd like to log the daily energy production (kWh) of my solar inverter.
I created a scheduled script running once a day. This script reads the energy production of the previous day from the inverter.
Is it possible to save daily data consisting of a timestamp and a value?
I tried to save it with the following script, but obviously the value of 'pv' gets overriden every time.
Can data be appended with the storage object? Or how could this be accomplished?
The goal of this logging is to produce bar charts later on.
thanks!
Valentin
I'd like to log the daily energy production (kWh) of my solar inverter.
I created a scheduled script running once a day. This script reads the energy production of the previous day from the inverter.
Is it possible to save daily data consisting of a timestamp and a value?
I tried to save it with the following script, but obviously the value of 'pv' gets overriden every time.
Code:
save = {
["Pac"] = PV_Pac, -- PV_Pac is set to the energy value coming from the inverter
["timestamp"] = os.date('%Y-%m-%d', os.time()-24*60*60) -- yesterday's timestamp
}
result = storage.set('pv', save)
Can data be appended with the storage object? Or how could this be accomplished?
The goal of this logging is to produce bar charts later on.
thanks!
Valentin