Connect a relay with a 9V DC coil between point "A" and common. Break the circuit at point "B" and insert normally-closed contacts of the relay. If AC power is available, the relay actuates and its normally-closed contacts will open, removing power provided by the solar array. If AC power is lost, the relay de-actuates and its normally-closed contacts allow power to be applied from the solar array. If the solar array is not working, then no power is supplied to the router.