You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
At inverter startup, the websocket emits new data
This, as I understand it, can be verified by the combination of data_age = 0 and events = 1.
This situation is combined with an "Inverter start" message.
Whenever this happens, OpenDTU Logger can store the startup date.
From inverter startup until the combination of data_age = 0 and events = 1 happens again
In the websocket output, the events counter will increase every time a new event occurs.
If an increase happens:
OpenDTU Logger can query the /api/eventlog/status?inv=11418186xxxx endpoint.
OpenDTU Logger can take the startup date + amount of seconds elapsed since then to calculate the start_time and end_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
Add MQTT topic [serial]/events/messages for each inverter with a JSON array of start_time, end_time, message_ID, message with all messages.
Only emit the list of events to this topic when the events counter increases.
Add another topic [serial]/events/startup_dates containing the startup dates
Only update this topic whenever data_age = 0 and events = 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 :) .
The text was updated successfully, but these errors were encountered:
phol
changed the title
[Request] Create a toggle for "reset events retrieved from the web API at midnight", resulting in an empty response until next startup.
[Request] Create a toggle for "reset events retrieved from the web API at midnight", resulting in an empty response until next inverter startup.
Mar 29, 2024
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 :) .
The text was updated successfully, but these errors were encountered: