3

I'm using a Wemos mini, to switch on the light.

I'm trying to figure out how to combine IFTTT and Sunset and Sunrise from Weather underground to trigger the lights ON.

All examples I find, is how ESP triggers the IFTTT (using IFTTTMaker) but not the other way around, meaning ESP get triggered from IFTTT service.

3

If you want to send a "then that" trigger to your esp8266, you can use a webhook.


However, you need to do some preparations on your home network:

  • You need to have a webserver running on your esp8266.
  • You need to enable port forwarding on your router for one port to be forwarded to your esp8266.
  • You need to know your public facing IP-address or you need to use a DynDNS service.
  • You need to be aware about the security implications of opening a public facing port and forwarding this to your esp8266.

Here is what you then need to enter into the ifttt webhook action fields:

  • URL: enter your public facing IP-address (including port that is forwarded to the esp8266) or your dynDNS address.
  • Method/Content Type/Body: feel free to choose.

An example for a simple http call:

http://yourexternalip:yourport/msg?switch=0

Here is what you need to implement on your esp8266:

On the esp8266 you need to have the webserver check for a http request as configured in your webhook and react according to your wishes.

| improve this answer | |
  • Can you please share a code? – Guy . D Nov 1 '19 at 5:41
  • I don't have any own tested code that I could share, but maybe this tutorial about esp8266 as webserver could be helpful: tttapa.github.io/ESP8266/… – oh.dae.su Nov 1 '19 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.