Would IFTTT be possible to integrate? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2) +--- Thread: Would IFTTT be possible to integrate? (/showthread.php?tid=86) Pages:
1
2
|
Would IFTTT be possible to integrate? - Sandstrand - 29.09.2015 As the title says. 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. If anyone is wondering, here is the IFTTT website : https://ifttt.com/ RE: Would IFTTT be possible to integrate? - Peter - 29.09.2015 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. RE: Would IFTTT be possible to integrate? - Sandstrand - 30.09.2015 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 RE: Would IFTTT be possible to integrate? - Erwin van der Zwart - 30.09.2015 Hi, 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 RE: Would IFTTT be possible to integrate? - akshaya.mestry - 07.04.2017 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. RE: Would IFTTT be possible to integrate? - edgars - 10.04.2017 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 RE: Would IFTTT be possible to integrate? - SERGIO - 11.08.2018 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. *********************************************************************************************** Erwin van der Zwart Wrote: Hi, 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 RE: Would IFTTT be possible to integrate? - Eyðun - 14.08.2018 (11.08.2018, 18:50)SERGIO Wrote: Hi Erwin, 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" RE: Would IFTTT be possible to integrate? - Daniel - 14.08.2018 Yes external IP and external port. Use HTTPS and port 443 so at last it will be encrypted. RE: Would IFTTT be possible to integrate? - SERGIO - 14.08.2018 (14.08.2018, 11:12)Daniel. Wrote: Yes external IP and external port. Use HTTPS and port 443 so at last it will be encrypted. Thank you Daniel, so the url would be i.e.: https://remote:remote@public_ip:port/scada-remote?m=json&r=grp&fn=write&alias=1/1/1&value=50 Is that correct? I intorduce my external IP and It does not work. Besides, the problem is that the external IP change every day...so I would like to avoid pay for a such service. Best regards. RE: Would IFTTT be possible to integrate? - Daniel - 14.08.2018 Yes, use ddns service, there are plenty of free ones. I use no-ip.com RE: Would IFTTT be possible to integrate? - SERGIO - 19.08.2018 (14.08.2018, 18:49)Daniel. Wrote: Yes, use ddns service, there are plenty of free ones. I use no-ip.com So, It would remain as: http://username:password@public_hostname:port/scada-remote?m=json&r=grp&fn=write&alias=1/1/1&value=50 , right? Note: Username and password of your router credentials? Best regards RE: Would IFTTT be possible to integrate? - Erwin van der Zwart - 19.08.2018 Hi, Nope, the credentials in the URL are the ones you have set in the remote services of the controller. Username is always ‘remote’ and default password is also ‘remote’, make sure the remote service is enabled. BR, Erwin RE: Would IFTTT be possible to integrate? - SERGIO - 20.08.2018 (19.08.2018, 22:19)Erwin van der Zwart Wrote: Hi, ok, remote service is enable and user name is remote and password is also remote, but this is still not working.....I do not what is happening. note: I already have a hostname which is perfectly working as external IP Best regards. RE: Would IFTTT be possible to integrate? - Daniel - 20.08.2018 Paste your URL in to any browser and press enter, let us know what you get as result. RE: Would IFTTT be possible to integrate? - SERGIO - 26.08.2018 (20.08.2018, 19:30)Daniel. Wrote: Paste your URL in to any browser and press enter, let us know what you get as result. See attached. I do not what is going on. Thank you in advanced for your kind help. RE: Would IFTTT be possible to integrate? - Daniel - 27.08.2018 No access to the device means port not opened. RE: Would IFTTT be possible to integrate? - edos - 20.04.2020 Hi! Please tell me how to add a variable to the above script. In this format Content-Type: application / json {"value1": "123"} RE: Would IFTTT be possible to integrate? - admin - 21.04.2020 JSON post example: Code: function post(url, body) RE: Would IFTTT be possible to integrate? - alexandrub - 12.07.2024 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? http://user:password@xx.xx.xx.xxx:80/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=0/0/1&value=false If i try from browser it works but from webhooks not working. Google assistent was working. I think the webhooks working too but the response is "Timed out waiting for response from http://remote....". Can you help me please? Best regards, Alexandru. |