Trying to code a Arduino Bluetooth with relay to turn on/off automatically

So no data is being sent? Only Bluetooth connection status is important?

I have never used an HC-05 myself, but this page shows that the status led on the module is connected to pin 6. Can you tell when the HC-05 is connected by the way the led blinks?

Blink once in 2 sec: Module has entered Command Mode
Repeated Blinking: Waiting for connection in Data Mode
Blink twice in 1 sec: Connection successful in Data Mode

If you can, perhaps you can connect pin 6 to an Arduino input and write some code to interpret the signal and control the relay.