Netgalleria / arska-node

Smart power manager for optimized solar power usage as well as greenest and cheapest energy purchase
GNU General Public License v3.0
24 stars 1 forks source link

InfluxDB timestamp beginning of period #23

Closed joe-ave closed 1 year ago

joe-ave commented 1 year ago

Hello Olli,

is there a reason to why timestamp of the data sent to InfluxDB is offset by 30 minutes so they are represented in the middle of each hour? I started to use Grafana to build trends and currently I need to use bars with center alignment to have a good representation, if the data instead were timestamped without the offset I could use lines with "step after" interpolation and it would look more like the price graph in Arska. Maybe that also make more sense if you later on want to do calculations, since the price in reality is valid in steps of hours.

//Jonas Grafana graph styles

Olli69 commented 1 year ago

Hi Jonas, The reason why I ended up with that solution is that InfluxData.com did not support "step after" / "step before" interpolations properly. I do not know if there are any fixes yet.

But yes, that is a good point! Let's keep that in mind. We are in the middle of a bigger development step with Arska, so it can take a while before this is fixed. If you have compiled your version, you could probably fix the line in the code - remove " (resolution_secs / 2)" point_period_price.setTime(current_period_start_ts + (resolution_secs / 2)); // middle of the period

joe-ave commented 1 year ago

Hello Olli,

I´ll comment that whole line out since the line above then says the same thing.

This is why I started to use Grafana for the visualisation part since InfluxDB missed some features, the basic stuff for checking data is ok. Grafana also has a cloud solution so no need for installation and I added InfluxDB as datasource from there.

//Jonas

joe-ave commented 1 year ago

hmm, I got the relays to be timestamped every hour but the price is still offset by 30 minutes. I also commented out " + (NETTING_PERIOD_SEC / 2)". I´ll poke around more tomorrow.

//Jonas

Edit:

It strangely solved itself after midnight, now the timestamp is every whole hour. timestamp ok after midnight

//Jonas