Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for IFTTT Webhook integration #708

Merged
merged 5 commits into from
Jan 15, 2022

Conversation

KingBain
Copy link
Contributor

@KingBain KingBain commented Jan 8, 2022

IFTTT is an automation and integration platform that has been around for a very long time.

It can integrate with many many services https://ifttt.com/explore
IFTTT has a free and paid tier of user accounts .

In this PR, I copy, pasted, rename and edited the Pushover notification settings to create the IFTTT notification provider.

Can be set in the GUI or via the 610 command
[ESP610]type=IFTTT T1={event} T2={webhooks_key}

You can get these values after you have created an account on IFTTT.com and created an "Make a web request" activity that uses their 'maker' webhook.

Url to directly create one. Can create one here https://ifttt.com/maker_webhooks

Can get your webhook key when you click on the documentation button

image

The integration from ESP3 to IFTTT looks like this :
ESP --> IFTTT

  1. title --> value
  2. message --> value2
  3. ESP3D hostname --> value3

IFTTT will only accept 3 incoming values.

Proof of submit success
ESP3D Dashboard
image

Proof of receipt success
IFTTT Dashboard
image

@KingBain
Copy link
Contributor Author

KingBain commented Jan 8, 2022

also worth mentioning, this is the response from the IFTTT service.
image
hence the wait for response is looking for "Congratulations"

Further proof of working.

Data Flow

3DPrinter --> Marlin2 --> ESP32-01 -->ESP3D --> --> IFTTT --> CallMeBot API -->Cellphone --> WhatApp chat

image

@luc-github
Copy link
Owner

Thank you - I have started to review the code and read the IFTTT documentation, I will feedback tomorrow or this week end as now I am able to test the code on device and with proper internet network

@luc-github
Copy link
Owner

@KingBain for what's app, did you used method suggested by https://www.callmebot.com/blog/whatsapp-messages-from-ifttt/ ?

IFThis =>webhooks
THENThat =>webhooks=>Make a web request 

@KingBain
Copy link
Contributor Author

@KingBain for what's app, did you used method suggested by https://www.callmebot.com/blog/whatsapp-messages-from-ifttt/ ?

IFThis =>webhooks
THENThat =>webhooks=>Make a web request 

yes .

my plan probably next month is to change the process from IFTTT so that I can send commands to some smart outlets based on the outgoing message of the ESP3D and the message handler + smart appliances controller in IFTTT.

So just for right now Ive been using

IFThis =>webhooks
THENThat =>webhooks=>Make a web request

:D

@luc-github luc-github merged commit f80b247 into luc-github:2.1.x Jan 15, 2022
@luc-github
Copy link
Owner

Merged in 2.1.x Wiki updated https://github.com/luc-github/ESP3D/wiki/IFTTT

Thank you

@cyberiano
Copy link

@KingBain and @luc-github awesome work!

The IFTTT integration brings a whole new automation possibilities.

Can you do this similar coding to support Home Assistant webhook?.

https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger

That would be awesome, and i think it will be an easier and faster alternative until you finish the MQTT support (as i read on other issues/requests) for home automation purposes.

IFTTT is cool and can do the job, but it got a few downsides:

  • Has a slower response times
  • Depends 100% on the cloud.
  • It's not entire free

Using Home Assistant webhook:

  • Will be faster
  • Works even without internet connection (because Home Assistant runs on the local network)
  • It's 100% free
  • It's and alternative to MQTT

Another alternative will be a "Custom Webhook" notification. Where you can provide a custom URL and ESP3D make a simple POST request with the values on a json payload.

Thanks!

@luc-github
Copy link
Owner

I would be more in favor of custom webhook, the issue is to fit all data in 3 slots : (not including message content)
Token 1 = 63 chars (hidden in settings)
Token 2 = 63 chars (hidden in settings)
Token extra = 128 chars fully visible

also what the AUTO_NOTIFICATION behaviour should do with such notification ? should be disabled ?
or need to change the content of

#define NOTIFICATION_ESP_ONLINE "Hi, %ESP_NAME% is now online at %ESP_IP%"

which mean the webhook is actually hardcoded which I would like to avoid as much as possible

@luc-github
Copy link
Owner

@all-contributors please add @KingBain for code improvement, new feature

@allcontributors
Copy link
Contributor

@luc-github

I've put up a pull request to add @KingBain! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants