Short log: allow 14/30 days (opt-in) and keep a database-set value in the settings page

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
kimhav
Posts: 155
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Short log: allow 14/30 days (opt-in) and keep a database-set value in the settings page

Post by kimhav »

Short Log Sensors is limited to 1–7 days in Setup. This was discussed in #920 (2016) and PR #2191 (2018), and the advice was to set 5MinuteHistoryDays directly in the database at your own risk.

Two things have changed since then:
  1. *Many installations now run on SSD/NVMe (for example a Pi 5). On my system with 187 short-log devices, the short log grows about 2.8 MB/day, so 30 days is about 85 MB in total. That is small for current hardware.
  2. The database workaround is fragile. If 5MinuteHistoryDays is set to 30, the Settings page shows an empty Short Log field. Saving any setting can then overwrite it and silently delete the history.
Proposal:
  • The Settings page shows and keeps any stored value (bug fix, no behaviour change for others).
  • Add opt-in 14 and 30 days, with a note about database size.
  • For a range longer than 7 days, the server returns downsampled points (for example 30 min or 1 h), and full 5-minute detail when zooming in. This keeps graph traffic at today's level, which was the main concern in #2191.
Happy to help test or contribute a PR.
Post Reply