Yes that can be done quite easily. It may not work as you expect in that with many AC units, especially if it has a remote will not come back on just by applying power. There are ways to handle that as well but that is a another discussion.
It sounds like you are trying to control a window unit AC. While removing / reapplying power are a simple matter with a smart outlet, or smart plug, AND a contact sensor / door and window sensor, you still need to control on / off of the appliance itself. Most Window unit ACs have no sort of intelligence built in, BUT I saw some literally 3 days ago at Walmart, with WiFi integration. G.E. and I think Frigidaire both offer models. The GE models at least have an IFTTT channel that should be pretty easy to set up to work with SmartThings…
On top of that, you will need to remember that once an AC unit stops, there is by necessity some down time to allow pressures to equalize in the system so you don’t blow your compressor by starting up with too much head pressure. So be REALLY sure you want to shut it off, and be patient when it comes back on…
I bought a Fredreich unit that was so called wifi and have basically stopped using it. It was a joke! They say they are coming out with a new one. What would be nice is a wall unit that I can connect an Ecobee to it as I understand Ecobee is coming out with a door sensor option within the next couple of months.
I assume you mean it will conme back on if you plug it in, and If that is the case then it would be a simple setup to have smartthings control a smart plug to turn the unit off and on based on a contact sensor.
If you try to control the air-conditioner just by cutting the current and restoring it, which is essentially the same as pulling the plug out of the wall, you may find that doing this frequently will eventually damage the air conditioner, just as frequent power outages can. It just depends on what cycle the air-conditioners in when the power is cut/restored. So that’s not usually the recommended method.
There are a number of different ways to make an existing air-conditioner smart so that you can turn it on and off gracefully. It just depends on the specific model.
If the air-conditioner already has a remote control, then you are much more likely to be able to make it smart in this way. There are a number of different devices that can do this, but it depends on whether your remote is IR or a radio frequency and the specific device. Different remotes will work with different smart options.
There are also “robot fingers“ that can be used to literally push the buttons on the unit, but that method can get expensive.
I have owned the Frigidaire Wi-Fi air conditioner which works with Alexa, and it has been very reliable and useful for two years now. I can’t speak to any other models, but I’m happy with mine. ( i’m quadriparetic, so I can’t use the handheld remote that came with it.)
You can go ahead with your plan of just plugging it into a smart Outlet, but you might want to check with the air-conditioner manufacturer and see what they recommend and if it can handle that many power outages.
But as far as the rule complexity you describe, yes, that can be done with SmartThings, although you may have to use custom code to accomplish it.
You can also use a Broadlink RM Pro + that will interpret Smarthings commands and translate them into IR signals that are the same as the ones emitted by your Remote Control for the Air Conditioner.
This would be the preferred way as with this setup its as if someone has pointed the remote controller at the air conditioner and pressed the on or off button. The Air Conditioner is setup to respond to these IR commands already and will perform any shutdown or startup routines internally to the air conditioner as needed.
I use this device with great success to turn on and off my cable box and TV.