ifttt node-red mqtt and dzvents
Posted: Wednesday 12 June 2019 16:37
Better to place the dzvents part of my ifttt, node-red - mqtt script here
I can manage the uservar IFTTTVAR now by speech.
In IFTTT i have made a webhook with a {"value":"{{TextField}}"} body
My Node-red receives this and makes an complete json body for an update of an user-var iftttvar
in this var a name of a device or scene or group or selector whatever On or Off is registrated.
After that the next script fires
is still very global and has hardcoded values, but it is working!
to do:
search in domoticz if the name is an device, selector, scene, group etc.
split the device name and on or off
put the object on/off
@waaren is this wat you mentioned ?
I can manage the uservar IFTTTVAR now by speech.
In IFTTT i have made a webhook with a {"value":"{{TextField}}"} body
My Node-red receives this and makes an complete json body for an update of an user-var iftttvar
in this var a name of a device or scene or group or selector whatever On or Off is registrated.
After that the next script fires
is still very global and has hardcoded values, but it is working!
to do:
search in domoticz if the name is an device, selector, scene, group etc.
split the device name and on or off
put the object on/off
@waaren is this wat you mentioned ?
Code: Select all
return {
on = { variables = { iftttvar }, -- var, define as type string
},
logging = { level = domoticz.LOG_ERROR,
marker = "iftttvar" },
execute = function(dz, item)
local iftttvar = dz.variables(iftttvar)
if iftttvar.value == 'lamp ON' then --retrieve if it is a switch, a scene, a group etc. then if it is on or off and then action
dz.devices('lantaarn').switchOn()
end
end
}