Code: Select all
return {
on = {
devices = {'Esszimmer Schrank Licht','Balkon Pumpe','WZ Sofa Licht'},
},
execute = function(dz, triggeredItem)
if (triggeredItem.name=='Esszimmer Schrank Licht') then
channel=2
elseif (triggeredItem.name=='Balkon Pumpe') then
channel=1
else
channel=3
end
baseurl='http://tasmota-9.fritz.box/cm?cmnd='
if (triggeredItem.active) then
-- dz.log('Switch '..channel..'an, Level'..triggeredItem.level)
dz.openURL({url = baseurl..'Power'..channel..'%20On'})
dz.openURL({url = baseurl..'channel'..channel..'%20'..triggeredItem.level})
else
-- dz.log('Switch '..channel..'aus')
dz.openURL({url = baseurl..'Power'..channel..'%20Off'})
end
end
}