Help with Node Red Flow using Timer

I have created a flow in NR with the purpose of toggling a helper Boolean to indicate if my wife or I are home. The boolean uses an mqtt stream from my wireless network that sends updates every 10 seconds when each of our phones are seen by the network. This means we are home or the boolean is “on”.

In the flow I am trying to use a timer node that is set to 30 seconds so that if the mqtt message does not trigger the boolean to on, the timer will turn it to off. Seems simple enough but for some reason the timers are not working correctly, or more likely, I have something configured incorrectly. Seems to be that the timer node is not resetting when a new msg is received as I’d expect it to.

Please let me know what I’m missing here. Have tried a few ways of doing this with no luck.

[{"id":"54b0c9ab4384b63c","type":"tab","label":"Presence Detection","disabled":false,"info":"MQTT stream from Meraki to determine if Jerry or Kelli are home. \n\nMQTT stream every 10 seconds when iphone is seen by the network.  Updates input boolean helper to toggle \"on\" state.   \n\n30 second timer starts whenever the MQTT messages stop which will then toggle the helper to off. ","env":[]},{"id":"616182ca6cc08c14","type":"mqtt in","z":"54b0c9ab4384b63c","name":"MQTT Subscriber","topic":"mqtt/meraki","qos":"0","datatype":"json","broker":"10f0a1b342022761","nl":false,"rap":true,"rh":0,"inputs":0,"x":100,"y":100,"wires":[["ae87a50a0dc4e7d0"]]},{"id":"d3ae8edabb77286e","type":"debug","z":"54b0c9ab4384b63c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":910,"y":180,"wires":[]},{"id":"ae87a50a0dc4e7d0","type":"switch","z":"54b0c9ab4384b63c","name":"","property":"payload.clientMac","propertyType":"msg","rules":[{"t":"eq","v":"72:8C:CB:EC:27:E7","vt":"str"},{"t":"eq","v":"C2:D3:06:4A:44:25","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":330,"y":100,"wires":[["069a911fbbf06dfc"],["24e0deadcade1f21"]]},{"id":"069a911fbbf06dfc","type":"api-call-service","z":"54b0c9ab4384b63c","name":"","server":"fca0097c.d25db8","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.jerry_home","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"30","valueType":"str"}],"queue":"none","x":640,"y":40,"wires":[["d3ae8edabb77286e","bb82e7914a1f9208"]]},{"id":"51ab2c59843872ae","type":"api-call-service","z":"54b0c9ab4384b63c","name":"","server":"fca0097c.d25db8","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.jerry_home","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":320,"wires":[["d3ae8edabb77286e"]]},{"id":"24e0deadcade1f21","type":"api-call-service","z":"54b0c9ab4384b63c","name":"","server":"fca0097c.d25db8","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.kelli_home","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"30","valueType":"str"}],"queue":"none","x":620,"y":100,"wires":[["d3ae8edabb77286e","72b3363c11d1b6f4"]]},{"id":"bfd3be0b9ce4d850","type":"api-call-service","z":"54b0c9ab4384b63c","name":"","server":"fca0097c.d25db8","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.kelli_home","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":260,"wires":[["d3ae8edabb77286e"]]},{"id":"bb82e7914a1f9208","type":"stoptimer","z":"54b0c9ab4384b63c","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":330,"y":260,"wires":[["bfd3be0b9ce4d850"],[]]},{"id":"72b3363c11d1b6f4","type":"stoptimer","z":"54b0c9ab4384b63c","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":350,"y":320,"wires":[["51ab2c59843872ae"],[]]},{"id":"10f0a1b342022761","type":"mqtt-broker","name":"","broker":"https://192.168.128.244","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"fca0097c.d25db8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

I’d use a trigger node for this. Using the payload you only need one call service per person

[{"id":"d8b7e229ded58832","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1190,"y":1780,"wires":[["c6e7095b198ee889"]]},{"id":"c6e7095b198ee889","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_{{payload}}","entityId":"input_boolean.123","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":1780,"wires":[[]]},{"id":"e04a7299074ede92","type":"switch","z":"f80b6c338afd5483","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"},{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":1820,"wires":[["d8b7e229ded58832"],["f0f559b587cdbab4"]]},{"id":"cc242571803221b6","type":"mqtt in","z":"f80b6c338afd5483","name":"","topic":"","qos":"2","datatype":"auto","nl":false,"rap":true,"rh":0,"inputs":0,"x":790,"y":1820,"wires":[["e04a7299074ede92"]]},{"id":"f0f559b587cdbab4","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1190,"y":1860,"wires":[["e94b18bab35aec5b"]]},{"id":"e94b18bab35aec5b","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_{{payload}}","entityId":"input_boolean.123","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":1860,"wires":[[]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]