Time series documentation
-
Is the current manual (incl. examples) up to date with how retention value is handled in time series configuration? Referring to this post
@tunnus Not entirely. I need to spend some time on that. As the post suggested, comment out or remove your
retentionconfiguration value. It will be computed fromintervalanddepth.Simple moving average:
- id: temp_sma name: "Outdoor Temperature Average" capabilities: value_sensor: attributes: value: model: time series entity: "weather>home" attribute: "wx.temperature" aggregate: sma interval: 60 # minutes depth: 5 precision: 2 primary_attribute: value_sensor.value type: ValueSensorRate:
- id: garage_humidity_rate name: "Garage Humidity Change Rate" capabilities: value_sensor: attributes: value: model: time series entity: "mqtt>garage_handt" attribute: "humidity_sensor.value" aggregate: rate interval: 30 # minutes depth: 3 # last three samples, t-0, t-30, t-60 precision: 2 units: "%/min" primary_attribute: value_sensor.value type: ValueSensor -
@tunnus Not entirely. I need to spend some time on that. As the post suggested, comment out or remove your
retentionconfiguration value. It will be computed fromintervalanddepth.Simple moving average:
- id: temp_sma name: "Outdoor Temperature Average" capabilities: value_sensor: attributes: value: model: time series entity: "weather>home" attribute: "wx.temperature" aggregate: sma interval: 60 # minutes depth: 5 precision: 2 primary_attribute: value_sensor.value type: ValueSensorRate:
- id: garage_humidity_rate name: "Garage Humidity Change Rate" capabilities: value_sensor: attributes: value: model: time series entity: "mqtt>garage_handt" attribute: "humidity_sensor.value" aggregate: rate interval: 30 # minutes depth: 3 # last three samples, t-0, t-30, t-60 precision: 2 units: "%/min" primary_attribute: value_sensor.value type: ValueSensor@toggledbits I cannot get "accel" (acceleration) method to work. It used to work at some point, but at least with the latest builds (now using 25328) I'm getting "null" as a value. Entity values below:
value_sensor.units=null value_sensor.value=null x_virtualentity.last_request_time=null x_virtualentity.request_failures=null x_virtualentity.template=null x_virtualentity.timeseries_aggregate="accel" x_virtualentity.timeseries_debug=[{"time":1766248080000,"value":694},{"time":1766248380000,"value":694},{"time":1766248680000,"value":694},{"time":1766248980000,"value":701},{"time":1766249280000,"value":701},{"time":1766249580000,"value":691},{"time":1766249880000,"value":691},{"time":1766250180000,"value":691},{"time":1766250480000,"value":696},{"time":1766250780000,"value":696},{"time":1766251080000,"value":696},{"time":1766251380000,"value":707},{"time":1766251680000,"value":707}] x_virtualentity.timeseries_depth=null x_virtualentity.timeseries_interval=5 x_virtualentity.timeseries_length=13 x_virtualentity.timeseries_nextsample=1766251980000 x_virtualentity.timeseries_retention=60And configuration from reactor.yaml:
id: virtual9 name: "Netatmo CO2 change rate" capabilities: value_sensor: attributes: value: model: time series entity: "hass>sensor_carbon_dioxide" attribute: "value_sensor.value" interval: 5 aggregate: accel retention: 60 precision: 2 primary_attribute: value_sensor.value type: ValueSensorWhen I tried to drop "retention" and used "depth" instead, got the following error:
Unable to configure time series "value_sensor.value" on "virtual9": missing required configuration 'retention' Controller: VirtualEntityController#virtual Last 15:56:17Looking at the entity values, there's "x_virtualentity.timeseries_depth=null", and if depth is needed in the calculation, that could be the culprit?
-
You have to wait for the time series to fill before acceleration can be computed.
depthis used in the calculation, as well asretention... that's a peculiarity of this aggregate (accel). There need to be at least2*depth-1samples collected before the calculation can occur.I have updated the documentation in the online version just yesterday, so check here.
-
You have to wait for the time series to fill before acceleration can be computed.
depthis used in the calculation, as well asretention... that's a peculiarity of this aggregate (accel). There need to be at least2*depth-1samples collected before the calculation can occur.I have updated the documentation in the online version just yesterday, so check here.
@toggledbits this configuration has been running for hours (retention being 60 min), and still "null"
-
@toggledbits this configuration has been running for hours (retention being 60 min), and still "null"
@tunnus OK. Let's start here: copy-paste the device attributes for that VEC entity (remember to use fenced code block formatting when pasting in reply).
-
@tunnus OK. Let's start here: copy-paste the device attributes for that VEC entity (remember to use fenced code block formatting when pasting in reply).
@toggledbits those were already in my previous post, or was something missing?
-
The previous post shows
depthas null or not provided. Please specify bothdepthandretention, restart and wait at least one full interval, then copy-paste the attributes if a value hasn't been calculated. -
The previous post shows
depthas null or not provided. Please specify bothdepthandretention, restart and wait at least one full interval, then copy-paste the attributes if a value hasn't been calculated.@toggledbits ok, when I get back home I’ll try that. But wasn’t depth optional, i.e. defaults to 2 if not specified?
-
In the version you are using, it is still required; that's the docs leading the released code by a step (sorry). The version you are using also doesn't enforce limits well, so it allows values that could produce no result, or store more data than needed.
For example, given your
retentionof 60 andintervalof 5, there would ber/i+1 = 13samples in the series. But if you specifydepthof 2, then only the most recent2d-1 = 3samples are considered... the other 10 samples don't contribute to the result value. Adepthof 7 would be the best match for the givenintervalandretention(just mathematically, ignoring your semantic goals).









