For a step-by-step guide, watch the comprehensive tutorial available at the following link: Video
Here is an extract of how to install the Quick Magnetic Sensor: Manual
Below are the essential Smart Chain Counter Code snippets to add to Home Assistant.