r/tasker • u/[deleted] • Nov 17 '15
How To [How to] Replicate Pushbullet features (Notification Mirroring / SMS / Clipboard)
With the ridiculous pricing of the newly announced "Pro" version of Pushbullet, I figured I might jot down the basics on how you could go about replicating its features (which were honestly pretty buggy and unreliable to begin with). You'll need a couple of plug-ins for this; the ones I use are Notification Listener (to catch notifications in Tasker) and AutoRemote (to send / receive messages from a computer).
Notification mirroring
Create a profile with the condition: Event > Plug-in > Notification Listener > Posted, and tick all the apps you'd like to include.
Then, in the task, have your phone send a message to your computer with AutoRemote. In the message, depending on how you want the mirrored notification to look, you'll have to include the variables passed to the task from Notification Listener. Something like this:
%nlapp = owner app name
%nltitle = notification title
%nltext = notification textThere are of course all sorts of things you could do with the AutoRemote message, such as including the app icon, setting it up to trigger other Tasker actions when you act on the computer notification, etc. but I'll leave all that since I'm on a Mac and have never been able to use any of that stuff.
SMS
Profile context: Event > Phone > Received Text, leave Sender and Content blank.
In the task, following the same principle as above, send an AutoRemote message to your computer with the relevant variables:
%SMSRF = sender's phone number
%SMSRN = contact name
%SMSRB = SMS text
%SMSRD = SMS date
%SMSRT = SMS timeI'll leave out how to send and / or reply to messages from the computer, since everyone's setup is different. Again, I'm on a Mac, so I'm using a combination of SSH and Applescript, which I'm guessing is not all that relevant to most people here. In most cases, though, you'd basically send an AutoRemote message to Tasker with the contact name / number and the message content (i.e. sms=:=Jane Doe=:=Hi! I'm John.) then parse and send it in the corresponding task.
Clipboard sync
To catch the phone's clipboard content, you'd have to setup a profile with this condition: Event > Variable > Variable Set > Variable: %CLIP, Value: [leave empty]. This will trigger every time the clipboard is set.
As for the task, it really depends on how things are set up on your computer. AutoRemote communicates with my Mac via SSH, so I can easily send a message with a shell command to set the clipboard to %CLIP. How exactly you would do it on a PC, I'm not sure, but I'm guessing you'd have to use AutoRemote in conjunction with Eventghost. The basic principle, in any case, is to pass the Tasker variable %CLIP to the computer.
As for the other way around, i.e. passing the computer clipboard to Tasker, all you would need technically is to send an AutoRemote message to catch in Tasker with a "Set clipboard" action—assuming, of course, you can get your computer to react to clipboard changes and do this automatically.
3
u/JustRollWithIt 🏆 Javascript Master of /r/Tasker Nov 17 '15
I have a Mac too. What's your setup for communicating between your computer and your phone via SSH and Applescript?
4
Nov 17 '15
The SSH part is for registering the computer as an AutoRemote device. See the Linux guide for this (it's the same on a Mac).
As for Applescript, it's not technically needed for communication; I just use it to do stuff like displaying an actionable pop-up window for SMS messages. The way this works is, when a new SMS is received, Tasker sends this AutoRemote message (which is actually a Shell command since it's over SSH) to my Mac:
osascript [path to Applescript file] %SMSRB %SMSRN %SMSRFThis will run an Applescript with the %SMSRx-variables passed to it. The script itself would look something like this.
2
u/Djagatahel OPO + Note 10.1, 6.0.1, Xposed Nov 17 '15
Hi ! I'm on a mac too and decided to try this but I'm stuck.
I've successfully added my computer to my phone's autoremote but messages don't seem to be leaving my phone. I've checked the IPs (they are both correct), added my administrator username / password in autoremote (I didn't fill the "URL prefix" since I don't know what it is) and authorized every type of interaction with my mac through my sharing preferences (just in case).
It still doesn't seem to work, i've tried sending the example message "ls /" but autoremote doesn't even notify me that the message has been sent.
Do you know of any way to solve this ? Thanks
2
Nov 17 '15
I have things set up the same way as you and it works, so I don't know. Sorry. The sharing preference you want to enable is "Remote Login", but I guess you already knew that.
What you're doing with AutoRemote is basically the same as logging into your Mac via SSH, so you might try finding some general SSH tutorials and see if that helps.
Also, as far as test commands go, you could try
Say "hello"to get immediate feedback. If it works, your Mac will speak whatever you write in the command.
1
u/Djagatahel OPO + Note 10.1, 6.0.1, Xposed Nov 17 '15 edited Nov 17 '15
Thanks for your quick response, "say "hello" " doesn't work, I'm guessing there is a problem in my autoremote setup.
If there is one, I'm almost sure it is in the localip field since I replaced joao's script
($(sudo ifconfig eth0 |grep "inet addr" |awk '{print $2}' |awk -F: '{print $2}')because it wouldn't work on my computer ( it says eth0 doesn't exist, I'm guessing its named differently on my os (El capitan 10.11.1).
So I've replaced it with my localip found in my network preferences.
However, I'm not completely sure this is the only information joao's script was getting (I know a little bit of linux commands but I'm unfamiliar with awk), I may be missing some essential information (like a network mask or something).
Do you have any idea of what I should add to make it work ? (for the moment i've only wrote "localip=---.---.---.---" instead of the original script).
Edit : I've found what the result of the command is (using a linux virtual machine) and it is only the local Ip address.. I don't understand why it doesn't work.
1
Nov 17 '15
Ah, yes, I remember having some trouble with the local/public IP fields myself. I ran into the same issue with eth0 and ended up skipping that whole shell command, replacing it instead with my local IP from the "Remote Login" screen. So instead of "localip=$(sudo ifconfig" etc. you'd have "localip=192.168.x.xx".
It seems you've already done this, though, so I'm at a loss. You could try using an SSH app like ConnectBot to login to your Mac and see if it works that way. If it does, then the problem is with your AutoRemote setup; if it doesn't, the problem is on the computer side.
1
u/Djagatahel OPO + Note 10.1, 6.0.1, Xposed Nov 17 '15
Thanks for all your troubleshooting ideas :)
I've tried with ConnectBot and it works, so I think the only possibilities are the key and the id.. I'm pretty sure my key is the right one, and I made the ID myself (I don't know if it had to be something that autoremote gave me) since I didn't know what to put there. I am pretty sure it is unique also :s
1
u/JustRollWithIt 🏆 Javascript Master of /r/Tasker Nov 17 '15
Awesome, I'm going to try this out. Thanks!
8
u/pipsname Nov 17 '15
Clipboard on Windows with Eventghost seems to have been solved via a python script. http://www.eventghost.org/forum/viewtopic.php?f=2&t=5476
2
u/kschang Samsung GS6 (VZN) / Nexus 7 2013 (M, Rt) Nov 17 '15
The only notable feature that had gone pro-only was universal copy/paste... I think. Most of us only look at events on PC, rarely respond to them (most of the responses, IMHO, don't work, in my experience).
9
u/sharpe65 Nov 17 '15
For some people at least. I almost exclusively use the desktop SMS features when I'm at my work computer. 100/month is a ridiculously low number for them to set the bar at.
2
1
1
2
1
u/WhyDoesItEvenMatter Nov 18 '15
Was thinking to take this project for my weekend. I guess my weekend is free now :)
Thanks, that's great
1
u/pmbasehore Nexus 6 no root Nov 19 '15
I have the notification mirroring working, but it keeps popping up with a toast error on my phone that the icon cannot be found. I'm pretty new to these two plugins, so this may be a stupid question: but is simply putting %nlicon in the "ICON" field incorrect?
1
u/The_Nothingman Nov 20 '15
How did you set up the mirroring?
1
u/pmbasehore Nexus 6 no root Nov 20 '15
Does this help?
Profile: Notification Mirror (5) Event: Notification Listener [ Configuration:Posted, ABCBS, AlarmDroid, Always on Voice, Amazon Shopping, Android Pay, Android System, Android System WebView, Android Work Assistant, Another World, Authy, AutoApps, AutoLocation, AutoLocation Unlock Key, AutomateIt Pro, AutoRemote, Axis, Barcode Scanner, Basic Daydreams, BeautifulWidgets, Bed Bath & Beyond, Bible, Bible Concordance, Bluetooth MIDI Service, Bluetooth Share, Box, Calculator, Calendar, Calendar Storage, Call Log Backup/Restore, Camera, CaptivePortalLogin, Catan, Cell Broadcasts, Certificate Installer, Cinnamon, CivRev2, ClearCheckbook, Clock, Cloud Print, com.android.backupconfirm, com.android.carrierconfig, com.android.managedprovisioning, com.android.providers.partnerbookmarks, com.android.sdm.plugins.dcmo, com.android.sdm.plugins.diagmon, com.android.sharedstoragebackup, com.android.wallpapercropper, com.motorola.triggertrainingservice, com.qualcomm.atfwd, com.qualcomm.timeservice, com.quicinc.cne.CNEService, ConfigUpdater, ConnMO, Contacts, Contacts Storage, CQATest, Cracked Lite, Dead Trigger 2, Device configuration, Device Manager, Device Policy, DM Config Update, DMService, Docs, Documents, Download Manager, Downloads, Drive, Dropbox, Earth, Entitlement, Evernote, Exchange Services, External Storage, Facebook, Fing - Network Tools, Fit, Fused Location, Georgia AG, Gmail, GOF2, Google Account Manager, Google Backup Transport, Google Connectivity Services, Google Contacts Sync, Google Hindi Input, Google Japanese Input, Google Keyboard, Google Korean Input, Google One Time Init, Google Opinion Rewards, Google Partner Setup, Google Pinyin Input, Google Play Books, Google Play Games, Google Play Movies & TV, Google Play Music, Google Play Newsstand, Google Play services, Google Services Framework, Google Sky Map, Google Text-to-speech Engine, Google+, Hangouts, Hebrew Interlinear Old Testament, HiddenMenu, Honeycomb Hotel Ultra, HTML Viewer, IF, IMDb, Inbox, Input Devices, Instagram, Intent Filter Verification Service, Keep, Key Chain, Koine Interlinear NT, Layout, LifetimeData, LinkedIn, Live Wallpaper Picker, Lowe's, MailChimp, Maps, Market Feedback Agent, Mars in HD Gyro 3D XL, Media Storage, Mediacom, Message+, Messenger, Messenger, Mixing Station, MmsService, Motorola AppDirectedSmsProxy Service, MotoSignatureApp, MusicFX, My Verizon Mobile, MyRadar, N.O.V.A. 3, Netflix, Nexus 6 Home Screen, Nfc Service, Nonograms Katana, Notification Listener, Nova Launcher, Nova Launcher Prime, NW Now Theme, Office Lens, OneNote, org.codeaurora.ims, Package Access Helper, Package installer, PacProcessor, Pages Manager, PBS KIDS, Phone, Phone, Phone and Messaging Storage, Phone Call Management, Phone Services, Photos, Plague Inc, Plex, Pocket Agent, Print Spooler, Project Fi, ProxyHandler, Pushbullet, Quora, Redbox, Roku, Samurai2, Services, Settings, Settings Storage, Setup Wizard, ShadowGun, Sheets, Shell, Sherlock Ultra, SIM Toolkit, SK Neural, Skype, Slide, Slides, Sound Search for Google Play, SprintDM, Starbucks, Steam, Street View, SwiftKey Keyboard, Sync, System UI, Tactical Assassin, Tags, Talk, TalkBack, Tapatalk, TARDIS 3D Live Wallpaper, TeamViewer, TeslaUnread, The Game Of Life, Timehop, Translate, Trexels, Trusted Face, Twitter, User Dictionary, VpnDialogs, VZWAPN, Waking Mars, Wallet, Waze, Wikipedia, Yesterday, YouTube, YT Kids, Zedge, ∞ ] Enter: Notification (6) A1: AutoRemote Notification [ Configuration:Recipient: Work PC Title: %nltitle Text: %nltext Ticker: %nlticker Icon: %nlicon Status Bar Icon: AutoRemote Persistent: false Number: %nlcount SubText: %nlsubtext Share: false Icon 1: AutoRemote Icon 2: AutoRemote Icon 3: AutoRemote Package:com.joaomgcd.autoremote Name:AutoRemote Notification Timeout (Seconds):200 ]
4
u/Ratchet_Guy Moderator Nov 17 '15
Yeah that's the issue right there. Implementing that part of it.