How do I send two commands to the same device.
I have a fan and need to send 'off' to stop the fan and 'light' to turn off the light. Can I do this in a single lua script?
commandArray[c] = "off"
commandArray[c] = "light"
fails as the last one is the only one that gets actioned.
Help!
Sending two commands to the same device
Moderator: leecollings
- l0gic
- Posts: 107
- Joined: Tuesday 08 October 2013 9:35
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: Sending two commands to the same device
Try
commandArray[1] = "off"
commandArray[2] = "light"
commandArray[1] = "off"
commandArray[2] = "light"
Non credus crepitus
-
- Posts: 7
- Joined: Saturday 04 August 2018 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Sending two commands to the same device
Thanks, but I should have included..
c = 'Dining Room Light'
So 1 and 2 do not reference the light. Are there ways to pass two arguments to a device in the same line?
c = 'Dining Room Light'
So 1 and 2 do not reference the light. Are there ways to pass two arguments to a device in the same line?
-
- Posts: 7
- Joined: Saturday 04 August 2018 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Sending two commands to the same device
Thanks for the push in the right direction.
The following has worked...
commandArray[1]={[c] = 'light'}
commandArray[2]={[c] = 'med AFTER 1'}
The following has worked...
commandArray[1]={[c] = 'light'}
commandArray[2]={[c] = 'med AFTER 1'}
- l0gic
- Posts: 107
- Joined: Tuesday 08 October 2013 9:35
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: Sending two commands to the same device
Glad you have sorted it.
Yeah, I should have looked closer, I saw the commandArray[c]= and immediately went off on the wrong tangent.
Sorry, but glad you are sorted.
Yeah, I should have looked closer, I saw the commandArray[c]= and immediately went off on the wrong tangent.
Sorry, but glad you are sorted.
Non credus crepitus
Who is online
Users browsing this forum: No registered users and 1 guest