How can I schedule my Sonoff switch to turn off 20 minutes after it is triggered by a temperature? All questions

I have a Sonoff switch set to turn on at 40ºC. I want to turn it off 20 minutes later, or when the temperature reaches 45ºC, whichever comes first. How can I achieve this?

Asked by Anonymous on January 5, 2020, at 8:14am

This is going to require a few components - the eWeLink app to control your Sonoff switch and also IFTTT to integrate eWeLink with Sequematic.

Turn on switch at 40ºC:

For this part of the flow, set up a scene in the eWeLink app.  Use the condition if the temperature is 40ºC then turn on the switch.

Turn off switch at 45ºC:

Also use the eWeLink app for this. Create another scene which turns off the switch when the temperature is 45ºC.

After turning on the switch, wait 20 minutes then turn it off

We're going to use IFTTT to monitor when the switch comes on. It will then pass control over to Sequematic to wait 20 minutes before turning the switch off.

First, create a new Sequence as follows:

  • Trigger: IFTTT webhook
    • Event name: switch_on
    • No parameters
    • After saving this trigger, copy the URL it provides (you'll need this further down when setting up IFTTT)
  • Pause step with duration set to 20 minutes
  • IFTTT webhook call with event name switch_off (make sure you've added your IFTTT key in your user settings)

Now create an IFTTT applet to monitor the state of the switch:

  • Trigger: eWeLink, 1 channel plug turns on
  • Action: webhooks, make a web request to the URL provided when creating the Sequematic trigger above
Finally, create an IFTTT applet to turn the switch off:
  • Trigger: webhook, receive a web request with event name switch_off
  • Action: eWeLink, turn 1 channel plug on/off (select the relevant plug and set 'turn on or off' to off
That should do it. eWeLink will take care of toggling the switch based on the temperature. And then the combination of IFTTT and Sequematic will turn the switch off 20 minutes after it is switched on.

Post a reply

The SEQUEmatic bot is still new and learning. If you don't get the answer you need, just ask to speak with Derek and your chat will be transferred.