Hi dear experts...
To improve one of my applications I'd need to be able to get the remaining value of a timer if it's cancelled before the inital value is over, for it to be piblished.
I spend hours in the forum and elsewhere in the internet, reading many interesting things but without finding a smart way to perform this.
Hope you'd be able to give me some tricks.
Thanks
SG
How to get timer value
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to get timer value
I use multiple timers for that and have one that is reporting the time elapsed by publishing and updating a dummy variable. It's not super accurate but within 1-2 seconds of the correct time.
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: How to get timer value
Good. I think I tried something similar, but to make sure could you please post an example of your rule ?
Thanks for your help.
Thanks for your help.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to get timer value
Something like this (dummy on task number 12, named dummy#value1)
Code: Select all
On TimerStart Do
TaskValueSet,12,1,%eventvalue%
TimerSet,1,%eventvalue%
TimerSet,2,1
EndOn
On Rules#Timer=2 Do
TaskValueSet,12,1,([Dummy#Value1]-1)
Publish,%sysname%/Timer,[Dummy#Value1]
EndOn
... Unit... /cmd
Message "event,TimerStart=200 (or what period I want).
This is written on my phone, typos may exist
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Who is online
Users browsing this forum: Ahrefs [Bot] and 31 guests