Timer that a KM can restart

I would like to start a timer for an hour, and at the end of a macro restart that timer. I’ve been unable to restart the timer. Here is my issue. I use Stream Deck to dispatch drivers. If I don’t hear from them in one hour I have to radio them for a status check. So obviously if they radio me, or vice versa - I need to restart that hour clock, because I know they are OK at that time. So I just need to find a timer that I can start, then restart from another macro. Hope this makes sense. Any suggestions appreciated.

I know my stream deck has a timer, but I don’t think the stream deck can simulate a button push on itself.

I've done things like this a lot, so here's how I would probably approach it:

First, make a Dictionary that has the Driver Name as the Key Name, and the Value is the next time they should be "nagged". I'll call this NextNagTime.

Create a macro that runs once a minute (or whatever). The macro should check the NextNagTime for each Driver Name in the Dictionary:

If the NextNagTime is empty, skip that dictionary entry.

Otherwise, if NextNagTime is in the past:

  • Set that driver's NextNagTime (i.e. the dictionary value for that Driver Name) to blank.
  • Execute another macro that notifies you.
    • Execute the macro "asynchronously" so the timer macro doesn't wait for it to finish.
    • Use "with parameter" and pass the driver's name.

Your Notification macro can do whatever it needs to, using the value passed in %TriggerValue% as the river's name. When you want to restart the 1-hour wait, set the NextNagTime for that driver in the dictionary.

Let me know if that makes sense. I could probably whip up an example if you needed it.

1 Like

Very cool, An example would be great. I don't use Driver names but Patrol Numbers. IE Adam-501, Lincoln 560. Adam is morning, Lincoln is evening shift. You get the idea. If I have not heard from them in an hour I ask them for "Code 20". They respond with their employee Number. It lets me know they are OK. The way I use the stream deck, I have one macro for most call types. For Example Macro 647-A Is called for a suspicious Person. I select the patrol, then run the macro. The macro makes an entry in the log noting the time of dispatch, address dispatch to etc. If I didn't do it this way I would have to use a different macro for each patrol. So I'm thinking at the end of the macro I could prompt for the patrol to update NextNagTime. I hope this makes sense.

There are timer examples on this forum:

I guess you can edit the JavaScript to restart the timer. But I don't know how to do it at this moment.
Or, you can set the timer macro to run another macro before it closes the HTML prompt window. The second macro executes this timer macro to restart the timer.

Here's an example. I used "Driver Name" but change it to whatever. Also, I tested it some, but not a lot. I expect you'll need to customize it some, but it should get you started.

Nag Drivers Macros.kmmacros (10.9 KB)

Don't forget to enable the group, which is "Nag Drivers".

1 Like

You can run the macro asynchronously.

there's a macro that you can restart:

1 Like

Thanks I'll take a deep dive into this tomorrow.

1 Like