diff --git a/src/data/history.ts b/src/data/history.ts index 51f313ec83..216f764b29 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -249,7 +249,9 @@ class HistoryStream { newHistory[entityId] = entityCombinedHistory.concat( streamMessage.states[entityId] ); - if (streamMessage.states[entityId][0] > lastEntityCombinedHistory) { + if ( + streamMessage.states[entityId][0].lu > lastEntityCombinedHistory.lu + ) { // If the history is out of order we have to sort it. newHistory[entityId] = newHistory[entityId].sort( (a, b) => a.lu - b.lu