WLED (on ESP8266) + IFTTT + Google Assistant

Introduction: WLED (on ESP8266) + IFTTT + Google Assistant

This tutorial will get you started using IFTTT and Google Assistant for WLED on an ESP8266.

To setup your WLED & ESP8266, follow this guide on tynick:

https://tynick.com/blog/11-03-2019/getting-started...

Shout out to Aircookie for such great software!
https://github.com/Aircoookie
https://github.com/Aircoookie/WLED
https://github.com/Aircoookie/WLED-App

Supplies

WLED running an ESP8266, nodeMCU, or similar.
IFTTT Account
Google Assistant and/or Google Home Devices

Step 1: Open Ports on Your Router

  • In order for IFTTT to access your ESP8266, you need to open a port to the outside world.
  • Your WLED app will tell you what the internal IP address is for your ESP8266.
  • Choose a none standard port for the outside (ie. 20015, 32265 etc) and port 80 on the internal port.
  • Please refer to your routers instructions on setting up port forwarding.
  • *It is not recommended to use the default port 80 open to the outside world*

Step 2: Create IFTTT Trigger W/ Google Assistant

*Note: IFTTT will prompt you to link your Google Account and give permissions for IFTTT*

  • Sign up with IFTTT on IFTTT.com
  • Click Create in the top right corner.
  • Click "If This (Add)" with black background.
  • Search for "Google Assistant" and click "Google Assistant"
  • Click "Say a simple phrase" with black background.

Step 3: IFTTT - Setup Google Assistant

  • Under "What do you want to say?"
    • Enter the command you would say after "OK, Google..."
      Example: Enter "Turn on the moon" if your phrase was "OK, Google. Turn on the moon."

  • Under "What's another way to say it? (optional)”
    • Enter a second command you would say after "OK, Google...”
      Example: Enter "moon on" if your phrase was "OK, Google. Moon on."

  • Under "And another way? (optional)”
    • Enter a second command you would say after "OK, Google...”
      Example: Enter "Turn on the moon" if your phrase was "OK, Google. Turn on the moon."

  • Under “What do you want the Assistant to say in response?”
    • Enter what you want Google Assistant to say to you.
      Example: “OK. Done” or “Got it” or “Turning on the moon”
  • Choose your language.
  • Click “Create trigger

Step 4: IFTTT - Webhooks

  • Click Then That (Add) with Black background
  • Search for "Webhooks" and click "Webhooks"
  • Click "Make a web request"

Step 5: Setup Web Request on IFTTT & Finish

    • For URL, enter [External IP Address] : [Port] /win [options for the trigger]
    • Example: To turn the LED's on and set color to white:
      [External IP Address]:[Port]/win&T=1&A=128&R=255&G=255&B=255
      • Just keep appending your GET string with &{parameter}={value}
    • For "Method", choose "GET"
    • For "Content Type", choose "application/x-www-form-urlencoded"
    • Body an remain blank.
    • Click "Create Action" button.
    • Click Continue
    • Click Finish.
    • After IFTTT says "Connected", try your new phrase by saying "OK, Google. [new trigger phrase]"

    Example explanation & parameters (FYI, parameters are case sensitive. 't' is not the same as 'T')
    Set [External IP Address] as your external ipv4 (ie 12.34.56.789)
    Set [Port] number from Port Forwarding step after semicolon (ie :28956)
    add /win after the port (ie :28956/win)
    &T=1 || T means Toggle || 0(off), 1(on), 2(toggle on/off)
    &A=128 || A means Brightness || value 0-255 (128 = 50% brightness)
    &R=255 || R means Red Channel || value 0-255
    &G=255 || G means Green Channel || value 0-255
    &B=255 || B means Blue Channel || value 0-255

    See more parameter's on Aircookie's Wiki including presets and LED effects...
    https://github.com/Aircoookie/WLED/wiki/HTTP-reque...

    Be the First to Share

      Recommendations

      • New Year, New Skill Student Design Challenge

        New Year, New Skill Student Design Challenge
      • Anything Goes Contest 2021

        Anything Goes Contest 2021
      • Jewelry Challenge

        Jewelry Challenge

      6 Comments

      0
      njozsef
      njozsef

      6 weeks ago

      Thanks for sharing

      0
      ctos3900
      ctos3900

      10 months ago

      To make it work for me I had to change some settings such as:
      in ifttt I changed the content type to application/JSON
      furthermore, before the external IP address, I had to put HTTP:// or as a full example
      HTTP://[External IP Address]:[Port]/win&T=1&A=128&R=255&G=255&B=255
      otherwise very good tutorial,
      hope this helps

      0
      aidrod101
      aidrod101

      Question 1 year ago

      How do I find out the ipv4 ?

      0
      aidrod101
      aidrod101

      1 year ago

      How to I get the external IP address for my device?

      0
      tronicsmasta
      tronicsmasta

      Reply 1 year ago

      Glad it was helpful!