Skip to content

Stateful timeseries#1980

Open
townsen wants to merge 9 commits intoemoncms:masterfrom
townsen:stateful_timeseries
Open

Stateful timeseries#1980
townsen wants to merge 9 commits intoemoncms:masterfrom
townsen:stateful_timeseries

Conversation

@townsen
Copy link
Copy Markdown
Contributor

@townsen townsen commented Jan 29, 2026

Making a PHPTimeSeries feed Stateful

The TimeSeries feeds in EmonCMS contain datapoints at irregular time intervals. When used
for graphing the values of those feeds at times within these intervals is usually 'null'
(unless by chance a datapoint exists within the interval). However when such a
TimeSeries represents the state of a system or a tariff cost the value at any point in
time is the most recent datapoint, even if that falls before the interval.

To help solve these two related problems we introduce four new Virtual Feed processes.

See the file STATEFUL_TIMESERIES.md for a full description

With these features you can create feeds that represent point-in-time tariff changes and graph your energy cost over time including standing charges and accurately reflected costs over long periods. There is a small limitation discussed in the document which would require more significant changes to alleviate. This is a start.

* Document in DEBUG.md
* Use HTTP API to update tariff data inputs
* More documentation about using stateful timeseries for costs
  and standing charges

* Use PHP DateInterval specifications for standing charge process
@townsen townsen force-pushed the stateful_timeseries branch from 98748b8 to 23ada1d Compare February 1, 2026 16:03
* Tests on PHP7.4 failing due to use of named parameters
* Keep the test happy even though precedence of the operators
  is explicitly defined in
  https://www.php.net/manual/en/language.operators.precedence.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant