Page 1 of 1

LUA different command to same deivce in commandArray

Posted: Monday 02 January 2017 21:47
by daveinhull
Hi,

Can anyone tell me if it is possible to send two different commands to the same device in LUA's commandArray?

This sounds like a silly question, but the reason is that I'd like to put a light to 100% and then switch it off so that the next time it is switch on at the wall it comes on full brightness. I have a mood switch upstairs that puts the hall and landing lights on very dim for night. However I only have a regular switch downstairs which means I have to hold the button down to get it on full. So the sequence would be:
Turn mood on upstairs at night
When dusk sensor goes off
Turn hall and landing lights on 100% and then switch them off
Then when downstairs switch is used they them on normal brightness

I've tried

Code: Select all

    commandArray[1]={['Hall Ceiling'] = 'Set Level 100'}
    commandArray[2]={['Landing Ceiling'] = 'Set Level 100'}
    commandArray[3]={['Hall Ceiling'] = 'Off'}
    commandArray[4]={['Landing Ceiling'] = 'Off'}
But it only seems to do the last command for the device, i.e. off, so pressing the downstairs switch only brings then on dim.

Any thoughts?
Thanks
Dave

Re: LUA different command to same deivce in commandArray

Posted: Saturday 07 January 2017 14:15
by daveinhull
Hi

Anyone got any ideas how to do this or even if it is possible?

Thanks

Re: LUA different command to same deivce in commandArray

Posted: Saturday 07 January 2017 15:51
by jvdz
Only thing I can think of is to do the second command one or a couple of seconds later:

Code: Select all

commandArray[1]={['Hall Ceiling'] = 'Set Level 100'}
commandArray[2]={['Landing Ceiling'] = 'Set Level 100'}
commandArray[3]={['Hall Ceiling'] = 'Off AFTER 3'}
commandArray[4]={['Landing Ceiling'] = 'Off AFTER 3'}
Jos

Re: LUA different command to same deivce in commandArray

Posted: Saturday 07 January 2017 20:51
by daveinhull
Thanks Jos, had a feeling in night be something to do with timings. Will give it a try.