addon-node-red icon indicating copy to clipboard operation
addon-node-red copied to clipboard

FR: Get History - allow point in time and future time (forecast).

Open SynoUser-NL opened this issue 4 months ago • 0 comments

Problem/Motivation

Currently the Get History node appears to support only time ranges, where values are then returned in an array or split form. However it would come in very handy at times to be able to look up the value of an entity at a specific time in the past. For forecast type of entities it would be convenient to be able to get the forecasted value at a point of time in the future.

Context for clarity: I’d like my sunscreens to open automatically when rain is imminent. The buienradar_condition sensor will give me that information (state will be either rainy, snowy or lightning), but I’d like to look ahead a couple of minutes to give the screens some time to actually open before the rain starts. Also, since that sensor does not contain the previous value, I’d like to look back in time to see if the value has actually changed compared to 3 minutes ago (for example). Now I’m using a helper to store the previous state data, which obviously works but it is not a very elegant solution.

Expected behavior

N/A

Actual behavior

N/A

Steps to reproduce

N/A

Proposed changes

  1. Be able to specify a point in time (i.e. -3 minutes, -1 hour) and get the value specified at that time.
  2. Be able to specify a positive time (i.e. +3 minutes, + 1 hour) for forecast type of entities.

When getting a point-in-time value, the output can be just a value in msg.payload. Or preferably let the user decide which msg key to store the requested value in.

SynoUser-NL avatar Oct 12 '24 19:10 SynoUser-NL