I have a use case in a binding (SMHI Weather) where I would need to include UNDEF in a forecast. In essence, some of the values have a special value that represents “N/A”, e.g., for cloud base and top altitude when there are no clouds. But the Item (Number) rejects the TimeSeries unless all states in it are either QuantityType or DecimalType. (The code for this is here: openhab-core/bundles/org.openhab.core/src/main/java/org/openhab/core/library/items/NumberItem.java at a1a92f2dcc0ab5e5f86c14622b0cd1857768af68 · openhab/openhab-core · GitHub)
The alternative approach I can see is to skip adding these values to the TimeSeries but that would mean it will not update the Items state, and instead display an outdated value.
Would it make sense to allow UNDEF (also possibly NULL) in a TimeSeries? If not, is there a good solution to prevent displaying stale values?