Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 11:24
uh..
sorry
sorry
Open source Home Automation System
https://forum.domoticz.com/
Code: Select all
commandArray = {}
if devicechanged['Kinkiet'] and otherdevices['Kinkiet'] == 'On' then
if otherdevices['Switch2'] == 'Off' then
commandArray['Switch2'] = 'On'
end
end
if devicechanged['Kinkiet'] and otherdevices['Kinkiet'] == 'Off' then
if otherdevices['Switch2'] == 'On' then
commandArray['Switch2'] = 'Off'
end
end
if devicechanged['Switch2'] and otherdevices['Switch2'] == 'On' then
if otherdevices['Kinkiet'] == 'Off' then
commandArray['Kinkiet'] = 'On'
end
end
if devicechanged['Switch2'] and otherdevices['Switch2'] == 'Off' then
if otherdevices['Kinkiet'] == 'On' then
commandArray['Kinkiet'] = 'Off'
end
end
return commandArrayCode: Select all
-- script_device_Zaluzje_pietro.lua
local sensor = 'Zaluzje pietro'
commandArray = {}
if (devicechanged[sensor] == 'On') then
print ("Odsloniecie zaluzji na pietrze przez przekaznik na GPIO 19")
os.execute ("/usr/local/bin/gpio export 19 in")
os.execute ("/usr/local/bin/gpio export 19 out")
os.execute ("sleep 0.1")
os.execute ("/usr/local/bin/gpio export 19 in")
end
if (devicechanged[sensor] == 'Off') then
print ("Zasloniecie zaluzji na pietrze przez przekaznik na GPIO 16")
os.execute ("/usr/local/bin/gpio export 16 in")
os.execute ("/usr/local/bin/gpio export 16 out")
os.execute ("sleep 0.1")
os.execute ("/usr/local/bin/gpio export 16 in")
end
if (devicechanged[sensor] == 'Stop') then
print ("Ustawienie zaluzji na pietrze w pozycji MY przez przekaznik na GPIO 13")
os.execute ("/usr/local/bin/gpio export 13 in")
os.execute ("/usr/local/bin/gpio export 13 out")
os.execute ("sleep 0.1")
os.execute ("/usr/local/bin/gpio export 13 in")
end
return commandArray