Automation with a smart plug

I need advice or a little help with my problem. I would be grateful!
There are two smart sockets aqara smart plug, each connected to an air conditioner. There is a deye with banks, which powers the entire house in the event of a power outage.
The task is to reduce overall energy consumption. Is it possible to make an automatic system with this socket (the third such aqara smart plug), which will turn off air conditioners in the event of loss of connection to the power grid. Or is another similar socket needed for this, or maybe a completely separate device?

In principle, yes possibly, provided the components of your system have integrations in Home Assistant. There’s a list of integrations here:

If Home Assistant is going to lose power when you lose connection with the grid, that makes things more complicated - on restart it would have to have some means of detecting what the power source was.

You need to do more research - joining the forum is a good start! :grin:

1 Like

There are integrations, I don’t fully understand which ones to use and how to use them)
What integrations can basically allow all this to be done? Because with basic automation I can only do it by turning off the second socket when the first one is turned off (by a button or via ĐťA), but not when there is a loss of electricity, that is, for example, I take the socket out of the network

Thank you for greeting me on the forum. I have a fairly extensive network of different sensors both in the office and at home and I needed to solve this problem.

Hard to comment in the abstract, but it sounds as if you need to identify a device to use as the trigger or condition for the automation. Any device might do.

If Home Assistant is going to lose power when the grid fails, then restart on backup power, I would be looking for a device that was not on backup power. An automation running on startup could turn off the air conditioning if that device was unavailable. If Home Assistant is not going to restart, the automation trigger would simply be that device becoming unavailable.

I’m sure there are devices that monitor for this kind of thing, but they’re outside my experience.