timer store into dummy device timer state timerstop

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

timer store into dummy device timer state timerstop

#1 Post by riker1 » 05 Jan 2019, 11:04

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

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: timer store into dummy device timer state timerstop

#2 Post by Domosapiens » 05 Jan 2019, 12:02

PS timerstop. did not find any reference in WIKI?
Seen here: viewtopic.php?f=6&t=5841&p=31646&hilit= ... ble#p31646

Code: Select all

Timer,1,0 //disable the timer
??
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#3 Post by riker1 » 05 Jan 2019, 12:54

Domosapiens wrote: 05 Jan 2019, 12:02
PS timerstop. did not find any reference in WIKI?
Seen here: viewtopic.php?f=6&t=5841&p=31646&hilit= ... ble#p31646

Code: Select all

Timer,1,0 //disable the timer
??
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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: timer store into dummy device timer state timerstop

#4 Post by grovkillen » 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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#5 Post by riker1 » 05 Jan 2019, 14:58

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: timer store into dummy device timer state timerstop

#6 Post by grovkillen » 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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#7 Post by riker1 » 05 Jan 2019, 23:03

hi, ok thanks, will check

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#8 Post by riker1 » 05 Jan 2019, 23:06

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
Last edited by riker1 on 05 Jan 2019, 23:41, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: timer store into dummy device timer state timerstop

#9 Post by grovkillen » 05 Jan 2019, 23:30

Yes the timer 1 event makes sure that it'll stay zero once the timer 1 is up. Thus these lines:

Code: Select all

  TimerSet,8,0
  TaskValueSet,12,1,0
You can then always use the [dummy#timeleft] to use it elsewhere.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#10 Post by riker1 » 06 Jan 2019, 11:15

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: timer store into dummy device timer state timerstop

#11 Post by grovkillen » 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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: timer store into dummy device timer state timerstop

#12 Post by riker1 » 06 Jan 2019, 12:10

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 26 guests