meanwhile i use influxdb_v2 and flux in grafana. but the the following settings are very similar in influxdb_v1 when i remember correct (only the query is different).
for visualization of the actors from my underfloor-heating i use the visualization-type “state timeline” and override the value-mappings like
for visualization where to put warmwater solar (automatic / manual mode) i use the visualization-type “time series” (for contact and number items) and override the graph-style (as suggested in the two answers bevore) like
First of thanks to all of you for the quick response
Where I wasn’t clear when I posted my question was that it is not so much about the visualization but rather that I like to have that value in the time series for computation:
The reason is that I have a rule that computes the time since the last change (“how much time has passed since the window/door was opened”. This rule didn’t really work with the persistence method “previous state value time” because the actually transition starting point is missing (see the blue arrow above). The green dot at let’s say 14:05 would compute 14:05 - 10:40 but not 14:05 - 14:00 which is totally wrong.
Note: I am aware that there would be other ways to achieve the same result but I was surprised that it doesn’t work with persistence “previous state value time” due to this missing transition starting point (I took me quite some time to understand why - only when I drew the above picture I started to understand).
I think the lastUpdate method from the persistence extensions should provided that time. The previousState would indeed come with the start time of the previous state.
You could argue that a lastChange method could also be useful to distinguish between update and change. But that does not exist in the persistence extensions.
And that would not give the expected result. Let’s say the current state is 100 and the history is something like 25, 25, 50, 50, 100, 100. The previous state (skipEquals) is then 50 and the timestamp would be when it first changed to 50. However, the timestamp of the last change should be when it changed to 100!
It does work for nextState though.
EDIT: It is even worse, in the example above `.previousState(true).timestamp would return the timestamp of the second 50, and not the timestamp of the first change to 50.