From the docs..,
The H parameter defines the Z probe dive height, which is the height above the trigger height from which probing starts. The default is 3mm or 5mm depending on firmware version. You may wish to increase it during initial calibration. When using mesh bed compensation or running G30 commands with specified XY coordinates (for example from the bed.g file), the firmware moves the Z probe to this height above where it expects the bed to be before commencing probing. The maximum depth of probing from this position is twice the dive height.
I think you'll find on straight G30 Z home, the dive height is ignored as the height is unknown.
Otherwise you would never be able to home from any height.
About the best you can do is check for typical errors before you start using the object model.
I use this macro which is called before any Z homing or bed leveling
check BL Touch var probeOK = true if sensors.probes[0].value[0]=1000 ; if probe is in error state set var.probeOK = false echo "Probe in error state- resetting" M280 P0 S160 ; reset BL Touch G4 S0.5 if state.gpOut[0].pwm < 0.05 set var.probeOK = false echo "Probe is already deployed - retracting" M98 P"0:/sys/retractprobe.g" G4 S0.5 if sensors.endstops[2].triggered set var.probeOK = false echo "Probe is already triggered - resetting" M280 P0 S160 ; reset BL Touch G4 S0.5I also use this check in my homeall.g to cancel the print if any errors occur during homing
Any successful command should return a value of 0
Outside that, you'd have to have a secondary switch, pressure sensor or similar attached I'd think.