This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

different value throughout the day
#1
Is it possible to send diffrent values from a 1bit signal compared to the time of day? 
Reply
#2
Hi,

Yes that is possible, but can you describe your task in more detail?

BR,

Erwin
Reply
#3
(10.06.2018, 20:13)Erwin van der Zwart Wrote: Hi,

Yes that is possible, but can you describe your task in more detail?

BR,

Erwin


Event based script that sends a value between for example 08-13 another value between 13-14 and so on.


Also needs a script that does the same automatically, but that I can start/stop via a bit value or a scene value.
Reply
#4
Hi,

Try this:
Code:
now = os.date('*t')
if now.hour >= 8 and now.hour < 13 then
   grp.write('1/1/1', true)
elseif now.hour >= 13 and now.hour < 14 then
   grp.write('1/1/1', false)
end
For enable/disable script above from 1 bit use this: (sample is assuming event script script above is called 'timebasedevent')
Code:
if event.getvalue() == true then
  script.enable('timebasedevent')
else
  script.disable('timebasedevent')
end
BR,

Erwin
Reply
#5
(11.06.2018, 21:59)Erwin van der Zwart Wrote: Hi,

Try this:
Code:
now = os.date('*t')
if now.hour >= 8 and now.hour < 13 then
   grp.write('1/1/1', true)
elseif now.hour >= 13 and now.hour < 14 then
   grp.write('1/1/1', false)
end
For enable/disable script above from 1 bit use this: (sample is assuming event script script above is called 'timebasedevent')
Code:
if event.getvalue() == true then
  script.enable('timebasedevent')
else
  script.disable('timebasedevent')
end
BR,

Erwin

Thank you .
Reply
#6
(11.06.2018, 21:59)Erwin van der Zwart Wrote: Hi,

Try this:
Code:
now = os.date('*t')
if now.hour >= 8 and now.hour < 13 then
   grp.write('1/1/1', true)
elseif now.hour >= 13 and now.hour < 14 then
   grp.write('1/1/1', false)
end
For enable/disable script above from 1 bit use this: (sample is assuming event script script above is called 'timebasedevent')
Code:
if event.getvalue() == true then
  script.enable('timebasedevent')
else
  script.disable('timebasedevent')
end
BR,

Erwin
The first code. Can we do different things with a true value and a false value?
Reply
#7
Hi,

We can do whatever you like to do with script, but can you specify your question better?

BR,

Erwin
Reply
#8
(17.06.2018, 10:59)Erwin van der Zwart Wrote: Hi,

We can do whatever you like to do with script, but can you specify your question better?

BR,

Erwin

Sounds good.
Event based script that sends a value between for example 08-13 another value between 13-14 and so on.
Sends different values with a 1bit true/false
Reply
#9
Hi,

That is already in the sample i gave you (:

BR,

Erwin
Reply
#10
(18.06.2018, 09:54)Erwin van der Zwart Wrote: Hi,

That is already in the sample i gave you (:

BR,

Erwin

Sorry my fault.
Reply


Forum Jump: