I have equipment that has a DC bus of around 800Vdc. How can I make a circuit to read the voltage value and when there is no voltage on the bus, activate a relay.
I thought about measuring the voltage on the dc bus with an op amp and then using a voltage comparator to activate the relay.
Potential divider to bring the voltage to a manageable level and a comparator is all you need. A few resistors in series to handle the high voltage then one to ground to make the divider and a comparator will do the job, no need for an op-amp. Depending on the relay you might need a current booster (a transistor) to drive its coil.
***
in detail you additionally need to
* define lowest level to activate the output
* define highest level to deactivate the output (bot combined give the hysteresis)
* timing
* expected noise level (to design a suitable filter)