Help with mi home automation


thankouv

Members
Dec 7, 2022
1
13
Hi everyone,
I'm trying to make a somewhat complicated automation and I can't seem to make it work.
Basically I want a smart socket to turn on, a few seconds after a sensor is opened but I also want to be able to turn this routine off easily be closing another sensor.
The idea is to have an siren on the smart plug which will go off a few seconds after a door opens but if I get back home, I will close another sensor with a magnet attached on my keys, so the alarm won't go off.

I set up the automation with a 15 sec delay and then a run manual automation for the plug. There is a second automation that when I close the second sensor, the routine with the delay turns off but although it does turn off, the plug still turns on.

I hoped I made my self clear. Not sure I did tbh.

I'd appreciate any help. Thanks.
 
Dear Thankouv,

I seem to have a similar issue. Have you had any luck figuring out how to stop an automation once it has been trigered? I attach my issue that is, as in your case, for a siren through a smart plug.

____________________________
Thank you in advance for any help. I have Xiaomi products sensors etc as an alarm system at home. So I have a manual ARM and Disarm automation that amongst other things sets the smart gateway to away from home on and off respectively.

Since the sound of the alarm is lame I have bought a siren that runs on 230V power so I have plugged it in a Xiaomi smart plug. I have created an automation that once the smart gateway gives an alarm it waits for 4 seconds then activates the smart plug, then wait a minute and deactivate it and again a minute an activate in a small circle so that the siren sounds 3-4 times with intervals (so that the siren does not burn out).

In Disarm command I have added the order to close the automation above. The problem I have is although I do this the automation keeps running until it is completed so although I want the alarm to stop it keeps going off until the automation cycle is completed. Does anyone know how I could solve this problem? I tried to explain it to the best of my abilities although it may be confusing.
______________________
 
Hi, you can do that using a Relay with On/Off status condition and the following automations:

Automation 1 (normaly enable)
If Sensor=Open then Count X seconds
Turn On Relay

Automation 2 (normaly disabled)
If Relay=On then:
- Count 1 second (with me without this it doesn«t work)
- Relay = Off
- Disable Automation 3 (you have save the automation 1st and add this step)

Automation 3 (normaly enable)
If Sensor=Closed then Enable Automation 2

I used a relay that I have commanding a ventilator, there is a short start of the ventilator but then turns of immeddiatly, the relay used was this one https://pt.aliexpress.com/item/1005...L0nFk8Fu&utparam-url=scene:search|query_from:

Not sure if it only works connected to the China server.