Detect when bread machine is done

read this topic, it is very similar and works fine: