Rss

Archives for : Automation

Pain Diary

I recently had the opportunity to answer questions about pain management and wearables.  Even if you’re unfamiliar with the phrase, I suspect most people are aware of the products.

Wearables are smart devices that are worn; fitness trackers, smart watches, health trackers etc. I’m not sure if those Bluetooth pills that are swallowed and feed back to a smartphone are strictly classified as wearable, but their benefits are definitely there.  Real time data is big business, and there are companies all over the world looking to cash in.  While many of those companies are profit based, some are more altruistic.  I certainly don’t have their budget but I wonder if the limited consumer gadgets I own could be put to use?

I’ve suffered with pain in my left knee after a road accident in 2007, pain in my lower back since around ’96 and my shoulder has dislocated at least since ’91.  I’d love to be able to walk, but the consultant at the Pain Clinic has told me it will never happen.  I’m taking it with a pinch of salt.  In 1974 my parents were told I wouldn’t survive the week.  I may be completely in denial, but I’d like to think that when it comes to medicine we can’t say never.  Putting aside the progress that’s being made in exoskeletons, I think the odds are against me but if I can help the medical profession find a trend then I’m going to do all I can.

Tasker already manages my medicines for me, announcing when they should be taken and nagging me if I’ve been unable to take them at a given time.  Tasker also allows me to manually record entries to my Pain Diary.  The entries update a text file (chosen for universal compatibility) via Dropbox, and also a privately shared Google calendar (accessible only via a private link). When combined with AutoPebble, medication notices can be pushed to the watch and actions taken.  I can notify Tasker that I’ve taken my meds, or to dismiss the alert and remind me later.  It also allows me to update my Pain Diary, all without taking my phone from my pocket.

Although the Pebble smart watch is renowned for its battery life, usually lasting 6 – 8 days, I’m not relying exclusively on it.  Using Tasker’s Scene functionality I can also have buttons pop up and update the Pain Diary straight from the phone’s home screen.  Because of the way Tasker works, that screen and all associated settings can be taken to a tablet or an upgraded phone in a couple of minutes.

Because of the way it’s set up I can add or remove items in the list very quickly. I can also type in rarer entries manually.  It has only really benefited me properly a couple of times, but those times have been worth it.  When a nurse asked how often I experience chest pains I was able to provide exact times and dates in a couple of minutes.

Obviously, this doesn’t have anywhere near the sophistication of what is achievable or even what’s currently in development. It has to be manually selected and doesn’t include heart rate, blood pressure, etc. but that’s not what I’ve set out to do. This started as a means for me to keep a personal record of when I’m in the most pain.  Providing the Pain Clinic with the entries is just an added bonus.

Finally quit

After three weeks the Tasks and Profiles in Tasker (an automation app for smartphones) have been removed.  All links between the PC’s, TV, tablets, watch and phones relating to having a smoke are deleted.  No longer can I soak in the tub, press a button on my watch and ask my other (better) half if she wants to join me for a smoke.  No longer can texts or AutoRemote messages be sent.  No longer can I automatically log my location at the Cuban Cigar Club with FourSquare.  Those who know me will testify to how rarely this happens.

I didn’t really want to quit smoking.  I loved it.  It was only really the finances that dictated the necessity to give them up.  The thing is, if you’re going to do something then make the effort.  Doing something half-hearted based on the fact that you didn’t want to do it in the first place is something that belongs in your childhood.  You certainly should have outgrown it by the time you enter your thirties (much less my age).

So, the final act of acceptance has been made.  I’ve deleted something from Tasker.

If you’ve missed the previous entries on smoking/quitting then you should know I hold vapes and Doctor Mike Evans responsible for my success.

Two phones, one Pebble

I’d been in the market for a new watch for some time.  I looked at three watches – Samsung’s Galaxy Gear, the Pebble, and Sony’s Smartwatch 2.  I’ve used Sony’s LiveView watch before and it promptly joined a long list of Sony’s products that have either acted up, not worked or broke.  While a colour, touch screen watch might be nice I wanted something that I wouldn’t regret and that didn’t fit Sony’s bill.  The Galaxy Gear is an impressive enough watch but funds wouldn’t stretch that far and I knew the Pebble would integrate nicely with apps I already use, especially if I was to have notifications pushed to the watch from more than one phone.

