30.09.2015, 07:20
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
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