I found out that a “recreation” helps here. Means open the “TelegramReceiverDevice” and save it. The Telegram listener will be stopped and that started again. Now it will work for a while.
Maybe this restart of the listener can be achieved by an api command as well?
-
New plugin for Telegram
-
since today I have a problem starting pimatic with the telegram bot. Seems to be sth with the connection to telegram - or? Internet etc. is working fine… Some ideas here?
[bot.error.webhook] { [Error: socket hang up] code: 'ECONNRESET', __trace: 'Error: From connect\n at TLSSocket.connect (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:55:29)\n at Object.TLSSocket._init.ssl.onclienthello.ssl.oncertcb.exports.connect (_tls_wrap.js:1048:11)\n at Agent.createConnection (https.js:79:22)\n at Agent.createSocket (_http_agent.js:188:16)\n at Agent.addRequest (_http_agent.js:157:23)\n at new ClientRequest (_http_client.js:142:16)\n at Object.exports.request (http.js:31:10)\n at Object.socket.once.exports.request (https.js:189:15)\n at Request.start (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:747:32)\n at Request.end (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:1506:10)\n at end (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:560:14)\n at Immediate._onImmediate (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:574:7)\n at processImmediate [as _immediateCallback] (timers.js:396:17)' }
-
Very strange but it works as expected, today. So by now it is fine
-
I try to send messages to my bot. I get every time the issue that i must enter my passcode… I receive messages via my bot and admin in plugin settings are set… I don’t set a rule at the moment. But help didn’t work either…
-
Hi guys,
During startup of Pimatic I can see an error logged in the logfile:
12:22:42.226 [pimatic-telegram] debug: Listener enabled ruleset command: ' test ' 12:22:42.229 [pimatic-telegram] debug: TelegramReceiverDevice::constructor => Mapping Telegram predicate command: test to TelegramActionHandler for rule.id: telegram-test 12:22:42.365 [pimatic-telegram] debug: Listener enabled ruleset command: ' Iemand ' 12:22:42.366 [pimatic-telegram] debug: TelegramReceiverDevice::constructor => Mapping Telegram predicate command: Iemand to TelegramActionHandler for rule.id: telegram-karin-thuis (node) warning: possible EventEmitter memory leak detected. 201 variableValueChanged listeners added. Use emitter.setMaxListeners() to increase limit. Trace at VariableManager.addListener (events.js:239:17) at VariableManager.notifyOnChange (/home/pi/pimatic-app/node_modules/pimatic/lib/variables.coffee:748:8) at /home/pi/pimatic-app/node_modules/pimatic-chronotherm/chronotherm.coffee:221:29 at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:693:18) at Promise._fulfill (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:638:18) at null._onTimeout (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/timers.js:26:46) at Timer.listOnTimeout (timers.js:92:15)
It looks like this can be solved by:
Use emitter.setMaxListeners() to increase limit.
How do I do this?
-
I’m getting the following errors when sending messages:
19:35:43 error [pimatic-telegram]: [BotClient] Error: Message was NOT sent to all recipients 19:35:43 error [pimatic-telegram]: [Message] Sending Telegram "Supermarkt-Tankstelle 1.159" to Hans: failed; reason: Not Found 19:35:43 info [pimatic-telegram]: { ok: false, error_code: 404, description: 'Not Found' }
with this rule:
when $prices.dieselMin gets updated send text telegram to Hans "$prices.dieselLocation $prices.dieselMin"
-
@hanss said in New plugin for Telegram:
I’m getting the following errors when sending messages:
19:35:43 error [pimatic-telegram]: [BotClient] Error: Message was NOT sent to all recipients 19:35:43 error [pimatic-telegram]: [Message] Sending Telegram "Supermarkt-Tankstelle 1.159" to Hans: failed; reason: Not Found 19:35:43 info [pimatic-telegram]: { ok: false, error_code: 404, description: 'Not Found' }
with this rule:
when $prices.dieselMin gets updated send text telegram to Hans "$prices.dieselLocation $prices.dieselMin"
Experience same problems with sending pictures.
-
Prob is solved for the moment. Had a typo in the chatID.
-
i used pimatic the last time 1-2 years ago. everything working well etc.
today i tried to setup a new rpi and i just cant get telegram plugin to work. its not loading, status is only “activated”, i put in in all data in the config but its not “loaded” which makes me not able to create a telegramreceiverdevice. any suggestions?
-
@bertreb said in New plugin for Telegram:
Did you change your node version and what does the debug say (deamon.log), just before the plugin isn’t loading?
thanks for the fast reply. nope i used standard installation procedere. i tried to install manually again, see here:
pi@raspberrypi:~/pimatic-app $ sudo npm install pimatic-telegram
npm WARN engine pimatic-telegram@1.1.14: wanted: {“node”:">=8.0.0",“npm”:">1.1.x"} (current: {“node”:“4.6.2”,“npm”:“2.15.11”})
npm WARN engine telegraf@3.38.0: wanted: {“node”:">=8"} (current: {“node”:“4.6.2”,“npm”:“2.15.11”})
npm WARN engine debug@4.3.1: wanted: {“node”:">=6.0"} (current: {“node”:“4.6.2”,“npm”:“2.15.11”})let me check daemon.log asap
-
@bertreb it seems theres something wrong in the config, but i dont see any errors in the config file
16:48:07.119 2021-05-24 Monday
16:48:14.062 [pimatic] Starting pimatic version 0.9.54
16:48:14.073 [pimatic] Node.js version 4.6.2
16:48:14.075 [pimatic] OpenSSL version 1.0.2j
16:48:16.670 [pimatic, ppm] 2.15.12
16:48:16.715 [pimatic] Loading plugin: “pimatic-cron” (0.8.8)
16:48:17.292 [pimatic] Loading plugin: “pimatic-mobile-frontend” (0.9.16)
16:48:18.175 [pimatic] Loading plugin: “pimatic-tplink-smartplug” (0.0.8)
16:48:18.829 [pimatic] Loading plugin: “pimatic-telegram” (1.1.14)
16:48:18.892 [pimatic] Unexpected token {
16:48:18.972 [pimatic-cron] the time is: Mon May 24 2021 16:48:18 GMT+0100 (BST)
16:48:18.983 [pimatic-tplink-smartplug] Starting pimatic-tplink-smartplug plugin
16:48:19.626 [pimatic-mobile-frontend] packing static assets
16:48:20.160 [pimatic-mobile-frontend] packing static assets finished
16:48:20.169 [pimatic-mobile-frontend] rendering html -
i now made a fresh install of my raspberry and reinstalled everything from scratch… still the same error of this unexpected token
-
I did a test with node 4.9.1 and Telegram. I got the same error.
I seems a higher node version is needed to get Telegram working.
If possible you should use the latest version of node 10 (10.24.1)The reason for this is probably an underlaying library of Telegram, changed and updated the minimum node requirement.
Current node v4 installs will have no problem but for new node v4 installs this will fail. -
@bertreb said in New plugin for Telegram:
I did a test with node 4.9.1 and Telegram. I got the same error.
I seems a higher node version is needed to get Telegram working.
If possible you should use the latest version of node 10 (10.24.1)The reason for this is probably an underlaying library of Telegram, changed and updated the minimum node requirement.
Current node v4 installs will have no problem but for new node v4 installs this will fail.thanks! i installed using this commands
https://pimatic.teamemo.com/Guide/Getting-Startedand it worked!
now i just cant send any commands because in telegram the bot says “please provide passcode first and reissue your command after” but i didnt set any passcode at all?
-
btw my user id is enabled and admin in telegram pimatic settings
-
its working now, i had to manually set the “secret” in the config file