Convert a Battery-powered Sensor to Mains?

Here is another option: