Telegrambot action no response from User input

Hi All

I have built a flow for my home automation that involves topping up my battery backup from the grid if the SoC is below a certain %. Issue I have is that the inline keyboard goes to the send response which has to wait for the callback query before it can take action, is there a node that I can use so that the after the inline keyboard send response goes to a timer for x amount of minutes. If a response is received from the callback query stop timer if not take a default action but still send a telegram message at the end. I have tried the stoptimer node but if it sends the original msg or the new on the 2nd output is still triggered

Here is my flow below. Any assistance will be appreciated or the point to a node that can do this

[{"id":"f6c0f5eb2bc99e83","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"e71e3e536586b597","type":"function","z":"f6c0f5eb2bc99e83","name":"check logic","func":"if (msg.payload.content === '100') {\n    msg.payload.content = 'Consider it done';\n    return [msg, null];\n} else {\n    msg.payload.content = 'Not charging from Grid';\n    return [null, msg];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":180,"wires":[["1cb2184377ae8005"],["1cb2184377ae8005"]],"outputLabels":["on","off"]},{"id":"a76c4f879dc2d0b9","type":"stoptimer","z":"f6c0f5eb2bc99e83","duration":"20","units":"Second","payloadtype":"str","payloadval":"100","name":"Test","x":810,"y":240,"wires":[["e71e3e536586b597"],["1085206671de1f27"]],"outputLabels":["MSG ORIGINAL","NO RESPONE"]},{"id":"8825da91beccaeda","type":"telegram sender","z":"f6c0f5eb2bc99e83","name":"Send Consider it done","bot":"8871744076731a70","haserroroutput":false,"outputs":1,"x":1460,"y":140,"wires":[["a0df0cb6e3c347d3"]]},{"id":"1cb2184377ae8005","type":"function","z":"f6c0f5eb2bc99e83","name":"check answer and respond","func":"if (msg.originalMessage.data === '100') {\n    msg.payload.chatId = msg.payload.chatId;\n    msg.payload.content = 'Consider it done';\n    msg.payload.type = \"message\";\n    return [msg, null];\n} else {\n    msg.payload.content = 'Not charging from Grid';\n    msg.payload.chatId = msg.payload.chatId;\n    msg.payload.type = \"message\";\n    return [null, msg];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1200,"y":180,"wires":[["8825da91beccaeda"],["4d0c55001f6c32a4"]],"outputLabels":["on","off"]},{"id":"4d0c55001f6c32a4","type":"telegram sender","z":"f6c0f5eb2bc99e83","name":"Send Not charging from Grid","bot":"8871744076731a70","haserroroutput":false,"outputs":1,"x":1480,"y":200,"wires":[[]]},{"id":"a0df0cb6e3c347d3","type":"api-current-state","z":"f6c0f5eb2bc99e83","name":"Set Work mode Capacity 6 100%","server":"9405c3fe.d0a6c","version":3,"outputs":2,"halt_if":"80","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.battery_state_of_charge","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"100","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1710,"y":140,"wires":[["1906d35aeb687bc6"],[]]},{"id":"1906d35aeb687bc6","type":"mqtt out","z":"f6c0f5eb2bc99e83","name":"capacity_point_6/set","topic":"solar_assistant_crazymonkeys/inverter_1/capacity_point_6/set","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"51541b5ac102df97","x":2000,"y":140,"wires":[]},{"id":"160c72eb19de7d41","type":"telegram sender","z":"f6c0f5eb2bc99e83","name":"send keyboard","bot":"8871744076731a70","haserroroutput":false,"outputs":1,"x":612,"y":180,"wires":[["a76c4f879dc2d0b9"]]},{"id":"7d7614230230ee54","type":"telegram event","z":"f6c0f5eb2bc99e83","name":"callback query ","bot":"8871744076731a70","event":"callback_query","autoanswer":true,"x":602,"y":240,"wires":[["a76c4f879dc2d0b9"]]},{"id":"7b54ef30b8371d27","type":"function","z":"f6c0f5eb2bc99e83","name":"function 4","func":"var status = msg.payload\nvar opts = {\n    reply_markup: JSON.stringify({\n        \"inline_keyboard\": [[\n            {\n                \"text\": \"Ok set to charge from Grid\",\n                \"callback_data\": \"100\"\n            },\n            {\n                \"text\": \"NO!\",\n                \"callback_data\": \"4\"\n            }]\n        ]\n    })\n};\nmsg.payload = {\n    chatId: \"\",\n    type: 'message',\n    content: status,\n    options: opts,\n}\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":452,"y":180,"wires":[["160c72eb19de7d41"]]},{"id":"5c66aa622970e484","type":"change","z":"f6c0f5eb2bc99e83","name":"Msg Charge from Eskom","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Should Battery be set to charge to \" & $.payload & \"% before loadshedding commences in 60min? 'Yes' or 'No'\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":180,"wires":[["7b54ef30b8371d27"]]},{"id":"87515fb2f0dc2612","type":"inject","z":"f6c0f5eb2bc99e83","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"str","x":70,"y":180,"wires":[["5c66aa622970e484"]]},{"id":"1085206671de1f27","type":"debug","z":"f6c0f5eb2bc99e83","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1020,"y":260,"wires":[]},{"id":"8871744076731a70","type":"telegram bot","botname":"CrazyMonkeys Bot","usernames":"SIMarais","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksprotocol":"socks5","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":true},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant CrazyMonkeys","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"51541b5ac102df97","type":"mqtt-broker","name":"Solar Assistant","broker":"192.168.1.174","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.