Tuya WiFi Switch Snippet

12345678910111213141516171819202122-- Kroonluchter aan/uit schakelen via IFTTT en Tuya/Smart Lifereturn {on = {devices = {'Kroonluchter'}},execute = function(domoticz, device)if (device.state == 'On') thendomoticz.openURL({url = 'https://maker.ifttt.com/trigger/Kroonluchter_aan/with/key/aBc0DEFGHIjklmnopQRStuVwxYZA234BcDEfGHijklM'})domoticz.variables('kroonluchter_status').set("Aan")elsedomoticz.openURL({url = 'https://maker.ifttt.com/trigger/Kroonluchter_uit/with/key/aBc0DEFGHIjklmnopQRStuVwxYZA234BcDEfGHijklM'})domoticz.variables('kroonluchter_status').set("Uit")endend}