Whether you have two phones because you need to carry a business phone, or you have a family member whose needs necessitate a separate emergency phone, it’s possible to have your Pebble receive notifications on multiple devices.  First of all, you’re going to need a few apps.

Anything you can do with both Pebble Notifier and PebbleTasker can be done in AutoPebble.  It’s a single app, cheaper, does far far more than what is shown below, but it is slower to respond and takes longer to learn how to use. If you want to quickly read and respond to a text I’d recommend using Pebble Notifier and PebbleTasker. This doesn’t mean you shouldn’t buy AutoPebble at all.  If you have the time to spend setting it up, do so.  It’s much quicker to set up if you want to set up lots of options in one go.  It certainly doesn’t disappoint.

Some of the above apps aren’t free but they’re not going to break the bank.  I spent under £8, and the apps can be used for more than one purpose.  I’m assuming you’ve never seen the above apps before.

First of all, set up Tasker.  You need to access the menu, Preferences, Misc, and tick Allow External Access.
Tasker-Menu
In AutoRemote, you need to authenticate the two devices.  For this you can either tap the phone icon, and type in the goo.gl/XXXXX code or just use the barcode scanner.
AutoRemote-FourQnet
Once AutoRemote is authenticated you can start setting up the profiles and tasks in Tasker.
Let’s assume you have your Pebble connected to your personal phone and you want to bridge your business phone to it.

On the business phone:

  1. Enter Tasker
  2. Click on the + icon at the bottom, [you may be prompted to enter a name, if so call it Texts], and tap the tick
  3. Event, Phone, Received Text [you can set restrictions on the texts here by entering parameters phone numbers or words in the text; if you want all texts forwarded then leave it blank and tap the back arrow at the top left]
  4. Tasker will now prompt you for a Task to perform when you receive a text. Click New Task, type in Texts, tap the tick and you’re ready to add the Task.
  5. Tap + Net, Mobile Data, On.  Then + Plugin, AutoRemote Message, then the pencil icon found to the right of Configuration.
  6. From here select the device you want to send it to, and in Message, enter “Business text from %SMSRN at %SMSRT, %SMSRB” (without the quotation marks) and tap your phone’s back button.

On your personal phone:

  1. Enter Tasker and add a profile, State, Plugin, AutoRemote, Configuration, and tick Event Behaviour.
  2. In Message Filter enter “Business text from” (without the quotation marks), and tick Case Insensitive.  [This shouldn’t make any difference if you’re careful but I’ve had the first letter of a word change case because I’ve went back to change it]. Press back a couple of times and type in a name for the new task.
  3. Add, Plugin, Pebble Notifier (not Pebble Notifier settings), Configuration, Body and type “%armessage” (this should be in lower case and again, without the quotation marks).  In the Title, type “Business SMS”.

That’s it. All the time both phones are connected to the net your texts should be pushed from one phone, to another and on to your Pebble.  In most cases this is enough, but there are always times when you want two way communication.  This takes a little more time, but not too much.

If you’re unable to take out your phone and respond to a text properly there’s a good chance you’re going to want to keep things simple.  Your responses need to be set up in advance.  I have set up:

  • Ok
  • Yes
  • No
  • Thanks
  • I’m busy at the moment, I’ll get back to you shortly.

Obviously you’re able to select whatever responses are suitable for your own life, just don’t forget which one’s which.
On the business phone set up a profile, I’ve called mine “AR SMS Ok”.

  1. Add, State, Plugin, AutoRemote,
  2. Tap the Configuration pencil and tick Event Behaviour
  3. In Message Filter, type in “Pebble Reply Ok”
  4. Tick Case Insensitive and Exact Message
  5. Tasker will then prompt you for a task, select New Task, enter “AR SMS Ok” and tap the tick.
  6. In Number, enter “%SMSRF”
  7. In Message, type “Ok”, and decide whether or not you want the text to be stored with your other texts.
  8. [In case you accidentally reply to a tweet, you might want to add If %SMSRN doesn’t match 86444 (Twitter’s phone number)]

