Due to a mechanical failure we had a high number of door switch operations (O(10k)). This slowed the query down too much. Maybe just LIMIT to 1000 or so? Look at other queries for similar issues.
Also consider "debouncing" switches for several seconds.
It also seems that the result is truncated (example: 1w back from 2019-03-27 ~09:00).
Due to a mechanical failure we had a high number of door switch operations (O(10k)). This slowed the query down too much. Maybe just LIMIT to 1000 or so? Look at other queries for similar issues.
Also consider "debouncing" switches for several seconds.
It also seems that the result is truncated (example: 1w back from 2019-03-27 ~09:00).