Would it be possible either for the developers to create an API for IFTTT or in some other way make
it possible to integrate LM logic with IFTTT in any way.
Hello Sandstrand,
if you have android try Tasker app, I believe it is already possible to use it with LM. Plus it has much more possibilities than IFTTT.
Didn't think too far this time. Tasker will do the trick and I also have Automagic Premium installed on the phone already.
Any quick and easy ways to have a script monitor for a HTML GET/POST (JSON)request? First thing that came to mind was creating my own API
on the secondary http server and then do something, but hoping it will be easier to just use LUA scripts on the main LM
You can use IFTTT in combination with the Maker Channel (bi-directional)
You have to enable the remote services in the controller (see controller manual) to receive commands and we need a script to send commands to IFTTT.
1) Create a Maker recipe with a unique trigger (for this example) "this_is_my_trigger_unique_event"
2) Create inside your recipe a action like: "http://remote:remote@ipadress/cgi-bin/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=0/0/1&value=true" and
select method "get" and select content type "text / plain" body can be left empty. (change remote:remote to your credentials and change ipaddress to your ip address and add a port if needed)
3) Create a event based script to trigger the IFTTT Maker recipe like this:
-- *************************************** START OF SCRIPT ************************************* -- -- *********** If This Then That Maker Channel Trigger Event Version 1.0 Created by Erwin van der Zwart ********* --
-- *************************************** SET PARAMETERS ************************************* --
-- Set your personal secret key from received https://maker.ifttt.com Maker_Secret_Key = 'PUTHEREYOURPERSONALMAKERKEY'
-- Unique trigger event name you have set in the 'Maker' recipe 'This' event Maker_Event_Name = 'this_is_my_trigger_unique_event' -- Have to match your trigger description you have set in the recipe
-- *************************************** END PARAMETERS ************************************* --
local https = require 'ssl.https'
function iftttmaker(Maker_Secret_Key, Maker_Event_Name) local r, c, h, s = https.request{ url = 'https://maker.ifttt.com/trigger/' .. Maker_Event_Name .. '/with/key/' .. Maker_Secret_Key, sink = ltn12.sink.table(resp), protocol = "tlsv1" } return r, c, h, s end
r, c, h, s = iftttmaker(Maker_Secret_Key, Maker_Event_Name)
-- ****************************************** END SCRIPT **************************************** --
07.04.2017, 10:38 (This post was last modified: 07.04.2017, 11:13 by akshaya.mestry.)
Hi Erwin,
I have tried integrating IFTTT with LM using Maker Webhooks and followed your script mentioned above but have not been able to trigger desired action from IFTTT. My applet is getting skipped for some reason. Kindly help.
Hi! Please try using new type of URL for remote services (without /cgi-bin/).
This example was done more than 1 year ago when we use another format for remote services. Here is more info on new type Remote services: http://openrb.com/docs/remote-new.htm
11.08.2018, 18:50 (This post was last modified: 13.08.2018, 20:11 by SERGIO.)
Hi Erwin,
At the step 2) when you say: "(change remote:remote to your credentials and change ipaddress to your ip address and add a port if needed)" is the "Remote:remote" the user:password of logic machine? and another question: is the ipadress the local one (i.e. 192.168...) of the logic Machine or the DNS server?
At the 3) step, when you say: "Create a event based script to trigger the IFTTT Maker recipe like this:....", I guess we have to do it on the LM configuration at scripting thumbnail , right?.
In that case how can we know that the url: url = \https://maker.ifttt.com/trigger/' .. is the correct one? I do not know what the trigger is on the IFTTT applet in order to write it correctly on the event based script on LM scripting thumbnail.
Could you give some further/detailed information at how to make the 3) step correctly? Additionally, I would like to know where to find the Maker_Secret_Key on the created IFTTT applet at 1) and 2) stepMany thanks in advaced and thank you for your kind support.Best regards.
I send you my best regards and many thanks in advanced.
You can use IFTTT in combination with the Maker Channel (bi-directional)
You have to enable the remote services in the controller (see controller manual) to receive commands and we need a script to send commands to IFTTT.
1) Create a Maker recipe with a unique trigger (for this example) "this_is_my_trigger_unique_event"
2) Create inside your recipe a action like: "http://remote:remote@ipadress/cgi-bin/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=0/0/1&value=true" and
select method "get" and select content type "text / plain" body can be left empty. (change remote:remote to your credentials and change ipaddress to your ip address and add a port if needed)
3) Create a event based script to trigger the IFTTT Maker recipe like this:
-- *************************************** START OF SCRIPT ************************************* -- -- *********** If This Then That Maker Channel Trigger Event Version 1.0 Created by Erwin van der Zwart ********* --
-- *************************************** SET PARAMETERS ************************************* --
-- Set your personal secret key from received https://maker.ifttt.com Maker_Secret_Key = 'PUTHEREYOURPERSONALMAKERKEY'
-- Unique trigger event name you have set in the 'Maker' recipe 'This' event Maker_Event_Name = 'this_is_my_trigger_unique_event' -- Have to match your trigger description you have set in the recipe
-- *************************************** END PARAMETERS ************************************* --
local https = require 'ssl.https'
function iftttmaker(Maker_Secret_Key, Maker_Event_Name) local r, c, h, s = https.request{ url = 'https://maker.ifttt.com/trigger/' .. Maker_Event_Name .. '/with/key/' .. Maker_Secret_Key, sink = ltn12.sink.table(resp), protocol = "tlsv1" } return r, c, h, s end
r, c, h, s = iftttmaker(Maker_Secret_Key, Maker_Event_Name)
-- ****************************************** END SCRIPT **************************************** --
At the step 2) when you say: "(change remote:remote to your credentials and change ipaddress to your ip address and add a port if needed)" is the "Remote:remote" the user:password of logic machine? and another question: is the ipadress the local one (i.e. 192.168...) of the logic Machine or the DNS server?
At the 3) step, when you say: "Create a event based script to trigger the IFTTT Maker recipe like this:....", I guess we have to do it on the LM configuration at scripting thumbnail , right?.
In that case how can we know that the url: url = \https://maker.ifttt.com/trigger/' .. is the correct one? I do not know what the trigger is on the IFTTT applet in order to write it correctly on the event based script on LM scripting thumbnail.
Could you give some further/detailed information at how to make the 3) step correctly? Additionally, I would like to know where to find the Maker_Secret_Key on the created IFTTT applet at 1) and 2) stepMany thanks in advaced and thank you for your kind support.Best regards.
I send you my best regards and many thanks in advanced.
You can use IFTTT in combination with the Maker Channel (bi-directional)
You have to enable the remote services in the controller (see controller manual) to receive commands and we need a script to send commands to IFTTT.
1) Create a Maker recipe with a unique trigger (for this example) "this_is_my_trigger_unique_event"
2) Create inside your recipe a action like: "http://remote:remote@ipadress/cgi-bin/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=0/0/1&value=true" and
select method "get" and select content type "text / plain" body can be left empty. (change remote:remote to your credentials and change ipaddress to your ip address and add a port if needed)
3) Create a event based script to trigger the IFTTT Maker recipe like this:
-- *************************************** START OF SCRIPT ************************************* -- -- *********** If This Then That Maker Channel Trigger Event Version 1.0 Created by Erwin van der Zwart ********* --
-- *************************************** SET PARAMETERS ************************************* --
-- Set your personal secret key from received https://maker.ifttt.com Maker_Secret_Key = 'PUTHEREYOURPERSONALMAKERKEY'
-- Unique trigger event name you have set in the 'Maker' recipe 'This' event Maker_Event_Name = 'this_is_my_trigger_unique_event' -- Have to match your trigger description you have set in the recipe
-- *************************************** END PARAMETERS ************************************* --
local https = require 'ssl.https'
function iftttmaker(Maker_Secret_Key, Maker_Event_Name) local r, c, h, s = https.request{ url = 'https://maker.ifttt.com/trigger/' .. Maker_Event_Name .. '/with/key/' .. Maker_Secret_Key, sink = ltn12.sink.table(resp), protocol = "tlsv1" } return r, c, h, s end
r, c, h, s = iftttmaker(Maker_Secret_Key, Maker_Event_Name)
-- ****************************************** END SCRIPT **************************************** --
Good luck!
Best Regards,
Erwin van der Zwart
Hi Erwin/Sergio.
I am also trying to get IFTTT implemented in LM.
I assume it is public ip address I have to insert and port-forward to LM. And not the IP address of LM on my local network.
I'm not so happy to port-forwarde to LM, but wondered if it was a safe port only for "remote service"
Hello, i tried to send a voice command to logic machine by IFTTT. As trigger i used google assistant and for sending command, i used webhooks. I follow the steps above but for me not working. My address is with http not https, so what should i do different in script?