You’ll need to do the above for each response you’d like to have available in the Pebble.  I’d be wary of cloning the profiles as it won’t change the task assigned to it, and you won’t get the experience.  Once they’re all done, return to your personal phone.  Add a new Task, I called it ‘Pebble (phone model) SMS’.
Add, Task, Wait, 3 seconds.
Add Plugin, PebbleTasker, Configuration.
The top task, I assigned ‘Reply OK’ with the long press ‘Reply Yes’. Close watch app on use.
The middle, ‘Reply Busy’. Close watch app on use.
The bottom ‘Reply Thanks’ and the long press ‘Reply No’. Close watch app on use.
Close on idle, Reset on idle were ticked and the app should Open Watch App so the options are loaded for you without having to go through the Pebble’s menu.

Obviously you can have the remote phone confirm the messages have been sent by having AutoRemote send a message to the personal phone and having Pebble displaying it.  It just depends on what your personal requirements are.

It’s worth noting that once you’ve bought Tasker and AutoRemote you can do any number of things.  Making your PC interact with your phone, and by extension, your Pebble is easily doable.  You can sleep, shutdown, restart, lock, mute etc. a PC by pressing a few buttons on the Pebble.  If you like, you can even be notified when your child is using their phone/PC, and which apps they’re using.  Not to mention getting their location, locking/unlocking the device, opening/closing apps or having messages pop up on their screen.  In no way do I condone using these apps for April Fools pranks.  I would never do that.  Ever.  Well, perhaps one or two.

Automation

We’re only here for a finite time.  That time is precious.  We spend far too much wasted time checking up on things to see if there’s anything new.  That’s why we automate things, to save time and effort.

We all have automated devices, even if we don’t look at them that way.  Washing machines, dishwashers, apps on mobile phones.  We don’t want to waste time checking our phone all day, so we use notifications.  We don’t want to wash our clothes or dishes ourselves, so we use washing machines and dishwashers to do the work for us.  The question is, where do we draw the line?  With houses, offices, servers, PC’s, smartphones, vacuum cleaners and even cars being automated the line keeps moving.

For me, my line is drawn far away from most people’s.  I take things a step further, I like automation.

I use automation tools on my phone, computer, tablet, watch etc.  I like the fact that my computer knows how long the dishwasher takes and turns it off at the right time, sends a message to my phone which in turn forwards that message to my watch to let me know when to open the dishwasher door, just so the crockery dries itself.  I like the lights turning themselves on when it gets dark.  I have NFC stickers throughout my house which enable the phone to perform various tasks.  I like that my calls and texts are automatically backed up to my Google account for me, so I can keep track of who I called, who called me, and when.  I love smart notifications, apps you can configure to link obscure items to your phone or tablet.  Don’t get me wrong, I’m not saying I’m getting overloaded with messages all day long.  This is simply about having the right information at the right time. This then enables me to disregard or act upon what I receive.

So, how can you set things up?  First of all decide on what you want automated and why.  My own inspiration was the Orange Automated Home which featured in their magazine, boasting levels of technology which at the time was admirable.  Since then a number of high tech, fully automated homes have been featured as newer technology is developed.   Since reading the article I wanted to own my very own automated home. Building Management Systems are now used to automate offices across the globe.  The thing is, once you start automating things you get the experience and imagination to automate so much more.  You end up looking for ways to help you.  

I currently use Homeseer to run the house, an automated alarm system to keep it secure.  The PC’s have EventGhost with the AutoRemote plugin for two way notification and control.  This allows me to be notified on my phone/tablet when the computer does something I want to be told about without having to sit at the computer.  [This is particularly useful if you have kids with their own (albeit really old) computer.]  Our smartphones use NFC, Tasker, Secure Settings, AutoRemote and Pushover to perform multiple functions with little or no input. [Useful if your bairns use your old phone].  Finally my watch links to the phone so that the most important information is brought to my attention without the need to keep taking out the phone.  Because of the way all these things link together I only have to look at my watch to know the PC or the house has done something on my behalf.  Web sites, files and even clipboard contents can be pushed from the phone to the PC (and vice versa).  I know if my son has my old phone turned on or not, whether he’s playing games or reading ebooks on the Kindle app, and we can lock / unlock / track / take photos / reboot the phone remotely.

One web site that really helps is IFTTT (If This Then That).  It works on logic principles, if (for example you get an email) then do (insert action here) for me automatically.  I use IFTTT when awaiting deliveries (amongst other things) to keep me up to date by using smart notifications on my phone by linking the tracking number to Pushover.  I don’t have to keep checking the tracking web site on the off chance that something had happened, I’m not wasting time. There are all sorts of ways IFTTT can help you.  If it’s going to rain that day you can have the weather report sent to your phone before you wake up.  You get the idea.

If you’d like to know more about automation, please feel free to comment below or get in touch.

Links:
Home automation hardware
Smartphone automation – Android
NFC tags

 

Medication

Medication can be great, it helps you get better and can help you cope with pain.  The trouble is, almost all medication has side effects.  It can colour your urine, make you constipated, induce seizures, get you stoned and if it’s not yours it can even kill you.

Some medication must be taken at certain times of the day.  I have one tablet at midday, and again at midnight.  I have some tablets which need to be taken around 9pm, while others are taken as and when needed.  The trouble is, all of my tablets have side effects, some of them quite severe so I’ve found a solution.  No longer can I forget to take my meds.  No longer can I wonder if I’ve taken them and take them twice.  While the solution is a little over the top, it’s a solution, and one that works well for me.

For this, you’ll need:

Dropbox
First of all, create a folder and a text file in Dropbox.  It doesn’t really matter what they’re called, but I’ve kept mine as \Reminders\Meds.txt as I use the Reminders folder for various things.  Once the text file is created, go to the Dropbox app and favourite it.  The file should then have a purple circle with a white star at the bottom right.  This is done so that the file is available when there is no network connection.

File Manager
Use your file manager to go to SD Card (internal if available) \Android\data\com.dropbox.android\files\scratch\Reminders you should see Meds.txt (or your variation if you’ve changed the names).

Tasker
Once confirmed, you can load Tasker.  I always have Tasker’s Beginner Mode unticked to ensure all of the options are available (Menu, Preferences, UI).

  1. I started by creating a variable called Meds (Vars, +).
  2. Then created a Profile called Meds Day which was time based, from 12:00 to 12:01,
  3. and created a Task called Medication.  The Task has the phone say “It’s time for your medication” – Misc, Say, using the Alarm stream so that it’s independent of the Ringer/Notification volume.  This is also pushed to my watch using an app called Pebble Notifier (amongst other things, the Pebble saves me stopping the wheelchair in order to get my phone out).  Using Task, Wait, the phone waits three seconds before Variable Set changes the variable Meds to 0.  I later arranged to have the buttons on my watch display the options ‘Meds Taken’, ‘Dismiss’, and ‘Meds Taken’, courtesy of PebbleTasker.  (I needed to add the Task ‘Meds Taken’ before I could do this).

You can also create the Profile Meds Night (for example) and link that to the Task Medication. By selecting set times you can create as many of these as you’d like.  If you wanted specific medication mentioned, simply repeat the steps two and three and name them appropriately.

Next, I created a new Task, named ‘Meds Taken’.  Using Variable Set the variable %Meds is changed to the value ‘1’. PebbleTasker then changes to the default options and a message is flashed on the screen (Alert, Flash) acknowledging ‘Meds Taken’.  The date and time are updated in the file (File, Write File) Android/Data/com.dropbox.android/files/scratch/Reminders/Meds.txt with Append and New Line ticked.
By doing this I am able to keep check of when I’ve taken my tablets and the file is automatically synced with Dropbox on my other devices.  In the bottom right corner I’ve also added an icon resembling a tablet, this was necessary for me to create a shortcut from the phone’s home screen.  It’s so much easier tapping an icon on the phone than going to Tasker just to change a single variable.

Meds Taken

Of course, life gets in the way sometimes.  It’s not always convenient to take tablets exactly at the intended time.  With this in mind (learned the hard way), I created a nag system:

The creation of a Profile and Task, each called Meds became my nag system.  The Profile is set every twenty minutes throughout the day, starting at 00:10 to ensure I had time to take my meds before it started nagging me, but sufficiently apart so I didn’t become annoyed with it, especially if I was somewhere that I couldn’t take my meds. The Task simply says “Have you taken your medication yet?” (Misc, Say) and has PebbleTasker open the options for ‘Meds Taken’, ‘Dismiss’, and ‘Meds Taken’ again.

Meds Taken

[Note, the other band on my wrist is an NFC tag which, when scanned, shows my name, NHS number etc.]

The whole process has evolved over time to include and exclude various aspects.  If in future any changes are made to it, I’ll post in the comments.  Of course, because Tasker is a one-off payment, hopefully it won’t incur any further costs.

NFC

What is NFC?
NFC stands for Near Field Communication.  It’s a variant of RFID (the same technology that’s used for door access in offices and in Oyster cards).  It’s how contactless payment works.

 

That doesn’t help me, what is it?
It’s a means of transmitting information.  Because of how it works, the information transmitted is small, usually up to 4KB.  A microchip and a coil of wire is placed inside a ‘tag’.  A reader (or reader/writer) reads the information on the tag and performs actions based on the information received.  For example, Samsung have fitted NFC readers in the back of mobile phones.  The phone is placed near enough to the tag to read it.  If the tag contains a web address, the phone will automatically go to that web site.  If it contains WiFi settings, those settings are entered in to the phone and it will connect to the router without having to put in the WiFi code.

An example of an NFC Tag

This NFC Tag will allow you access to my WiFi.

 

How does it work?
Data is beamed via an electromagnetic (EM) field.
We all know that electricity will power an electric motor.  You put voltage in, you get movement out.  But, if you put movement in to a motor you’ll get voltage out.
By swapping the motor for a coil of metal (copper in this instance), you put voltage in, you get an EM field out.  Flip that around and if you put an EM field in you get voltage out.
The NFC reader puts voltage in through the copper coil to generate en EM field.  If you place it near a tag it turns the EM field in to a tiny voltage, powers up the microchip in the tag then transmits it using its copper coil as an aerial back to the reader.  The reader picks up the tag’s information and acts on it.  The tag doesn’t necessarily need a battery because it only needs to power up when there’s a reader there and it gets its power from the reader.

 

What can it do for me?
Pretty much anything you want it to.  Tags can be programmed by your phone/tablet (you’ll need NFC to do it of course) to turn on/off WiFi, sync, GPS, 3G, adjust the volume, run Tasker profiles etc.  If you have a contactless card from your bank, or have certain apps installed (Google Wallet, Orange Quick Tap) you can pay for goods or services by tapping your card or phone/tablet instead of using Chip & Pin*.
I have an NFC tag on my keyring, the tag contains an address, it will navigate you there, load Google Street View so you know what the area looks like and text me that the keys have been found.  I have another tag on my wrist, it contains my name, NHS number and Medical Records Number so if a hospital scans it, they know who I am and what medication I’m taking.  A tag by my bedside will turn off WiFi, auto sync, GPS, Bluetooth, change the volume, and dim the screen.  When I tap it again it turns up the volume, brightens the screen, turns on WiFi etc.

 

Which apps can I use?
There are a few apps on the market.  I tend to use NFC Task Launcher (now called Trigger) as it ties in nicely with Tasker, thus extending what the tag can do. I’d recommend getting a few tags and having a play.

 

Where can I get tags from?
Take a look online.  I got mine from rapidnfc.com – a reliable supplier with excellent customer service.

 

I still don’t understand how it works
Magic.  It works by magic. 😉

 

*Rumours say NFC will become so popular that it will replace, either in part or in full, Chip & PIN in around five years.