fabianonline / octoprint-telegram Goto Github PK
View Code? Open in Web Editor NEWPlugin for octoprint to send status messages and receive commands via Telegram messenger.
Plugin for octoprint to send status messages and receive commands via Telegram messenger.
If nothing's printing and I send the /status command, there is no response. It looks like the TelegramSendNotPrintingStatus
event isn't being handled in init.py (around line 346).
The plugin should also allow the user to get a notification on pause and on resume.
I aborted a print this morning, and I noticed that while the target temps (bed and extruder) both correctly reset to "0.0", the current temps are showing un-moving values of 60.03 / 209.76. I've sent a handful of "/status" commands to the bot over the past half hour, and the temps are always reported as the following:
Not printing.
Bed 60.03/0.0, Extruder 209.76/0.0.
I would expect it to show Bed 20 / 0.0 Extruder 0 / 0.0 (I assumed Bed would be 20 at room temp but you get the idea).
Is this intentional or a bug?
Thanks,
Jeff
I run the latest version of the Telegram plugin (1.4.0) on the latest version of Octoprint (1.3.0) and I can't save/change my settings for some reason.
I've managed to add my Telegram Token and save the settings but now it doesn't accept anymore changes to the Telegram settings.
I've tried to reinstall the plugin but it remembered my old token settings so it wasn't fully uninstalled? Is this an issue with permissions on the settings file?
can you add /connect command to sys list, so we can connect the printer to the raspberry (running octoprint) trought telegram?
thanks
The image sent from the bot has another orientation like the stream in the control tab when i change the orientation of the webcam in the octoprint settings. How can i fix that?
Better tracking of printer connection state for plugins and scripts:
See also #13
E.g. update it whenever a new token is entered.
From extruderCat on twitter:
could you add a "read-only" option for groups in the Octoprint Telegram plugin? Would be nice for a helper or customers.
in Octoprint versions < 1.3.0 the whole telegram settings data structure was passed to on_settings_save(). In 1.3.0 only the changed data is passed.
Any way to send system commands? IE w the systems command editor I now have a power on/off menu item. This triggers a gpio command to turn on a relay and power the printer.
Dude, here is a great feature to your grate plugin would be the ability to specify for each printing file or folder(octoprint 1.3.0rc) to whom send notifications.
This feature will help to notify clients the status of their printing files or folders in case they have more then one file to print.
Hi,
i'm quite excited about your plugin! Great work!
I experimented with your plugin-code and added a feature (/campic) which just sends a picture of the printer's cam regardless of the current printing state.
Not sure if you wanna implement it:
elif command==gettext("/campic"): self.main.track_action("command/campic") self.main._send_msg("Ok, here we go you little stalker...", with_image=True)
If connecting to an active octoprint-session, and going up 10mm on Z without homing, the bot automatically messages:
Printing at Z=-10.0. Bed 26.0/0.0, Extruder 21.9/0.0. 00:00:00, 0% done, 00:00:00 remaining.
While all messages are customized to german language, this message is probably somewhere hardcoded and a little bit missleading.
not getting images (which work thru octoprint just fine, both video and snapshot). settings request images for /status, (start/stop/etc). none of them produce images.
here's the relevant debug info for the /status request:
(odd that there's a with_image=True, and a snapshot url followed by a Sending without image):
2016-09-25 07:14:33,698 - octoprint.plugins.telegram.listener - INFO - Got a command: '/help' with parameter: '' in chat 295263708
2016-09-25 07:14:40,625 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:15:08,029 - octoprint.plugins.telegram.listener - INFO - Got a command: '/list' with parameter: '' in chat 295263708
2016-09-25 07:16:16,278 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:17:28,620 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:17:55,001 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:24:37,374 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:33:29,551 - octoprint.filemanager.analysis - INFO - Starting analysis of local:testblock.gcode
2016-09-25 07:38:37,489 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:44:39,310 - octoprint.plugins.telegram.listener - DEBUG - MESSAGE: {u'message': {u'from': {u'first_name': u'Jim', u'last_name': u'Gale', u'id': 295263708}, u'text': u'/status', u'entities': [{u'length': 7, u'type': u'bot_command', u'offset': 0}], u'chat': {u'first_name': u'Jim', u'last_name': u'Gale', u'type': u'private', u'id': 295263708}, u'date': 1474789479, u'message_id': 21}, u'update_id': 785575775}
2016-09-25 07:44:39,312 - octoprint.plugins.telegram.listener - INFO - Got a command: '/status' with parameter: '' in chat 295263708
2016-09-25 07:44:39,314 - octoprint.plugins.telegram - DEBUG - Got an event: StatusNotPrinting Payload: {}
2016-09-25 07:44:39,319 - octoprint.plugins.telegram.TMSG - DEBUG - Printer Status{'progress': {'completion': 100, 'printTime': 273, 'filepos': 7856L, 'printTimeLeft': 0}, 'state': {'text': 'Operational', 'flags': {'operational': True, 'paused': False, 'printing': False, 'sdReady': False, 'error': False, 'ready': True, 'closedOrError': False}}, 'offsets': {}, 'job': {'estimatedPrintTime': 32.14438007491633, 'filament': {'tool0': {'volume': 0.0, 'length': 1.5529000000000004}}, 'averagePrintTime': 273.83736085891724, 'file': {'origin': 'local', 'date': 1474788809, 'name': u'testblock.gcode', 'size': 7856L}, 'lastPrintTime': 273.83736085891724}, 'currentZ': 10.0}
2016-09-25 07:44:39,320 - octoprint.plugins.telegram.TMSG - DEBUG - TEMPS - {'bed': {'actual': 41.2, 'target': 0.0, 'offset': 0}, 'tool2': {'actual': 58.5, 'target': 0.0, 'offset': 0}, 'tool1': {'actual': 50.9, 'target': 0.0, 'offset': 0}, 'tool0': {'actual': 84.7, 'target': 0.0, 'offset': 0}}
2016-09-25 07:44:39,322 - octoprint.plugins.telegram.TMSG - DEBUG - Sending Notification: Not printing.
Bed 41.2/0.0, Extruder 84.7/0.0.
2016-09-25 07:44:39,324 - octoprint.plugins.telegram - DEBUG - Sending a message: Not printing.\nBed 41.2/0.0, Extruder 84.7/0.0. with_image=True chatID= 295263708
2016-09-25 07:44:39,326 - octoprint.plugins.telegram - DEBUG - Snapshot URL: /webcam/?action=snapshot
2016-09-25 07:44:39,331 - octoprint.plugins.telegram - DEBUG - data so far: {'disable_web_page_preview': True, 'reply_markup': '{"hide_keyboard": true}'}
2016-09-25 07:44:39,332 - octoprint.plugins.telegram - DEBUG - Sending without image.. 295263708
2016-09-25 07:44:40,346 - octoprint.plugins.telegram - DEBUG - Sending finished. 200
2016-09-25 07:44:40,352 - octoprint.plugins.telegram.listener - DEBUG - listener: sending request with offset 785575776...
2016-09-25 07:44:51,850 - octoprint.plugins.telegram - DEBUG - Testing token 111111111:AAAa1aAAAaA1AA-AAaAAaAAAaA1aAAAA1A1
2016-09-25 07:45:11,217 - octoprint.plugins.telegram.listener - DEBUG - listener: sending request with offset 785575776...
2016-09-25 07:45:42,125 - octoprint.plugins.telegram.listener - DEBUG - listener: sending request with offset 785575776...
I would love too also receive a picture if I send the /status command, even if the printer is disconnected.
Usually, at least in my case, the webcam remains connected to the Octoprint server and pointed to the 3D printer even if the printer is offline.
Thanks!
With 1.3.1 and when trying to send a gcode file.
2016-05-22 22:29:54,880 - octoprint.plugins.telegram.listener - ERROR - Exception caught! local variable 'data' referenced before assignment
Right now the plugin has Pillow as dependency - just to rotate the pictures from the webcam if necessary. But it is a really huge dependency taking a looooooong time to install on a Raspberry 1. Perhaps there is something more lightweight we could use for this task?
Show folder structure in file browser of telegram plugin.
First, thanks for the fantastic plugin!
I'd like to be able to specify which messages to send. For example I don't need the "printer shutdown" or "printer started" notifications, but there is no way to disable them.
Hi. Have this plugin installed and it is working great. Is there any way that as a part of the status message it can report what layer its on? Such as layer # of #. Thanks.
Got an exception while initially trying to connect to telegram: Telegram returned error code 401: [Error]: Unauthorized.
I do get the messages when the Octopi is started or while printing like i set it up, but the bot does not respond to my requests. Neither the abort request nor the help one.
Did i do anything wrong?
I have been unable to save changes in settings for this plugin since after I upgraded for the first time (the first installation was ok). The only thing that I can save is the chat id, nothing else gets saved (can't even enable debugging). Tried uninstalling and removing everything from the config-file, still same problem.
I can't get past the "save first or trashcan-click".
Running version 1.3.0.dev1245+gcba742a (devel branch).
a command /connect would be useful to allow the user to connect the printer if Octoprint is not configured to connect automatically (e.g. to be safe against Octoprint ruining prints started via the printer control panel)
Hi,
I have a Token valid for my bot (status appear in greend and ok)
I send a message to bot, chat appear in the list, but if i click on pencil, nothing happend. i cant check boxes.
I use Firefox,
Regards
After I upgraded Telegram. I'm receiving "You are not allowed to do this! ๐ฌ" alert whenever I try to send a command. In octiprint the Chat user has the correct rights.
It seems that I can start as print but not /resume it.
Neither can I /pause it, when I detect something is odd and want to have the printer wait until I come back to fix it without loosing the half-finished print.
Alternative /toggle_pause (a _printer.pause_print() and _printer.resume_print() are part of the next Octoprint release)
I will be happy to implement this myself and do a pull request. (I was planning to do this same bot before you put it on GitHub here).
My idea is to allow the user to put a comma-separated list of chat-id
like:
2400321, 930323
And allow commands from any of the specified chats.
Do you think that this would be a good approach? It needs minimal changes to the UI. If it makes sense, I will proceed to work on it.
Running Version: 1.3.0.dev895+gb1711f3 (devel branch)
After I've saved the token, I can't save anything else. If i delete the token, I can save the other settings for Telegram. Maybe because my token contains a ":"?
2016-03-09 21:38:28,053 - octoprint.server.api.settings - ERROR - Could not save settings for plugin Telegram Notifications (1.0.0)
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.0.dev895_gb1711f3-py2.7.egg/octoprint/server/api/settings.py", line 300, in _saveSettings
plugin.on_settings_save(data["plugins"][plugin_id])
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_telegram/init.py", line 225, in on_settings_save
data['token'] = data['token'].strip()
KeyError: 'token'
While trying to upgrade OctoPrint-Telegram from version 1.1.1 to 1.3.1 I get the following error:
Update failed!
The update did not finish successfully. Please consult the log for details.
The log contains the following error:
2016-05-20 20:06:50,088 - octoprint.plugins.softwareupdate - ERROR - Update of telegram can not be performed
Traceback (most recent call last):
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.2.11-py2.7.egg/octoprint/plugins/softwareupdate/__init__.py", line 637, in _perform_update
update_result = updater.perform_update(target, check, target_version)
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.2.11-py2.7.egg/octoprint/plugins/softwareupdate/updaters/pip.py", line 50, in perform_update
install_arg = check["pip"].format(target_version=target_version)
KeyError: 'target'
I'm running OctoPrint Version: 1.2.11 (master branch)
The update via octoprint - Version: 1.3.0.dev1047+g5a5d29b (devel branch) - fails.
Here the relevant part from the logfile:
2016-05-19 22:59:07,686 - octoprint.plugins.softwareupdate - INFO - Starting update of telegram to 1.3.0...
2016-05-19 22:59:07,706 - octoprint.plugins.softwareupdate - ERROR - Update of telegram can not be performed
Traceback (most recent call last):
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.0.dev1047_g5a5d29b-py2.7.egg/octoprint/plugins/softwareupdate/init.py", line 666, in _perform_update
update_result = updater.perform_update(target, populated_check, target_version, log_cb=self._log)
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.0.dev1047_g5a5d29b-py2.7.egg/octoprint/plugins/softwareupdate/updaters/pip.py", line 66, in perform_update
install_arg = check["pip"].format(target_version=target_version)
KeyError: 'target'
Thanks for the great bot, I use it to monitor prints while at work. A feature I'd think would be neat is the ability to send the bot a .gcode file and start a print. If I could do that then I'd be able to close the ports to the web interface externally and do everything through the bot.
"Installed: 1.1.2, available 1.2.1" => "Everything is up to date."
At least on iOS Telegram notification on the lock screen just says that the bot has sent a photo. If the bot would first send the image and then the status, I could see the status on my lock screen.
With Octoprint 1.3.0 there comes a setup wizzard. Use this for first setup of bot token.
Hey,
I have enabled Z-hop on retract (0.1mm). My plugin has the default config of notifying me every 5mm in Z oder every 15 minutes.
I wondered why I get 2 messages sent shortly after each other each time a message is sent.
Then I saw that the first message has a greater Z height than the second, mostly something like:
Since I have used a layer height of 0.15mm and a Z-hop on retract of 0.1mm and have enabled the "force retract on layer change" it would totally make sense that the plugin is triggered twice with a very short time difference.
Anything I can do to help?
OctoPint 1.2.9
OctoPrint-Telegram 1.0.0
The GCODE I printed is attached.
serenity_no_panels_sliced_top.gcode.txt
Popup shows that update is available. Click on update, get error message that update fails.
Octolog shows this error;
2016-05-17 19:29:08,873 - octoprint.plugins.softwareupdate - INFO - Starting update of telegram to 1.3.0...
2016-05-17 19:29:08,935 - octoprint.plugins.softwareupdate - ERROR - Update of telegram can not be performed
Traceback (most recent call last):
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.2.11-py2.7.egg/octoprint/plugins/softwareupdate/init.py", line 637, in _perform_update
update_result = updater.perform_update(target, check, target_version)
File "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.2.11-py2.7.egg/octoprint/plugins/softwareupdate/updaters/pip.py", line 50, in perform_update
install_arg = check["pip"].format(target_version=target_version)
KeyError: 'target'
Since 1.3.0 supports folders, we want to upload files to a telegram folder for better overview.
A timer for the final image, currently it is already done before the bed and the printhead is moved to the end position.
Many thanks,
Georg
The user can modify all kinds of messages in the Octoprint settings dialog.
The status when not printing is there.
The status when printing is missing in the dialog.
A message after the first layer was printed, to see if it holds.
Many thanks,
Georg
can you add /feedrate to comand list? somenthing like 10% 25% 30% 40% 50% ecc trought bottons or trought input by keyboard.
thanks a lot
Running OctoPi on a Raspberry Pi 3
When trying to install the telegram plugin I am receiving the following error message. I believe I am following the correct procedure and have not found any helpful info in either this forum or google.
Please help...
pi@octopi:~/oprint/bin $ pip install https://github.com/fabianonline/OctoPrint-Telegram/archive/stable.zip
Downloading/unpacking https://github.com/fabianonline/OctoPrint-Telegram/archive/stable.zip
Downloading stable.zip (85kB): 85kB downloaded
Running setup.py (path:/tmp/pip-0tJZ6P-build/setup.py) egg_info for package from https://github.com/fabianonline/OctoPrint-Telegram/archive/stable.zip
Could not import OctoPrint's setuptools, are you sure you are running that under the same python installation that OctoPrint is installed under?
Complete output from command python setup.py egg_info:
Cleaning up...
Command python setup.py egg_info failed with error code 255 in /tmp/pip-0tJZ6P-build
Storing debug log for failure in /home/pi/.pip/pip.log
Hello,
when I set authorization on one user pressing pencil,
I have this error (on inspect element of Chrome):
Uncaught TypeError: Unable to process binding "checked: function (){return settings.settings.plugins.telegram.chats['269074525']
Do you can help me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.