In or Out ?

hammy:
As it's a Dog , could you not train her to operate a switch before she goes out and in ?

For any reliability that'd have to be a switch that the dog must operate before being able to go in or out, or the door won't open.