Door control

I have a 2 channel relay powering a liner actuator, I have a 30 second off control for both opening and closing the door but I need to create a rule that the door can’t open unless it’s already been closed is this possible or is it possible to create a virtual switch that will open the door on one press and close the door on a second press so that the door doesn’t try to rip itself of its hinges please help this is a important one

Add a contact sensor to the door.


Adding a contact sensor to the door will solve nothing isn’t nothing to do with my questions?

Sounds like a reasonable answer to the problem to me. Sensor reports open so rule prevents relay from activating. Even if the whole thing were standalone a simple magnetic reed switch can be installed to prevent the relay from activating.

Unless there's more to your problem than you've disclosed.

EDIT: Since we are dealing with high force mechanical actuators I personally would not trust a rule for this. Better to install a hardwired cutoff (ie the reed switch) to lockout the whole thing.


I will have a play with this later, I think I will try to add a virtual switch with off being to close the door and on being to open the door it should work to only provide the function to open only when it has been closed. I am not sure how to use a contact sensor to only open when it’s closed even tho that will provide a better automation as it would have to be fully closed to be able to open again

1 Like

Also a hard wired normally open or closed cut out switch will only cut the power when fully closed not the function I need

In rule machine you can use the "required expression" option to only enable the door to be 'openable' if the contact sensor is closed. Ie if you have a trigger to open the door via a rule (eg using a push button), the trigger will not run unless the door is closed.

As for a lockout the reed switch should only prevent the button from triggering the opening relay, not cut power to the system.


So if I add a contact and do required expression on the contact sensor to be closed that will fix it? I have a spare aqara contact sensor I can use for this. Will try later. It would be a better automation with the contact sensor

I might suggest you try writing the rule using virtual sensors and switches to make sure you get the logic right before running a rule that could take your door off.


Sorry my answer was so brief - it was late at night, and I thought my (too brief) answer would get you where you are now.


Also, I didn't see it was your first post. Welcome to the forum!


Tried adding a contact sensor yesterday, think I have bigger problems now lol as I can’t get things to pair and respond at the moment. Had a few late nights hopefully when I get back today all will be working, bought a sonoff zigbee contact sensor too that will arrive tomorrow just to see if my aqara sensors out at fault