This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Daily logging of produced energy from solar inverter
#1
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.


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
Reply


Messages In This Thread
Daily logging of produced energy from solar inverter - by tintsch - 06.06.2018, 13:41

Forum Jump: