Page 1 of 1
dzvents and ifttt
Posted: Tuesday 27 February 2018 5:27
by bdormael
couldnt find it back in the docs:
via LUA you can do a command array which executes a webhook in ifttt via "triggerifttt"
Does something similar exists fir dvents?
Re: dzvents and ifttt
Posted: Tuesday 27 February 2018 20:39
by waaren
(as adviced by Danny) IFTTT not implemented yet in native dzVents domoticz.notify but can be triggered using domoticz.sendCommand if you defined and activated IFTTT in settings -> notifications
Code: Select all
return {
on = { devices = { "domoticz Triggerdevice" } },
execute = function(domoticz, device)
eventName = "IFTTT triggername"
value1 = "test1"
value2 = "test2"
value3 = "test3"
domoticz.sendCommand("TriggerIFTTT", eventName .. "#" .. value1 .. "#" .. value2 .. "#" .. value3 )
end
}
Re: dzvents and ifttt
Posted: Tuesday 27 February 2018 21:00
by bdormael
waaren wrote:IFTTT not implemented yet in native dzVents domoticz.notify but can be triggered using domoticz.sendCommand if you defined and activated IFTTT in settings -> notifications
Code: Select all
return {
on = { devices = { "domoticz Triggerdevice" } },
execute = function(domoticz, device)
eventName = "IFTTT triggername"
value1 = "test1"
value2 = "test2"
value3 = "test3"
domoticz.sendCommand("TriggerIFTTT", eventName .. "#" .. value1 .. "#" .. value2 .. "#" .. value3 )
end
}
Cool, thx
Verzonden vanaf mijn iPad met Tapatalk
Re: dzvents and ifttt
Posted: Monday 19 March 2018 10:15
by DewGew
I do like this:
I added this code to my 'global_data.lua'
Code: Select all
return {
helpers = {
-- Send IFTTT Notification
iftttNotify = function(domoticz, subject, body)
eventName = 'Domoticz'
prefix = 'Domoticz:'
domoticz.sendCommand("TriggerIFTTT", eventName .. "#" .. prefix .. "#" .. subject .. "#" .. body )
end
}
}
Now I can call send ifttt notification from all my dzVents script with:
Code: Select all
domoticz.helpers.iftttNotify(domoticz, 'subject text here', 'body text here')
Re: dzvents and ifttt
Posted: Tuesday 04 June 2019 15:14
by pvklink
To use the notification in IFTTT, what service / applet do i have to install in IFTTT.
Is it possible to let my google home speak with this for example?
Re: dzvents and ifttt
Posted: Tuesday 04 June 2019 16:08
by waaren
pvklink wrote: ↑Tuesday 04 June 2019 15:14
To use the notification in IFTTT, what service / applet do i have to install in IFTTT.
Is it possible to let my google home speak with this for example?
triggerIFTTT is a native dzVents command in dzVents >= 2.4.18
It will call an IFTTT maker event (webhook)
Re: dzvents and ifttt
Posted: Tuesday 04 June 2019 20:44
by pvklink
ok, thats great!
And the other script, what is the purpose of sending a notification to ifttt, which service/applet is reacting on this notification?
Re: dzvents and ifttt
Posted: Tuesday 04 June 2019 23:11
by waaren
pvklink wrote: ↑Tuesday 04 June 2019 20:44
ok, thats great!
And the other script, what is the purpose of sending a notification to ifttt, which service/applet is reacting on this notification?
the triggerIFTTT takes care of the
If This part
the
Then That part can be any IFTTT action service (there are thousands). I use mail, pushover, Hue, SmartLife to name a few.
Re: dzvents and ifttt
Posted: Wednesday 05 June 2019 14:59
by pvklink
Clear, i also use IFTTT to manage my domoticz devices via my rpi google home...
But to make things work you have to make an applet with a If (service) and a then (service).
In my case i use google home for the IF and often WEBHOOKS for the THEN.
How do i call the THEN service (with the IFTTT domoticz routine, i dont see a ID, the applets have an Applet version ID 100306821. i dont see such an ID for the for THEN services....
I tried..
do you have a working example ?
Code: Select all
return {
on = {
devices = {
'testifttt'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
eventName = "Play a Sonos favorite with Google Assistant"
value1 = "Natural"
value2 = "Studeerkamer"
value3 = "this room only"
domoticz.sendCommand("TriggerIFTTT", eventName .. "#" .. value1 .. "#" .. value2 .. "#" .. value3 )
end
}
can i call for example the webhook service with the domoticz call?
url
https://x:[email protected]:1880/t
method post
content/type application/json
body {"command": "switchlight", "idx": 1002, "switchcmd": "On"}
Re: dzvents and ifttt
Posted: Wednesday 05 June 2019 15:52
by waaren
pvklink wrote: ↑Wednesday 05 June 2019 14:59
How do i call the THEN service (with the IFTTT domoticz routine, i dont see a ID, the applets have an Applet version ID 100306821. i dont see such an ID for the for THEN services....
The domoticz IFTTT (dzVents triggerIFTTT) does the IF part. The THAT part is on the 'other' site. The name of the maker event is the trigger for IFTTT
from the wiki:
triggerIFTTT(makerName [,sValue1, sValue2, sValue3]): Function. 2.4.18 Have Domoticz 'call' an IFTTT maker event. makerName is required, 0-3 sValue's are optional. Supports command options.
Re: dzvents and ifttt [Solved]
Posted: Wednesday 05 June 2019 16:10
by pvklink
finally got it working....
made a test_event with webhooks as IF and webhooks as THEN.
called the name of the applet and my light goes on....
Would be great if you can have more IF's and then response and then ACTION. In this way i can trigger my device from google home and by IFTTT domoticz with the same reaction via google home... and do the same action
but for now ok! thanks waaren!
Re: dzvents and ifttt
Posted: Wednesday 05 June 2019 16:31
by waaren
pvklink wrote: ↑Wednesday 05 June 2019 16:10
finally got it working....
Great !
Would be great if you can have more IF's and then response and then ACTION. In this way i can trigger my device from google home and by IFTTT domoticz with the same reaction via google home... and do the same action
You might want to have a look at this
Adding multiple devices to IFTTT
A PHP script is available that makes it easier to have all of your devices on IFTTT while only requiring you to create two IFTTT applets.
You can read more about it and download here:
https://github.com/dswinton/domo-ifttt
Re: dzvents and ifttt
Posted: Wednesday 05 June 2019 17:05
by pvklink
true!
I had that installed in previous/older installations!
i switched from http get commands to post with json bodies, and node-red and mqtt
Dont think i can combine it... domo-ifttt uses devices-names and select id's with it...
I think that is hard to do with node-red and mqtt