Execute same switch On / On AFTER xx

Moderator: leecollings

Post Reply
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Execute same switch On / On AFTER xx

Post by deve87 »

I want to run

Code: Select all

commandArray['Door bell'] = 'On AFTER 5'
commandArray['Door bell'] = 'On AFTER 7'
If I try

Code: Select all

commandArray[1]={['Door bell'] = 'On AFTER 5'}
commandArray[2]={['Door bell'] = 'On AFTER 7'}
It only execute the first [1] line

How can I do this?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Execute same switch On / On AFTER xx

Post by waaren »

deve87 wrote: Sunday 09 June 2019 15:08 I want to run
  • Door bell On after 5 seconds
  • Door bell On after 7 seconds
How can I do this?

Code: Select all

    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 5 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 7 SECONDS' }
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute same switch On / On AFTER xx

Post by deve87 »

Yes also tried that. Same result :cry:
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Execute same switch On / On AFTER xx

Post by waaren »

deve87 wrote: Sunday 09 June 2019 16:05 Yes also tried that. Same result :cry:
:?: Should work :!: What do you see in the log ? Can you share the complete script. It might just help in finding the issue
I tested with this Lua (V4.10881)

Code: Select all

commandArray = {}

    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 5 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 7 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 9 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 11 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 13 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 15 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 17 SECONDS' }
    commandArray[#commandArray + 1] = {['Door bell'] ='On AFTER 19 SECONDS' }
    
return commandArray
relevant domoticz log

Code: Select all

2019-06-09 16:16:06.036  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:08.056  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:10.035  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:12.057  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:14.041  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:16.066  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:18.045  (Virtual) Light/Switch (Door bell)
2019-06-09 16:16:20.044  (Virtual) Light/Switch (Door bell)
Door bell.png
Door bell.png (141.66 KiB) Viewed 1074 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute same switch On / On AFTER xx

Post by deve87 »

I haven't actually tried with SECONDS behind. Shall trie that and post back
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute same switch On / On AFTER xx

Post by deve87 »

Ok. It don't work. Only triggers one line

Code: Select all

commandArray = {}
if uservariables['Multimedia'] == 0 and otherdevices['Se På Data'] == 'On' then
    commandArray[#commandArray + 1] = {['TV Source'] = 'On AFTER 1 SECONDS' }
    commandArray[#commandArray + 1] = {['TV Source'] = 'On AFTER 3 SECONDS' }
end

if otherdevices['Se På Data'] == 'On' then
    commandArray['Se På Data'] = 'Off'
end
return commandArray
Running stabel V4.10717
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute same switch On / On AFTER xx

Post by deve87 »

I figur it out. I had a second scripts setting the device to Off if it becomes On. If I disabled that, it works.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest