Page 1 of 1
timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 11:04
by riker1
Hi
you can I store the timer state - seconds -
into a dummy variable?
Is timer state available somewhere?
Dummy is having 4 values now?
Will that work:
TaskValueSet 10,2,[timer1]
PS timerstop. did not find any reference in WIKI?
How is timerstop referenced to a timer having more than 1.
Thanks T
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 12:02
by Domosapiens
PS timerstop. did not find any reference in WIKI?
Seen here:
viewtopic.php?f=6&t=5841&p=31646&hilit= ... ble#p31646
??
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 12:54
by riker1
Sorry do not undertand your hint.
question: timerstop and timerstart is this an event?
- refering to which timer? having more than one timers running?
how to publish use timer elapsed time in mqtt or in dummy device.
I understand your hint to pass a value from dummy as timer time. but I need other way around
Thanks Thomas
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 13:55
by grovkillen
You would need to use two timers, one that is pushing the seconds passed to a dummy. But if you can explain the need for a system variable then we might implement it.
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 14:58
by riker1
grovkillen wrote: ↑05 Jan 2019, 13:55
You would need to use two timers, one that is pushing the seconds passed to a dummy. But if you can explain the need for a system variable then we might implement it.
Hi ok, thanks.
but how do I push the seconds passed to the dummy? Would this work already?
or publish the seconds passed?
Thanks
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 16:40
by grovkillen
Code: Select all
On StartTimer Do
TaskValueSet,12,1,%eventvalue%
TimerSet,1,%eventvalue%
TimerSet,8,1
EndOn
On Rules#Timer=1 Do
TimerSet,8,0
TaskValueSet,12,1,0
//Whatever
EndOn
On Rules#Timer=8 Do
TaskValueSet,12,1,[dummy#timeleft]-1
TimerSet,8,1
EndOn
If you have your dummy on task number 12. Named
dummy#
timeleft. Start timer by using the event command,
Event,StartTimer=123. Use whatever integer as the countdown.
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 23:03
by riker1
hi, ok thanks, will check
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 23:06
by riker1
grovkillen wrote: ↑05 Jan 2019, 16:40
Code: Select all
On StartTimer Do
TaskValueSet,12,1,%eventvalue%
TimerSet,1,%eventvalue%
TimerSet,8,1
EndOn
On Rules#Timer=1 Do
TimerSet,8,0
TaskValueSet,12,1,0
//Whatever
EndOn
On Rules#Timer=8 Do
TaskValueSet,12,1,[dummy#timeleft]-1
TimerSet,8,1
EndOn
If you have your dummy on task number 12. Named
dummy#
timeleft. Start timer by using the event command,
Event,StartTimer=123. Use whatever integer as the countdown.
But is it possible to reference the time of a specifiy timer?
Code: Select all
On Rules#Timer=8 Do
TaskValueSet,12,1,[dummy#timeleft]-1
TimerSet,8,1
EndOn
I would assume if Rules#Timer=8 -> timeleft will be zero as timer countdown is over, ??
Probably I am incorrect how to number the different timer.
Timer 1: timerSet,1,13600
Timer 2: timerSet,2,10
etc.
or is this not correct?
Rule#Timer=2: Evento for finished timer 2?
Thanks T
Re: timer store into dummy device timer state timerstop
Posted: 05 Jan 2019, 23:30
by grovkillen
Yes the timer 1 event makes sure that it'll stay zero once the timer 1 is up. Thus these lines:
You can then always use the
[dummy#timeleft] to use it elsewhere.
Re: timer store into dummy device timer state timerstop
Posted: 06 Jan 2019, 11:15
by riker1
ok thanks understood.
Nice aproach.
maybe a systemvariable for timers would be easier instead of duplicating it via dummy device.
another related questions. :is it possible to set the variable via mqtt?
Thanks Thomas
Re: timer store into dummy device timer state timerstop
Posted: 06 Jan 2019, 11:23
by grovkillen
Which variable? The timer? If so, just use the command event,StartTimer=123 and change 123 to whatever number you want.
Re: timer store into dummy device timer state timerstop
Posted: 06 Jan 2019, 12:10
by riker1
grovkillen wrote: ↑06 Jan 2019, 11:23
Which variable? The timer? If so, just use the command
event,StartTimer=123 and change 123 to whatever number you want.
ok perfect, easier than I thought