Use that old android and get custom scene control

(John Lord) #1

author’s note: while this is designed for “custom scene control” it’s also a viable method for the “single button” everyone is clamoring for, since there are bluetooth buttons available for under three bucks.

custom scene control… I’ve been doing some experimenting and i discovered a couple of interesting things that make it possible to use a SINGLE old android device as a scene controller for your entire house (range permitting of bluetooth)
All you need for this project is an android phone or tablet you can run sharptools on, It runs on devices that the smartthings app won’t run on. A caveat for this device is it MUST be rooted. The reason for this will become apparent.

Required software:

  1. ROOT
  2. Xposed framework (requires root)
  3. the xposed additions module - this is the one that will be doing the heavy lifting.
  4. Sharptools for creating shortcuts to your devices.
  5. Tasker (optional)

Required hardware:

  1. an old android device meeting the above criteria OR go pick up a prepaid one at walmart for $50. It’s good enough for this. I"m using a fire phone i broke the screen on.
  2. an external bluetooth controlling device of some sort (selfie button, keyboard, whatever)
  3. You can have as many of #2 as you wish!

So the basic operation is pretty simple: Xposed Additions is an EXTREMELY powerful button remapping program that, thanks to the developer implementing my suggestion, also works with external devices such as bluetooth headsets and keyboards. I haven’t tested it with a bluetooth camera button but i have tested it with the buttons on my clock radio and car stereo and a tiny bluetooth keyboard. The question you need to ask yourself is how many scenes do you need for your controller? I’ve seen $2 camera bluetooth controllers that have two buttons on them. With this app you can assign a total of 18 shortcuts to those two buttons.

  1. single tap either or both buttons at once
    2 double tap
    3 triple tap
    4-6 same as above but hold down the button afterwards.
    the app treats both buttons pressed as a third button so that gives you 18 different functions for a mere two buttons. I have a 60-something key bluetooth mini keyboard with a shift key = 120 keys = 120 x 6 = omg i can control everything.
    The real power of the additions plugin is what you can assign. Not only can you remap buttons to other functions, you can launch shortcuts, apps, or tasker commands. I am sure you can see the power of this.

since you can pair multiple devices to the same phone/tablet, you can have different “scene controllers” in every room for a cheap price and a single device to configure everything on.
I hope someone gets good ideas from this.

One note: I have had issues getting the shortcuts triggered in this manner to control hue lights. It could be an issue in my setup or a bug in sharptools. I don’t know yet. More experimenting is required to get a work-around.

to setup:

  1. install sharptools
  2. authorize widgets or shortcuts (costs $)
  3. install xposed framework
  4. reboot
  5. install xposed additions
  6. pair your chosen bluetooth controller buttons.
  7. open xposed additions settings
  8. enable external devices
  9. detect a new button, then press a button on your bluetooth device. It will be intercepted.
    now when you double-click the saved button you will get a sub-menu of what to do when that button is pressed and when
    this is important to know as the program is capable of not only assigning up to six functions per button, it also can assign six DIFFERENT functions for each and every app on the phone and whether or not the screen is on. Since this device most likely won’t have the screen on, you should click on that and scroll down and choose "launch shortcut"
    when you do this, you can choose a sharptools shortcut and configure it in the app. Good luck! The next time that specific button is pressed, starting the very second you created that shortcut, the shortcut will run. You don’t even have to leave the settings screen.
    Have fun experimenting!

(Joshua Lyon ( Dashboard)) #2

Very cool use case for SharpTools and an old phone or dedicated tablet - thanks for sharing!

Regarding the difficulties you are having with Hue devices, feel free to reach out to me via PM or using Send Feedback within SharpTools. I don’t personally have Hue devices, but a few other people use SharpTools to control their Hues.

If I remember correctly, they are calling setHue, setSaturation, and setLevel using a number 0-99 to choose the color they want. There is a setColor method that the Hues will try to expose, but I’m not sure how you would send a map to it so I would recommend using a Tasker task using the three methods above.