@sirhc
thanks, it works
sometimes the solution is so easy.
-
New plugin for Telegram
-
1.1.5 is ready for consumption, with two new features, configurable via the device config page:
- Telegram Listener can be turned on and off in the frontend (If you add the Receiver device to your webpages)
- Confirmation messages on executing rule and device actions can be turned off (feature request @sirhc)
Three new config options have been introduced to support these features:
stateStartup: description: "Start Telegram Listener at Pimatic start?" type: "boolean" default: true confirmRuleTrigger: description: "Should the receiver send confirmation upon executing rule actions?" type: "boolean" default: true confirmDeviceAction: description: "Should the receiver send confirmation upon executing device actions?" type: "boolean" default: true
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
And 1.1.6 is on the floor: Added
send doc telegram ......
(request @Andi-Tudor)- Included file checking, max allowed file size is 50MB
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
Thanks for sending the document option.
-
I have installed the plugin today but I have a problem…
When I send “help” to pimatic there came no answer. I have restart pimatic several times but it doesn’t work.The debug says:
debug [pimatic-telegram]: Request ' help ' received, processing... 19:13:57info [pimatic-telegram]: Starting Telegram listener
So I can see that my “command” arrives in pimatic.
Here my config:
{ "apiToken": "xxxx", "debug": true, "recipients": [ { "name": "ViperAdmin", "userChatId": "xxxx", "enabled": true, "admin": true } { "secret": "xxx", "auth_timeout": 5, "stateStartup": true, "confirmRuleTrigger": true, "confirmDeviceAction": true, "id": "telegram-receiver", "name": "Telegram_Receiver", "class": "TelegramReceiverDevice" }
-
Hi there,
I like the new feature that you can disable the telegram listening. But there is one thing that could be better
If you disable the listening and after that send some requests nothing happens (correct). But than if you aktivate the listening, every requests (in the “disable time”) get an answer. It would be better, that Pimatic doesn’t answers these “old” request.
-
@flozen you are correct. The message queue is maintained and kept on the Telegram infrastructure. There is something to be said for purging the queue, as well as maintaining it. I will consider this, but i am not sure if this is the correct approach. Some may want to keep it, others may want to purge.
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
@Dan
Can"t you help me? See my post above. -
@V1per Did processing the password work normally? I would need to see more of your log, possibly including the startup trail to see if I can find something meaningful. You can find my email on my profile page (Better than polluting the forum) time is limited this weekend, so it may take a bit longer to support.
As a first step I would suggest to go into console mode and rm -rf Pimatic-Telegram in your node_modules folder and restart pimatic, to make sure nothing went wrong in the upgrade process. Your config will not be lost by doing this.
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
@V1per Another thing:
Are these two separate sections (Top one as plugin config in the plugin section, bottom one as device config in devices sections?
Looking at your config, I miss the active flag in your plugin section, maybe this helps !"apiToken": "xxxx", "active": "true", ......
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
@Dan First of all, this plugin is really nice and works like a charm! Thanks for that!
I just have one question if it is possible to read the sender of a triggered rule and send a text only to this sender again?
Currently the sender is fixed by the rule. Something like
when telegram recieved "Hello" than send text to telegramlistener.sender "Hi only to you"
-
Hey @techbarney! It would be time to give the bot a KI engine! Crossing with google api oder alexa to get answers
-
@Dan said in New plugin for Telegram:
@V1per Another thing:
"apiToken": "xxxx", "active": "true", ......
I have installed and configured the plugin over the webfontend of pimatic and the plugin is active.
But I have found the issue. It was my fault I have taken the wrong ID, I think it was the ID from the Bot not from my telegram account.
Now it works fantastic!!!
Thank you for this great plugin!!! -
@techbarney Currently I do not see how this can be achieved easily, as the rules are parsed at startup of the listener, and the sender will only be known when a message event is triggered.
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
@Dan Ok thanks so far for your answer! I didn’t know this so far, but I understand the problem
The only workaround that I was thinking about, to create for every sender an extra rule if it is possible in the when condition to check for a specific sender. -
@techbarney said in New plugin for Telegram:
@Dan Ok thanks so far for your answer! I didn’t know this so far, but I understand the problem
The only workaround that I was thinking about, to create for every sender an extra rule if it is possible in the when condition to check for a specific sender.Underdstand. I also thought about saving the sender in a variable…However this is tricky at best in a muti-user scenario, you could end up having personA sending the trigger, and personB getting the reply, due to the volatile nature of the variable. I do not see how I can make this more reliable. If any @developer has a good suggestion on how to achieve this use-case reliably within the architecture I would be open to it…
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
Would it be possible to trigger a action using telegram like “lights on” and just reply to the user who send the command a personal confirmation, like “lights are triggered on”
I’ve currently solved this by sending a message to everyone, but that might be a bit overkill.
-
@jovak89 There are two options:
- have Telegram send the default confirmation message
- as per your option, define a rule to send a custom confirmation message, optionally you can switch off the default confirmation messages in your telegram receiver device to prevent double messages on an action
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins -
thank you for the great plugin wich is working like a charm!
But i have one question.
I tried to change the pattern from “Passcode correct, timeout set to […]” after sending the password to sth. that is more familar to me like “Hey, whats up?” in the telegram.coffee file. Because there i found the string.
But after changing this the plugin is loading but got an error
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:1005:11)\n at Agent.createConnection (https.js:72:22)\n at Agent.createSocket (_http_agent.js:180:16)\n at Agent.addRequest (_http_agent.js:149: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:182:15)\n at Request.start (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:744:32)\n at Request.end (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:1435:10)\n at end (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:566:14)\n at Immediate._onImmediate (/home/pi/pimatic-app/node_modules/pimatic-telegram/node_modules/telebot/node_modules/request/request.js:580:7)\n at processImmediate [as _immediateCallback] (timers.js:383:17)' }"
sth with TLSSocket i think but i do not why. After deleting and reinstaling the plugin everything is fine again.
Is there a mistake by me? Or is there another way to change the patterns?
Thank You
-
@FritzBox360 If I understood correctly, you have only changed the string values
response.addContent(new ContentFactory("text", "Passcode correct, timeout set to " + instance.config.auth_timeout + " minutes. You can now issue requests"))
on line 376. In that case a relationship between the error and the string value is highly unlikely. (Auth timeout handled on application level (OSI network layer 7), error is generated on TLS (socket) level (OSI network layer 5 I believe). The error seems to indicate the secure connection between Pimatic and the API host was reset for whatever reason.Dan
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins