Dual nozzle Print head issue

Hi every one

I have a custom dual nozzle print head . i move one nozzle up and down mechanically by having the head slide againt a bum on the side . similar to the ultimaker 3 or 5. for example T0 is fixed and T1 can move up and down .

to add extra safety i have a switch linked with T1.

what i would like to achieve :

when the printer is powered on the switch is checked and if the T1 tool is down to home X and Y then bring the tool up before homing Z

in this way i can ensure that the printer always start with tool T0

i saw that some people use a variable to save witch tool was last active . but so many things can happen a switch can physically check witch tool is active .

thank you for any info idea you might have

any one ? some suggestions ?
i saw in older posts that pins can not be read in macros , is it possible now ?

Best regards
Mr.T