... Off AFTER uservariable Topic is solved

Post Reply
Crash123
Posts: 35
Joined: Thursday 27 October 2016 7:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

... Off AFTER uservariable

Post by Crash123 » Saturday 31 March 2018 23:21

Why doesn´t this work? If I use 5 instead of (uservariables['V2']) it does work.
I will fill the variable V2 depending on different situations with different times.
commandArray = {}

if (uservariables['V1'] == 0 and (otherdevices['t2'] == 'On') ) then
commandArray['t2']='Off AFTER (uservariables['V2'])' --uservariables V2 is defined 5seconds
commandArray['Variable:V1'] = '1'
elseif (uservariables['V1'] == 1 and (otherdevices['t2'] == 'Off') ) then
commandArray['Variable:V1'] = '0'
end

return commandArray
Any suggestions how to solve?

User avatar
jvdz
Posts: 1313
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: ... Off AFTER uservariable

Post by jvdz » Saturday 31 March 2018 23:27

You probably want to concatenate the variable like this:

Code: Select all

commandArray['t2']='Off AFTER '..tostring(uservariables['V2'])     --uservariables V2 is defined 5seconds
Jos

Crash123
Posts: 35
Joined: Thursday 27 October 2016 7:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: ... Off AFTER uservariable

Post by Crash123 » Saturday 31 March 2018 23:31

Perfect. Thank you very much!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests