Tuya WiFi Switch Snippet

Gepubliceerd door Robot One op

-- Kroonluchter aan/uit schakelen via IFTTT en Tuya/Smart Life 

return {
    on = {
        devices = {
            'Kroonluchter'
        }
    },
    execute = function(domoticz, device)
        if (device.state == 'On') then
            domoticz.openURL({
                    url = 'https://maker.ifttt.com/trigger/Kroonluchter_aan/with/key/aBc0DEFGHIjklmnopQRStuVwxYZA234BcDEfGHijklM'
                })
                domoticz.variables('kroonluchter_status').set("Aan")
            else
            domoticz.openURL({
                    url = 'https://maker.ifttt.com/trigger/Kroonluchter_uit/with/key/aBc0DEFGHIjklmnopQRStuVwxYZA234BcDEfGHijklM'
                })
                domoticz.variables('kroonluchter_status').set("Uit")
            end
    end
}
Categorieën: