WLED (on ESP8266) + IFTTT + Google Assistant

by tronicsmasta in Circuits > LEDs

15766 Views, 11 Favorites, 0 Comments

WLED (on ESP8266) + IFTTT + Google Assistant

tutorial.png

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

Open Ports on Your Router

PortForward.png
  • 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*

Create IFTTT Trigger W/ Google Assistant

if this.png
google assistant.png
trigger.png

*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.

IFTTT - Setup Google Assistant

Capture2.PNG
  • 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

IFTTT - Webhooks

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

Setup Web Request on IFTTT & Finish

Capture3.PNG
finish.png
  • 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...