The supply to the ic 555 circuit should be from the battery and the supply to the changeover circuit should be from an ac dc adapter.
Changeover relay circuit.
Ups relay changeover circuit.
This could be used for switching over the output from ac mains to inverter mains during inappropriate voltage conditions.
The pole of the relay will connect with the ground line which must be common to the changeover circuit and the ic 555 circuit both.
A polarity controlled relay needs changeover switches or an h bridge drive circuit to control it.
The relay may be less expensive than other types but this is partly offset by the increased costs in the external circuit.
The circuit diagram shown here is of a automatic changeover switch using ic ltc4412 from linear technologies.
The next concept makes an attempt to create a simple relay changeover circuit with zero crossing detector which may be used in inverter or ups changeover applications.
In another type a ratchet relay has a ratchet mechanism that holds the contacts closed after the coil is momentarily energized.