Homeassistant Recorder lacks continous recording for binary sensor with low sample rate

This solution seemed to work for the poster (same issue):