I have a zigbee door sensor. But there is a configuration that I cannot do.
I intend that, when I ask to turn on a lamp, the lamp will only turn on if the sensor is closed.
But if I close the door later, the lamp won’t light up.
In short, if the sensor is closed when I ask the lamp to turn on, it turns on. If I ask to turn on the lamp when the sensor is open, the lamp does not light up, but it also cannot light up if I close the sensor. The sensor must act as a brake and not a trigger
Do you have a device that can serve eWeLink cube (iHost or NS Panel Pro I think) or home assistant?
Of an IFTTT/Apilio subscription?
Essentially you need somewhere to store the data as to whether the door is open or closed.
I think you need an Apilio account in order to store the information about the window, but I haven’t used IFTTT in a while (since it stopped being free).
iFTTT is generally too simple to do what you want, or atleast it used to be.
This can be achieved, for example, like this…
This model works by performing a trigger action on the Alexa side, such as a webhook call to Sequematic.
We add our ewelink account on Sequematic to pair and operate Sonoff devices.
We operate two functions on Sequematic. One sequence and one Variable.
The sequence has a trigger in the form of listening to a webhook call from Alexa.
Then it performs the action of turning on the device according to the settings you set.
This sequence also has a variable that takes a value of 0 or 1 for the O/C door status.
The sensor position status is transferred via a webhook call to the Sequematic Door function from ewelink web.
This function is changed by sending the appropriate webhook call from ewelink.
There must be two scenes on ewelink web for the sensor and its two states.
In this way, Alexa initiates a task that will execute the command to turn on the device, but only if the value of the sensor status is closed.
The sensor status is continuously transmitted every time it changes. There is no sequence locking effect. If the entire sequence is initiated when the door is open, the device simply will not start. If you close the door and initiate the sequence again, the device will start this time. The whole thing also does not have an echo function, which means that the command to turn on the device will not be carried out just because you close the door.
Of course, you can add such things to the whole, but that’s another story.