This document summarizes the HueMore Android app, which allows users to control Phillips Hue smart lights from their smartphone. The app was developed by Eric Kuxhausen over 2 months as an applied human-computer interaction project. It uses a REST API to communicate with Hue lights and features customizable lighting presets, schedules, and mood scenes. The app was designed with convenience, accessibility, and multi-device compatibility in mind. It stores data in SQLite databases and communicates with NFC tags using a custom protocol to enable light control without opening the app.
7. Multipurpose space
• Manipulate color temperature (red vs blue tint
in whitish light)
• Reuse room for concentration and relaxation
8. Set the Mood
• Colorful and time variant lighting options
• Anything from candlelight dinner to dance
party
9. Sleep Assistant
• Dim the lights as bedtime approaches
• Fade the lights on to gently wake up in
morning
10. Optimized Circadian Biorhythm
• Automatically vary color temperature
throughout the day to match to sunlight color
• Fight seasonal affectiveness disorder with
brighter light in the winter
11. Control Away from Home
• Run lights while on vacation to appear home
• Save power by turning off lights when last
person leaves
13. Convenience
• Minimize the number of clicks in everyday use
cases
• Physical light switches not viable
• Users can save settings to NFC tags and place
on walls instead of lightswitches
– NFC tags reprogrammable to auto-apply presets
or bring up onscreen options
19. Process
• IDE: Eclipse with Android plugins
• Version control: git via Github
• Unit testing for NFC subcomponent
• Compatibility testing across Android Virtual
Machines representing:
– Android versions 2.3 to 4.2
– Small smartphones up to tablets
20. Magnitude of Project
• 20+ screens the user might see
• 60+ java classes
• 10,000+ lines of code
• Translated into 4 languages
• Developed in 2 months
22. Architecture
• Heavy use of OO design principles
• 5 major elements:
– View
– ModelView (integrated with Model)
– Persistence
– Networking
– System-Event interaction (Alarms and NFC)
23. View
• 30 layouts built from standard UI elements
• Defined with Android layout xml files
• Different versions between screen
sizes, Android versions
24. ModelView
• Java code extending Android Activity and
Fragment classes
• Used Android supportV4 library to backport UI
elements to legacy Android devices
• Manual bindings to Views handle UI
interaction, data population
25. Persistence
• Databases wrapped by Android
ContentProvider implementation
• 3 mySQL lite databases for:
– Groups
– Moods
– Alarms
• Android’s key-value preference system to track
database patches, user settings, etc
26. Networking
• Extensions of Android AsycTask
• Philips Hue API
• Android standard Apache library for http get,
post, put requests
• Gson library translates between internal java
objects representation and json for API
requests & responses
27. System-Event Interactions
• Alarms
– Schedule with PendingIntent
– Receive with BroadcastListener
• NFC
– Write NDEF messages containing URL with
appended data (custom dataencoding protocol)
– Read with system IntentFilter
28. HUEMORE NFC PROTOCOL 1.0
Encoding light moods on nfc tags with as little as 46 bytes of storage
29. Constraints
• NFC tags on the market that store as little as
46 bytes of usable storage
• Needs to support entire Hue bulbs API to be
forwards compatible with the rest of HueMore
30. Data wrapper
• NDEF record on tag containing a URL to
www.kuxhausen.com/HueMore/nfc?
• Websafe base64 data appended to end of URL
31. Data bitstring
• 4 bit version number
• 50 bit bulbs included flags
• 7 bit number of states
• Sequential listing of states
32. State subbitstring
• 9 bits flagging optional inclusion of the following:
– 1 bit on
– 8 bit brightness number
– 16 bit hue number
– 8 bit saturation number
– 64 bit xy float pair
– 9 bit color temperature number
– 2 bit alerts enums
– 4 bit effect enums
– 16 bit transitiontime number
33. Protocol Analysis
• Numbers are big endian
• Flags are bit strings (little endian)
• No checksum (as of V1)
• Orders of magnitude more space efficent tha
storing json api calls