buglss / node-red-crontinject

It is an extended clone of core inject node with cronti package.
Apache License 2.0
2 stars 1 forks source link

[BUG] crontime triggered twice times at the same time #24

Open alexneo2003 opened 4 months ago

alexneo2003 commented 4 months ago

Home Assistant:

I am using crontime type and it sometimes have triggered twice at the same time, look at the debug log on the screen

Screenshot 2024-06-28 at 16 15 15
buglss commented 4 months ago

@alexneo2003 Can you share the json of this stream? Can you tell me about Home Assistant? I did not encounter this bug in my own tests.

image
alexneo2003 commented 4 months ago

@alexneo2003 Can you share the json of this stream? Can you tell me about Home Assistant? I did not encounter this bug in my own tests.

My HA it's self-installed instance on the OrangePI I don't have much of devices, I'm just started my way) I have disabled all my flows and have tried to reproduce flow when it happened

[{"id":"c2cf08aacbfa011d","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"baeef182f5efeb33","type":"crontinject","z":"c2cf08aacbfa011d","name":"cron fake","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","crontiMethod":"onCrontime","crontiArgs":"[\"*/1 * * * *\"]","inputs":0,"hasButton":true,"x":830,"y":120,"wires":[["8bd9727d6e46bf6b"]]},{"id":"8bd9727d6e46bf6b","type":"debug","z":"c2cf08aacbfa011d","name":"debug 17","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1040,"y":120,"wires":[]},{"id":"630f96774af17caf","type":"telegram command","z":"c2cf08aacbfa011d","name":"/ping","command":"/ping","description":"Ping","registercommand":true,"language":"","scope":"default","bot":"2cf3ec881d3daa28","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":570,"y":300,"wires":[["be01bc14f93402d8","ff84a99386478b2c"],[]]},{"id":"be01bc14f93402d8","type":"function","z":"c2cf08aacbfa011d","name":"typing","func":"const chatId = msg.payload.chatId || 130992084\n\nconst payload = {}\n\npayload.chatId = chatId\npayload.type = \"action\"\npayload.content = \"typing\"\n\nmsg.payload = payload\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":360,"wires":[["a7e2f11462062395"]]},{"id":"a7e2f11462062395","type":"telegram sender","z":"c2cf08aacbfa011d","name":"","bot":"2cf3ec881d3daa28","haserroroutput":false,"outputs":1,"x":1170,"y":300,"wires":[[]]},{"id":"ff84a99386478b2c","type":"delay","z":"c2cf08aacbfa011d","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":760,"y":280,"wires":[["da239b75bc0eb31c"]]},{"id":"da239b75bc0eb31c","type":"function","z":"c2cf08aacbfa011d","name":"pong","func":"const chatId = msg.payload.chatId\n\nconst payload = {}\n\npayload.chatId = chatId\npayload.type = \"message\"\npayload.content = \"pong\"\n\nmsg.payload = payload\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":280,"wires":[["a7e2f11462062395"]]},{"id":"69fd984bee086c88","type":"inject","z":"c2cf08aacbfa011d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":600,"y":180,"wires":[["ff84a99386478b2c"]]},{"id":"2cf3ec881d3daa28","type":"telegram bot","botname":"HomeAssistant2342_bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"3000","usesocks":false,"sockshost":"","socksprotocol":"socks5","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

Screenshot 2024-07-07 124317

Screenshot 2024-07-07 125108

SindreLindahl commented 2 months ago

This happens to me too very rarely, for example when set to run once per hour, it can happen perhaps once per day that it triggers 2 messages.

buglss commented 2 months ago

@SindreLindahl Thank you for your feedback.

@alexneo2003 @SindreLindahl I will take action on this as soon as possible.