Rowing machine with 2 reed switches

I have a rowing machine and it uses Reed switches to detect a spinning wheel via magnets. There are two Reed switches side-by-side, so you can determine the direction of the wheel. With these reed switches you can calculate speed, number of rotations per stroke, and direction of stroke.

I linked both reed switches into ESPHome via platform: pulse_counter. How can I now start identifying strokes. Let’s assume a stroke required 4 rotations and the reed switches send A and B respectively when they get magnetized. Then a stroke would look like: B.A…|…A.B…A.B…A.B…A.B…|…B.A
I was wondering if I could use ESPHome to identify strokes, rotations within the stroke, and time duration of the stroke. Then send that information to Home Assistant so I can track the training on my rowing device and even compare with others.

1 Like

I found this GitHub - GrizzlyBuilds/Rownin: An example of a rowing machine interacting with a Unity game via an Arduino
But would prefer to implement it with ESPHome on an ESP32 board and home assistant as database.

Some random ideas which may or may not be useful…

Create a “digital signal” from the A and B (high and low) and then use other components to process that.

Create binary sensors and use on_multi_click to process it.

That’s all I’ve got…