Several of my Z-Wave temperature and humidity sensors recently had their batteries die, but the last reported temperature continued to be shown in the interface long after the data was no longer accurate. To be clear, these particular devices update with such precision that the history chart never shows anything that resembles a straight line while they are working, but the history charts were showing straight lines for well over 24 hours before I realized the batteries were dead. I have (hopefully) addressed my dead battery oversight separately using an automation, but I’d prefer that my dashboards and historical charts better reflect reality whenever possible.
State histories show blank space when the entities are unavailable and some graph histories do as well, but I am under the impression from Log state 'unavailable' as -1 (found via search before posting this) that this behavior isn’t broadly consistent.
In the case of Z-Wave battery devices, Z-Wave JS reasonably assumes the devices are asleep and have no change to report, but information on when the last report was provided is available; this may be the case for some other systems as well. I also understand that HA retains values through power failures and reboots as well, which is convenient if not beneficial. However, I suspect most entities in HA could have adjustable timeouts with reasonably sane defaults after which the data could be marked as unavailable (or perhaps stale; it could even be shown in dashboards while stale, but with an indicator that it is stale and with a history record update to have it stop charting until it is refreshed). While I’m not too concerned with exactly how this is achieved, I do believe it should be done at the HA level in order to provide consistent behavior across the various integrations that we all use.