Open phol opened 5 months ago
I just noticed this feature has been implemented with commit 6e607f7f67a535078a337681a249a82b316876c7, "Feature: Add option to clear eventlog at midnight".
Thanks @tbnobody. I'll try to start working on proper event logging in OpenDTU logger soon. I'm currently also working on creating a Home Assistant integration for OpenDTU logger.
If that's ok, I'll keep this issue open for now. I'll close it once I've implemented events tracking, so that people following along are kept up to date about when it's ready.
Is your feature request related to a problem? Please describe.
After our discussion in #1800, in which we discussed the issue of inverter events not containing a date, I have tried to create an analysis of the issue of event timestamps. It is, in a way, similar to #1857, in that this is a problem of how state should be handled by OpenDTU or downstream tools. In OpenDTU Logger, I would like to implement a solution for tracking events in the following way:
data_age
=0
andevents
=1
.data_age
=0
andevents
=1
happens againevents
counter will increase every time a new event occurs./api/eventlog/status?inv=11418186xxxx
endpoint.start_time
andend_time
timestamps.Theoretically, this should work, as, according to @tbnobody in #1800, the inverter resets events at midnight. However, OpenDTU keeps track of inverter events in the web interface, even after midnight / disconnection, until next startup of the inverter. This makes it a bit more troublesome to implement this.
Describe the solution you'd like
Create a toggle for "reset events retrieved from the web API at midnight", resulting in an empty response from the
/api/eventlog/status?inv=xxxx
web API until next startup.Another approach would be to create a toggle for "reset events web API endpoint after inverter restart",
Describe alternatives you've considered
Alternatively, if @tbnobody is open to implementing feature request #1845
[serial]/events/messages
for each inverter with a JSON array ofstart_time
,end_time
,message_ID
,message
with all messages.events
counter increases.[serial]/events/startup_dates
containing the startup datesdata_age
=0
andevents
=1
.Additional context
Please also let me know if I'm missing something in this analysis, or tell me why this wouldn't work. I'm open to hearing your constructive criticisms :) .