This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Would IFTTT be possible to integrate?
#8
(11.08.2018, 18:50)SERGIO Wrote: 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

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"
Reply


Messages In This Thread
RE: Would IFTTT be possible to integrate? - by Eyðun - 14.08.2018, 11:10

Forum Jump: