Powering a door/windows sensor with constant power supply?

Did this with a contact sensor and a temp sensor:

Plan to try it try it on an Iris motion sensor over holidays.