Best way to sense 110V

I’m currently using an opto-sensor hooked to the Rpi GPIO pins to know whether a plug has 110V or not. The GPIO option has now been deprecated so I’m looking for a new way. The plug is only 3 feet away from my Rpi. I need something simple and reliable. I know I can just hook a D1 mini up to the opto-sensor and use ESPhome, but I’m curious if there is a better way that I’m not thinking of.

There is third party support for GPIO:

1 Like