Is it possible to stop a script whenever one of the involved devices is used manually?
In order to distinguish a scripted and manual devicechange ,I tried by setting a uservariable 'Scripting' to On and Off. Whenever 'Scripting' is Off, this would indicate a manually operated device. This is done in a timed script, like this:
Code: Select all
if ((otherdevices['Presence'] == 'On' and otherdevices['SomethingElse'] == 'On') then
commandArray['Variable:Scripting'] = 'On'
SomeValue = 10
commandArray['Device'] = 'Set Level: '..SomeValue.. ' %'
commandArray['Variable:Scripting'] = 'Off'
end
Code: Select all
if (devicechanged['Device'] and Scripting == 'Off')then
print('Device is used without scripting')
end