Here is the setup for the door opening and closing by turning on the relay.
I still need to set up the rule to sync the virtual door with the the real door if it is opens manually.