SimpleTimer.h - Looking for help creating and resetting a second timer

Hi, first time post, hopefully I am following the guidlines properly.

My general goal is to create a sketch that uses a DHT22 and a PIR sensor to publish temperature via MQTT and turn off my Lutron light via IFTTT Webhooks after no motion is detected for a pre-determined amount of time.

I want the timer to reset each time motion IS present.

What I am using:
SimpleTimer.h Library from Arduino Playground - SimpleTimer Library
esp8266 - generic D1 mini

I have the PIR working, one standard SimpleTimer, and the webhook.

Following the SimpleTimer examples linked above, I have not been able to get a second timer to work.

Below is a small section of my code which I believe covers what applies to my question.

#include <SimpleTimer.h> //https://playground.arduino.cc/Code/SimpleTimer/#Usage
SimpleTimer timer;
SimpleTimer timerPIR; //Creates a second timer to be used for PIR Lights

void setup()
}
  // Start the timers for void loop
    timer.setInterval(3000, readSensor);
    timer.setInterval(3000, sendMQTT);
    timer.setInterval(5000, checkPIR);
    timerPIR.setInterval(180000, sendIFTTT);  //Doesn't appear to work unless I change from timerPIR to 
    timer
{

void sendIFTTT()
{
  Serial.println("Sending Webhook");
  HTTPClient http;  //Declare an object of class HTTPClient
  http.begin("http://maker.ifttt.com/trigger/Off/with/key/");  //Specify request destination
  http.GET();   //Send the request
  http.end();   //Close connection
}

void checkPIR()
{
  PIRstate = digitalRead(PIR);  //HIGH when motion detected, else LOW
  if (PIRstate == 1) //Checkig for motion
  {
    digitalWrite(LED_BUILTIN, HIGH);
    client.publish("Office_PIR", "1");
    //timer.restartTimer(timerPIR);     //Creates Error 
    //void restartTimer(int timerPIR);  //Doesn't work(maybe because the second timer doesn't work), but also does not creates error
  }
  else
  {
    digitalWrite(LED_BUILTIN, LOW);
    client.publish("Office_PIR", "0");
  }
  lastPIRstate = PIRstate;
}

void loop() 
{
  //Initiates timers to control function calls
  timer.run();
  //MQTT
  client.loop();
  //OTA
  ArduinoOTA.handle();
}

The error I get with the first attempt to restart the timer 'timer.restartTimer(timerPIR);' is:
"no matching function for call to 'SimpleTimer::restartTimer(SimpleTimer&)'

I do not get an error with 'void restartTimer(int timerPIR);' however it doesn't work either.

Perhaps both of these conditions are because I am not actually creating the timerPIR. I have noticed that timerPIR does not appear to do anything.

I am having trouble interpreting the examples and the instructions for this library. I have seen several versions of "SimpleTimer" however I am successfully using this version in several other sketches with single timers and no restart functions.

For this reason I would prefer to continue with this library, or at least a code compatible fork.

did you check out the example for void restartTimer(int timerId) on that page?

according to that example you need to declare an additional variable that will store the created timers index. it also appears that you cannot create more that one instance of timer

ie for example

//as global variables
int timer_id[5];


//in setup
    timer_id[0] = timer.setInterval(3000, readSensor);
    timer_id[1] =  timer.setInterval(3000, sendMQTT);
    timer_id[2] =  timer.setInterval(5000, checkPIR);
    timer_id[3] =  timer.setInterval(180000, sendIFTTT); //using timer in place of timerPIR

//then to restart 'timerPIR' would be 
timer.restartTimer(timer_id[3]);

I used as array here but if all you are interested to restart is only 'timerPIR' you could as well have only an int global variable called timerPIR in place of timer_id[3] in the above snippet.

hope that helps....

Thanks, I will give that a try.

I did see the timer_id[] example, but couldn't understand how to ge tit to work.

The other timers do work as intended, with different trigger time points.

**Update

It works! Thanks!