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.

anonymous2
  • 4,872
  • 3
  • 20
  • 48
guyd
  • 851
  • 8
  • 17

1 Answers1

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.

oh.dae.su
  • 570
  • 1
  • 6
  • 14
  • Can you please share a code? – guyd Nov 01 '19 at 05:41
  • I don't have any own tested code that I could share, but maybe this tutorial about esp8266 as webserver could be helpful: https://tttapa.github.io/ESP8266/Chap10%20-%20Simple%20Web%20Server.html – oh.dae.su Nov 01 '19 at 06:40