How to create a sensor

im trying to create a binary sensor out of an entity the entity returns 23 for off and 24 for on but i want to make it an open close sensor it’s a hank or monoprice open close but the built in binary sensor never opens but i found an enity that does register the open close and want to use that