i have made a script with a selector switch for my sunblinds.

The Idea is since i took closure and opening timing with a stopwatch, o make it possible with a selector switch to close the sunblind halfway, (half)
or just not fully close it. (kier)
Code: Select all
function Rolluik(commando)
print('rolluik ' .." status "..otherdevices["Rolluik"].." command "..commando)
if commando == "Dicht" then
commandArray[#commandArray + 1] = {['Rolluik']='Close'}
print("Dicht done")
elseif commando == "Open" then
commandArray[#commandArray + 1] = {['Rolluik']='Open'}
print("Open done")
-- kier
elseif commando == "Kier" and otherdevices["Rolluik"] == "Stopped" then
commandArray[#commandArray + 1] = {['Rolluik']='Open'}
commandArray[#commandArray + 2] = {['Rolluik']='Dicht AFTER 12'}
commandArray[#commandArray + 3] = {['Rolluik']='Stop AFTER 17'}
print("Kier done")
-- half
elseif commando == "Half" and otherdevices["Rolluik"] == "Stopped" then
commandArray[#commandArray + 1] = {['Rolluik']='Open'}
commandArray[#commandArray + 2] = {['Rolluik']='Dicht AFTER 12'}
commandArray[#commandArray + 3] = {['Rolluik']='Stop AFTER 15'}
print("Half done")
end
end
see log file :
Code: Select all
2017-05-22 16:43:43.093 User: Admin initiated a switch command (577/Rolluik_Keuze/Set Level)
2017-05-22 16:43:42.578 (RFXCOM) Temp + Humidity + Baro (Binnen)
2017-05-22 16:43:43.093 (RFXCOM) Temp + Humidity + Baro (Binnen)
2017-05-22 16:43:44.281 LUA: rolluik status Stopped command Dicht
2017-05-22 16:43:44.281 LUA: Dicht done
2017-05-22 16:43:43.969 (Dummie) Light/Switch (Rolluik_Keuze)
2017-05-22 16:43:44.328 (RFXCOM) RFY (Rolluik)
2017-05-22 16:43:45.609 (RFXCOM) Temp + Humidity (Douche)
2017-05-22 16:43:49.391 (RFXCOM) Temp + Humidity (Buiten)
If i use the original manual switch from the dashboard named "Rolluik" all works fine.

It looks like after the command stop is given from LUA it is not possible to give another command from lua any more

Any idea why this won''t work ?
Many thanks in advance ...