LUA different command to same deivce in commandArray

Moderator: leecollings

Post Reply
daveinhull
Posts: 22
Joined: Thursday 20 August 2015 11:30
Target OS: Windows
Domoticz version: V2.2657
Location: UK
Contact:

LUA different command to same deivce in commandArray

Post 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
Domoticz running on Windows 10 x64 Shuttle PC
RFComm, 9wall dimmers, 4dual sockets, 3x3way relays, 1x1way relay, 4PIRs, 2magnetic switches, 1radiator valve, WiFi link, coiler switch and controller, compatible security system, & lots of patience
daveinhull
Posts: 22
Joined: Thursday 20 August 2015 11:30
Target OS: Windows
Domoticz version: V2.2657
Location: UK
Contact:

Re: LUA different command to same deivce in commandArray

Post by daveinhull »

Hi

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

Thanks
Domoticz running on Windows 10 x64 Shuttle PC
RFComm, 9wall dimmers, 4dual sockets, 3x3way relays, 1x1way relay, 4PIRs, 2magnetic switches, 1radiator valve, WiFi link, coiler switch and controller, compatible security system, & lots of patience
User avatar
jvdz
Posts: 2269
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: LUA different command to same deivce in commandArray

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
daveinhull
Posts: 22
Joined: Thursday 20 August 2015 11:30
Target OS: Windows
Domoticz version: V2.2657
Location: UK
Contact:

Re: LUA different command to same deivce in commandArray

Post by daveinhull »

Thanks Jos, had a feeling in night be something to do with timings. Will give it a try.
Domoticz running on Windows 10 x64 Shuttle PC
RFComm, 9wall dimmers, 4dual sockets, 3x3way relays, 1x1way relay, 4PIRs, 2magnetic switches, 1radiator valve, WiFi link, coiler switch and controller, compatible security system, & lots of patience
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest