VirtualEntityController & time series
-
Is the following config correct?
- id: time_series name: "Out temp" capabilities: temperature_sensor: attributes: value: model: time series entity: "hass>sensor_outdoor_temperature" attribute: "temperature_sensor.value" interval: 5 # minutes retention: 20 # minutes aggregate: wma primary_attribute: temperature_sensor.value type: ValueSensor
Specifically, is "depth" directive needed/mandatory here? Reason I'm asking is that I'm not getting a "final" value in MSR, only debug values are shown:
temperature_sensor.units=null temperature_sensor.value=null x_virtualentity.last_request_time=null x_virtualentity.request_failures=null x_virtualentity.template=null x_virtualentity.timeseries_debug=[{"time":1716537360000,"value":22.1},{"time":1716537660000,"value":22},{"time":1716537960000,"value":22},{"time":1716538260000,"value":21.9},{"time":1716538560000,"value":22}]
-
Let me check it more directly. As I noted in release notes, I haven't tested every aggregate, and
wma
is one that I haven't yet. Also,wma
needs weights, and you haven't specified those. It may just be a problem generating default weights, so try supplying them. -
Let me check it more directly. As I noted in release notes, I haven't tested every aggregate, and
wma
is one that I haven't yet. Also,wma
needs weights, and you haven't specified those. It may just be a problem generating default weights, so try supplying them.@toggledbits I'll experiment this further, but I didn't add weights as manual says in relation to wma: "If no weight array is given, a default set that weights newer values higher than older values is used"
-
Correct. I'm saying to try adding your own, because the default generation may have a bug. With your 5 minute samples and 20 minute span, you'll need 5 weights (for t, t-5, t-10, t-15, t-20). Any can be zero. Aside from all that, I'm looking at this now.
-
Correct. I'm saying to try adding your own, because the default generation may have a bug. With your 5 minute samples and 20 minute span, you'll need 5 weights (for t, t-5, t-10, t-15, t-20). Any can be zero. Aside from all that, I'm looking at this now.
@toggledbits did add the following to the config, but still "temperature_sensor.value" shows null
depth: 4 weight: - 0.50 - 0.35 - 0.10 - 0.05
(I know there are five samples, but "depth" should handle that?)
-
Yup, I'd expect that, based on my testing. All aggregates are working except weighted average.
Two issues, first, a doc error, it should be
wa
for the aggregate name, notwma
.Second issue, computation is botched, so it will give a value, but it's incorrect. But the brain-fade on my part was simple, and you can easily work around it until I get the next build out: add
expr: "value*X"
where X is the depth you've requested (e.g. 4).Next build will fix it, but remember to remove the expression workaround when you install it.
(I know there are five samples, but "depth" should handle that?)
Correct!
-
T toggledbits locked this topic on