The above circuit diagram is the connection to automatically changeover from main supply to the inverter supply. Which is done using the 2 relay, one SPDT it has the single common terminal (movable arm) and the DPDT has the 2 common terminals. Firstly what is an relay , basically relay is the switch which switches from NO to NC terminal. When the common is given some supply but the coil terminal are not, the NC (Normally closed) terminal will be active and the NO terminal will be deactive .only the supply is given to common terminal and also the coil terminal is having some supply then the terminal will change from NC to NC (Normally opened) because of the magnetisation.
So this concept of switching of the pins are used to switch between the AC main to Inverter supply automatically.
Consider the above circuit diagram so it that to check whether the AC main supply is ON or OFF the DC power supply is used which is connect to the charger to convert it to DC supply. The first the SPDT relay is used to know if AC main is ON or OFF the DC input of the charger is provided to the coil terminal of the SPDT relay and the positive terminal of the battery is connected to the common terminal. If the AC main is on then the coil will produce magnetic field and the NO will be active so the charger will charge the battery. And the inverter will be disconnected from AC main.
Similarly the DPDT relay is used the supply of charger is provided to the DPDT relay if the supply if present then both the terminal (NO) of DPDT is active and which is the AC main Supply. And if the supply is of then both will switch to NC and then it will use the inverter supply and if main supply comes back then automatically the inverter supply is disconnected.
So to know when the inverter is on / off we can use a micro controller (to send a message to user the inverter is on , LED can be used which will be on when the inverter is , and the buzzer which will make sound when the main to inverter is switched) or we can connect a bulb (like 0v red colour) bulb which will be on when the inverter is ON.