Seite 1 von 1

#1 Domiq mit IFTTT

Verfasst: Di 2. Mai 2017, 20:57
von stephenlion
Hi,
ich versuche mit einem Event bei IFTTT etwas auszulösen.
Piotr hat sich auch schon etwas angesehen, aber vielleicht wisst Ihr ja etwas.
Meine Event :
C.HTTP.get=http://maker.ifttt.com/trigger/Test1/with/key/meinkeyxxxxxxxxx

Der Event funktioniert tadellos im Browser aber nicht wenn er von Domiq ausgeführt wird.
Ich habe es mit einem Enter in dem Wert Feld versucht und ohne... kein Unterschied...

Der Event der danach eingetragen ist (ein remote notify) funkt immer....

Freu mich über Hilfe - Es wäre übrigens auch super wenn IFTTT einen Event ausllösen könnte ... jemand tippps ?

Liebe Grüße
Stephen

#2 Re: Domiq mit IFTTT

Verfasst: Di 9. Mai 2017, 22:12
von stephenlion
So wie es aussieht schickt Domiq beim Get keine Browser Info mit und dies scheint IFTTT nicht zu mögen... siehe
image001.png
Anhang
Hat jemand dazu eine Lösung ?

#3 Re: Domiq mit IFTTT

Verfasst: Mo 19. Jun 2017, 09:57
von DOMIQ-Support
Here is the examplary code for IFTTT integration.

Code: Alles auswählen

local iftttsocket

function createIftttConnection(cmd)
   iftttsocket = tcp.socket()
   iftttsocket:connect("maker.ifttt.com",80)

   iftttsocket:on('connect', function()
      print('IFTTT CONNECTED')
      iftttsocket:mode('line')
      sendifttt(cmd)
   end)

   iftttsocket:on("close", function()
      print('SOCKET CLOSED')
      iftttsocket = nil
   end)

   iftttsocket:on('line', function(data)
      print('DATA: '..data)
   end)
end

function sendifttt(cmd)
   if iftttsocket ~= nil then
      iftttsocket:send(string.format("GET %s HTTP/1.1\r\nHost:%s\r\nConnection: keep-alive\r\n\r\n",cmd,"maker.ifttt.com"))
   else
      createIftttConnection(cmd)
   end
end


In order to trigger and IFTTT webhook just invoke the sendifttt function. Here is the example:
sendifttt("http://maker.ifttt.com/trigger/button/with/key/your_key_here")
Where your_key_here should be replaced with your IFTTT key and the path should match created webhook. This function can be invoked as a result of an event, timer or pressing a button on visualization or from the Remote menu.
Here is the example how to call this function from Remote menu.
1. Add a Pushbutton and double-click on it in order to edit its properties.
2. Click on the Add command option. Then in the Name field enter: C.LOGIC and in the Value field type: sendifttt(here_goes_ifttt_url)