Tag Archives: Controller

Philips Hue Entertainment setup and testing

Now that Philips has launched its Entertainment facility for the Hue lights, it’s time to implement and test the features.

What is Entertainment?

It’s a new method for the Bulbs to communicate, meaning that light effects and changes can be synchronised to the split second. This means that the bulbs can react to films, broadcasts, games and music without any lag.  The instructions are sent out in bursts and then carried out all at the same time by the bulbs themselves.  This, in the purest form, means that the bulbs are truly “smart”.

Setting an Entertainment area

You need to tell Hue where your entertainment area(s) are.  An entertainment area is a collection of lights that you want to join together when you’re doing an activity that will use Hue Entertainment – such as playing a video game or watching a film.  You set this up through the Hue app.  Open the app, go to Settings (the gears icon) then choose Entertainment areas.

Select a room or rooms where the entertainment area is to be set up.


Select the lights that will be used in your entertainment area.  Notice that Hue recommends the ones that will work best with this feature.  The recommended ones have increased range for brightness and can also show all colours more vividly.


Your selected lights appear on a pretend ‘map’ of your entertainment area.  Drag each one into where it is physically positioned in the room.  As you drag, the light in your room will flash so you know which one you are moving on the screen.  Each one will turn from orange to green once you have moved it.


When you have positioned the lights on the screen to match where they are, press Test area.


The lights will all change colour at the same time, to match the colours showing on the app.


Finally, the app will flash each light separately.

Once set up, the area is stored in the bridge’s memory for use later.  At this time the bridge also works out which bulb in the entertainment area should be used as the first point of contact to send out messages to the other bulbs in the area.  You can change this in the app but the automatic decision seems to work well.

Testing the Entertainment area

At the time of writing this entry, there is only one Entertainment partner available on the app – this is Razer hardware (a gaming hardware company).  However, there’s another way to test your new Entertainment area.

A reddit user called CrustaceanSoup has developed a Windows app called Huestacean which can be downloaded and run easily.  The app samples what is displayed on the screen and then converts this to colours in the entertainment area.  For example, you can watch a film or a YouTube video on your computer and your Hue lights sync perfectly to the action on screen.


Thanks to people like CrustaceanSoup we can see the potential for this amazing immersive experience.  The level of synchronicity takes my breath away.

I cannot wait to see how other partners join in with this.  More than merely matching what is on screen, I can see streamed films coming with encoded Hue light programs and live broadcasts sending their stage lighting to Hue to recreate in your living room.

For now, I would be really happy if Hue extended their already strong partnership with Apple and brought a similar screen-mirroring function to the Apple TV, this would mean that practically everything we watch could be extended outwards into the whole living room.


Controlling Hive via Domoticz

Hive from British Gas provides an excellent way to control your heating.  Setup is easy, you don’t need any existing home control equipment and the new-look thermostat is beautiful with its mirrored surface, colour display and satisfying prominent knob to twiddle… ahem.


There’s even a geolocation option in the app to remind you to switch off the heating if you leave home unexpectedly.  I thought, however, that it would be nice to immediately ‘stand down’ the heating as the last person in the flat left for the working day.  I have achieved this through Domoticz by modifying an excellent script from the Domoticz Forum (I can’t remember where – so please let me know in comments if you can point me to the thread to give the original poster the credit they deserve).

The following code is used as a LUA script (notice that I’ve set 4 virtual switches for this, one to turn the heating to 15C (our version of ‘off’), one to turn the heating to 20C (we call this ‘normal’), one for 22C (This is a boost to make the flat cosy) and the last switch to time the 22C state so that after half an hour, the heating reverts back to a more sustainable and energy saving temperature).

-- Set Hive thermostat

local HiveURL = 'https://api.hivehome.com/v5/'

local username = ‘email@email.com’

local password = 'passwordstring'

local loginhdr = '--location --data "username=' .. username .. '&password=' .. password .. '" '

local header = '--location -X PUT --data id=1 --data "temperature='

local tempcommand = '/widgets/climate/targetTemperature'

local tempUnit = '&temperatureUnit=C" '

local cookie = 'curl --cookie cookie.jar --cookie-jar cookie.jar '

local login = 'curl --cookie cookie.jar --cookie-jar cookie.jar --location --data "username=<HIVE USERNAME>&password=<HIVE PASSWORD>" https://api.hivehome.com/v5/login'

function round(num, idp)              -- Round number into manageable digits

local mult = 10^(idp or 0)

return math.floor(num * mult + 0.5) / mult


function LoginHive(self)

login = cookie .. loginhdr .. HiveURL .. 'login'



function UploadToHive(self)

upload = cookie .. header .. settemp .. tempUnit .. HiveURL .. "users/" .. username .. tempcommand



function LogoutHive(self)

logout = cookie .. HiveURL .. 'logout'



commandArray = {}

if devicechanged["TEMP Set to 15"] =='On' then

settemp = '15.0'

print ("Setpoint: " .. settemp .. " C")

commandArray["VAR Heating Boost"] = "Off"

commandArray["TEMP Set to 20"] = "Off"

commandArray["TEMP Set to 22"] = "Off"





if devicechanged["TEMP Set to 22"] =='On' then

settemp = '23.5'

print ("Setpoint: " .. settemp .. " C")

commandArray["VAR Heating Boost"] = "On"

commandArray["TEMP Set to 20"] = "Off"

commandArray["TEMP Set to 15"] = "Off"





if devicechanged["TEMP Set to 20"] =='On' then

settemp = '20.0'

print ("Setpoint: " .. settemp .. " C")

commandArray["VAR Heating Boost"] = "Off"

commandArray["TEMP Set to 22"] = "Off"

commandArray["TEMP Set to 15"] = "Off"





return commandArray

Heating on the whole is managed by the Hive itself, so that fine-tuning to the heating can be done via the thermostat or the Hive app on our mobile devices.

The interface to Domoticz is used to select from the 3 heating operating modes as mentioned above.  The display polls Domoticz to work out which heating option is currently selected and then ‘lights’ that icon up.  This gives positive feedback to the user as to which heating mode has been selected.


Hive seem to be breaking into the Home Automation market in more ways that just heating.  For example, we have been sent a Hive Plug.  This appears to serve two purposes: the first to extend the radio range of the Hive system (to act like a WiFi extender but purely for the Hive signals) and second to control a device plugged into the Hive Plug.  There is currently no option to do this via the app so I am assuming an update will occur soon to allow users to do this.


Any unneeded heating costs money and energy, so from both the environmental and financial benefits, if this implementation saves 2 hours of heating a week, that is the equivalent of over 4 days of excess heating per year saved.

Designing a user interface


Something that I give a lot of thought regarding my home control set up to is the interface.  I have changed the ‘look and feel’ of the interface tens of times in the last few years (much to Chester’s frustration) and to be honest I don’t think I’ve ever found the ‘holy grail’.  But what makes a good home control interface and how would we recognise one?  I explore these questions with my guide to designing and implementing your own home control interface.

Step 1: Who will be using your interface, and on what?

One of the first things to think about is which devices will be displaying the interface.  In my household the interface is accessed via a fixed large tablet, a computer screen and smaller smartphone screens.  Therefore I may think about designing two types of interface, maybe that look and behave very similarly, one portrait (for holding a smartphone) and one landscape (for the computer screen and the permanent tablet on the wall).  I have designed two types in the past, but using a 100% web interface means that the content can adapt to multiple display types, therefore saving time and resources.

Step 2: Look at what is out there for inspiration (but don’t get too depressed with what you find).

If you search the internet for images of ‘home control interfaces’, you’ll see a few common themes.  I think the main thing that hits me is that although millions of pounds have been spent on perfectly attuning user interfaces in smartphones and computers (for example with the upcoming Windows 10 operating system), home automation interface design seems to have remained the same since its introduction. Without wishing to offend anyone here, I get the distinct impression that the interface is last on the development list.  It seems to me that the hardware takes priority, and then the interface is designed by someone in the existing team who really did not want the job.  I honestly believe this to be the main reason why home automation has not yet become mainstream.  It’s not the hardware: it’s the interface.

If you look hard enough however, you’ll find some clear and well-designed interfaces out there.  The companies that have chosen to invest in design are clearly the market leaders, and therefore can afford to spent time and money developing a look and feel that homeowners can use and appreciate.

What is the one design element that proves to me that the interface has been developed professionally?  Space.  Too many home control screens are jammed full of buttons, sliders and album art.  It’s hard to know where to look, and although this may be something of a visual trophy for the geek community – think how confusing this will look to others in your household.  This leads nicely on to my next step…

Step 3: Think about the order of things.  How will your commands ‘flow’?

As far as I am concerned, there are two main ways to organise your home control screens: by location or by function.  Organising by location means that you gather all your controls for one room onto one screen, so for the living room you’d have all the lights, the dehumidifier, the air conditioner and the TV controls all together.  Conversely, organising by function means that you’d put the controls for all your lights on one screen, heating and cooling on another screen, security on another screen etc.

I have created dozens of versions of both, and I personally prefer the latter.  For me it means that the user starts from the home screen with a definite decision on what they are intending to do.  The interface becomes less of a show-home piece and more of a practical and logical day-to-day assistant.

There is a balance to be achieved between the number of options displayed on the screen at one time and the number of selections required to perform an action.  Instead of scrolling through one giant page of options, or having to reduce button size down to miniscule proportions, it may be better to increase the number of screens and create a ‘flow’ for the user.  So instead of selecting ‘Audio’ and immediately being presented with a screen full of options, it may be better to then ask ‘Where do you want to the audio to play?’ and further ‘What kind of audio?’.


Step 4: Write it down!  Plan your screens.

I have wasted literally days of my life not following this simple step.  Plan your screens on paper.  Falling out from this step will be all the buttons you will need for each screen.  Don’t worry about what the screens will look like yet, just think about what options you want to show.

Navigation is a consideration here.  How will your users know where they are?  If you provide ‘breadcrumbs’ on your display (Home > Audio > Living Room) you’ll need to reserve the same area on each screen for that.  To get back to the main screen, will the ‘home’ button be in the same place for each screen?

Step 5: Get ‘the look’ and stick to it.

Decide on a look and feel for your interface.  You may choose to compliment your home décor or to stand out as an ultramodern feature.  Either way, this step requires as much external input as possible.  If you’ve found some designs that you liked from step 2, speak to your users about which ones they prefer, and what they’d like to see.

When you’ve selected a look – stick to it.  By that I mean don’t be tempted to bend your own rules.  Future-proof your design.  For each of your screens ensure that there will be scope to add new devices in the future with ease.  Don’t make your icons or buttons so intricate that you’ll not be able to match them easily.

If each of your buttons contains an icon and some text, make sure the icons are roughly the same size and the text is the same size and font.  Little things like ensuring there is consistent capitalisation across your interface can make a huge difference.  “Living Room Lights On” next to “Living room lights OFF” leaves an unprofessional air.


After years of designing interfaces for my own home, I have some pearls of wisdom for you here.  The first is to use perfectly square, flat buttons.  These look modern and will not go out of fashion (if you are reading this in 2020 and flat buttons are out of fashion, then I apologise).  Another reason I prefer perfectly squared icons, is that depending on what interface controller you use, you may be disappointed at how the controller renders curved corners, and your beautiful vision becomes a pixelated mess.  The bigger the button, the better.  Our cleaner visits once a week, and if she needs to use her glasses to see an option, I change the button immediately.  Larger buttons also means that fewer options can fit on each screen, and I am all for that.

Get each button you need from step 4 designed now.  I would recommend you put a selection of these buttons in one mocked-up screen to ensure they are the right size and they look right.  Choose unobtrusive wallpaper or a solid inconspicuous colour for the display.

Step 6: Think about feedback.

The devices your user will be controlling may not be in the same room as the interface, so remember that they may need reassuring that what they have requested has been carried out.  There are a few ways to achieve this.

A button which changes its look depending on the state of the device is one way to go.  This approach is more common in consumer installations and requires constant sensing (called ‘polling’ in home automation terms) to ensure that all interfaces ‘keep up’ with the device’s status.  Don’t forget that someone could switch on a device from their smartphone, so then the corresponding button will need to update on all screens to reflect this.   One such controller that is capable of keeping track of devices is Openremote – more on this in step 8.

Another idea is that a pop-up box could appear to confirm your selection, for example confirming “Fan in Living Room has been switched on.”

The panel itself could speak to you.  I have elected to use this as my primary feedback method in my latest interface design.  The display is not obstructed by pop-ups, and the user can walk away from the panel and will still hear the announcement.

Feedback should also be provided automatically, for example when a security alert is activated or when a user needs to do something that cannot be completed automatically (such as a reminder to close a door).  Users could be anywhere when this feedback needs to be given, so thinking beyond the physical interface of a screen, what other devices could be used?  In our home, we have Sonos speakers in every room, so urgent feedback can be given via spoken word through them.  For smoke alarms triggered by Nest, the Hue lights in each room will flash momentarily, alerting occupants that action needs to be taken.  I also use Notify My Android (NMA) via Domoticz to keep me informed via short ‘texts’.

Step 7: Remember the ‘automation’ in ‘home automation’.

Advanced controls that only you will use can be tucked away at the ‘back’ of your interface.  Settings and variables can be as hidden away as you like, followed by screens for ‘fine tuning’ settings for devices that other users will probably never use.  It’s sometimes useful to control one individual lamp in the living room, to set brightness, colour and saturation until it’s just perfect.  But how often do you actually do that? It would be wiser to initially show a list of pre-set scenes to be selected from, and then have the option to move to a different screen to change individual lights if required.

Just because your system can do something, don’t give it pride of place and assume that every user will want to do it.  I have been guilty of re-building my interface around that a newly-purchased piece of hardware, just to show it off its new features.  This is a waste of time and ultimately confuses other users.

Step 8: Where to host your interface?

This depends on your home control set up.  I have used a few different downloadable options here, one being Openremote which is a program that runs on your computer or Raspberry Pi and ‘serves’ up information to panels around the home.  By polling your home control hardware at intervals you can select, Openremote can keep track of your devices.

Domoticz also has its own user interface that can be used on a plethora of screen sizes, however although I absolutely adore Domoticz and use it as the basis of all my home control activities, I think that the user interface is – dare I say it – where there has been less development.  By no means do I think this is a let-down however, as I would not have been able to thoroughly automate our home without Domoticz.

Another route – which is the one I have taken – is to design a web-based interface from scratch.  As Domoticz has a ‘www’ folder that can serve up any html document in that folder, I don’t need a separate web server.  I just upload all the html screens into a sub-folder of the Domoticz/www folder and then navigate to that page from any panel in the home network.  Here’s the secret.  Controlling Domoticz devices from a web-page is really easy.  You just have to navigate to a specific address and Domoticz will turn on a device.  You can get more information about that on the Domoticz API/JSON URLs page.

The only thing I had to work out for myself is – when I navigate to a URL asking Domoticz to turn on a device, the screen shows a ‘result page’.  The user would have to then click the browser’s ‘back’ button to get away from this result page and then back to the interface.  To solve this, I use a very small frame at the bottom of the screen.  When the user clicks a selection in the main screen, the link is followed in the small frame at the bottom, so as not to disrupt the main window.

Step 9: Testing and Rollout

Before announcing to your loved ones that you have created a masterpiece, I would encourage you to test every function on every page of your home control interface, especially those functions which will affect many devices in the home.  As an example, choose a time when no-one else is around and activate your ‘leave’ function and see if it does actually behave in the way you expect.  It’s too late when your family is ready to leave and you proudly press the button, only for the whole system to crash.  Trust in the system as a whole can also be eroded in this way.

Personally, I have the flat to myself every other Friday, only having to navigate around our cat.  I use this opportunity to test new functions I have added.  Our neighbours must think the flat goes crazy every two weeks, but it’s worth it.

Once everything is ready, you can add links to your interface on every device that will access it.  You can now go back to step one to restart the process.  I say this with confidence because as I stated at the start of this article, there is no ‘perfect’ user interface and there are always improvements to be made.  I truly believe that I will always be in pursuit of user interface perfection.

Why Domoticz is a no-brainer

When I first decided to connect all my devices centrally, I looked around the internet for a solution.  There are many options to choose from, almost too many.  Some you pay for, others you don’t.  Some come with a ‘hub’ that you connect to your router and the hub sends out radio and network commands to your devices.  Others rely on external hardware that you purchase separately.  There are some really good paid services out there, but I wanted to try it on the cheap.  That’s when I found Domoticz.

rfxcom433Domoticz is a small-footprint program that you can install on pretty much any computer, but if you want to connect to your devices via radio waves, to send on/off/dim signals, and receive temperature or movement sensor data, you’ll need to buy a separate piece of hardware.  I bought an rfxcom rfxtrx433.  It’s a matchbox-sized box with a stubby aerial sticking out of the top.  You connect it to your computer via USB.

At first we used a Windows PC that was left on all day every day as our ‘home server’ (one of the terms used to describe the ‘brain’ of the home control system).  It worked reasonably well, and Domoticz almost never crashed.  The thing was, we were probably using far more power than we needed to.  So I looked at using the Raspberry Pi, a small and cheap computer.From the Domoticz website you can download an image to transfer to the Raspberry Pi via an SD card.  This image contains all you need to start using Domoticz straight away, right from the second you plug in the Raspberry Pi.  This makes life sooo much easier.  You can even plug in the rfxtrx433 into one of the Pi’s USB ports and it will start working straight away.  It’s that simple.


domoticz-screenshotThen, the exciting part.  When you type in the Pi’s network address (eg and add on the port number (the default of the Pi when Domoticz is first installed is 8080), you’ll see an unpopulated screen with no devices.  Adding devices is done in quite an innovative way: devices that send information routinely, like temperature sensors for example, appear in the ‘unused devices’ tab and with a few clicks they can be added to your dashboard.  Adding other hardware that uses network commands, such as the Philips Hue Bridge, is done via the Hardware Setup page.

domoticz-blockyAfter some or all of your devices are added, you can create decisions that Domoticz can make on your behalf.  You can make these as sophisticated or easy as you want: and there are two ways of programming these decisions.  The easy way is using ‘blocky’.  This is a drag-and-drop way to quickly build up a program.  A great feature of blocky is that the blocks you drag around will only fit together if they can interact in the way you’re trying to get them to interact.  The more advanced way to tell Domoticz what to do is to edit and create mini-programs that run either when a device changes state, or every minute.

This is a really quick summary of what Domoticz can do, I would advise that you visit the website and forum, grab a Raspberry Pi, install the Domoticz image onto an SD card and have a go yourself.  You’ll be amazed at what a free piece of software can achieve to realise your home control dreams.

I’ll be posting a lot more about Domoticz.  After all, pretty much everything in our flat is controlled by it one way or another.

DIY: Make a better handset controller

Although I like the look of the standard LightwaveRF hanset controllers, the user of said controller has to remember what device is switched on and off when a numbered button is pressed.  This requires Mastermind-level memory.

Besides, I don’t use the controllers for ‘On’ and ‘Off’ per se, rather just to send a signal to Domoticz, so that the computer can decide what to do (or to reject the command altogether).  This means that the same button can be used for ‘On’ and ‘Off’, and therefore the same handset can be used for multiple functions (lighting moods and audio for example).

So a way to make these controllers more intuative is to add personally created templates to them so that the controller becomes part of your home setup.  You can choose a theme and run with it (as shown).

Firstly, this procedure is reversible, so if you don’t like what you’ve done, you can undo it all and revert back to your original handset.  Just remember to keep all the bits that come off the controller safe.

Secondly, you will lose some functionality.  Because the switch is removed, you don’t have the ability to select button set A, B, C or D.  I personally don’t care about this because the whole reason I wanted to make a custom cover for my remotes was to make them as user friendly as possible.

And if your family can remember that C4 controls the TV power, and D2 controls the garage door, and B1 to B4 control the kitchen lights, then you shouldn’t be reading this blog: you should all be at Cape Canaveral getting ready to take off a-la-Lost in Space.  Danger, Will Robinson!

Basically, you’ll end up with 10 buttons per customised handset.


1. Peel off the backing sticker from the controller to expose a screw and unscrew it.


2. Prise open the controller.  The things that should come off (quite easily are: The front cover, the rubber keys, the switch (which may come off in one part or may split into the plastic part of the switch and the metal part).  And the screw of course.  If the circuit board has come off from the base of the remote then I think you used a little too much force!  Get you, butchy.


You’ll notice that the rubber buttons are not needed – the ‘pads’ you can see in the image are self-contained switches.  Like the ones you get on blister-remotes.

3. Design your overlay.  I will post a template that you can use (search for the ‘Templates’ tag).  Don’t forget to leave a space where the led will shine when a button is pressed.

I used icons from Flat Icon.

4. Print and cut out the overlay.  I found that good quality bright white matt card worked best.

You may need to cutoff tiny strips from any side to make the overlay fit correctly.


5. Put one or two layers of the same card underneath the overlay (between the keys and the overlay).  This will make the control pad seem more springy.

6. Tape on the overlay onto the front of the controller.  I used normal tape here but I should have used a thick tape so that I only needed to use 1 pass, rather than 3 passes as I have done in the above picture.

Make sure that you don’t tape up the drawer on the back, otherwise you’ll have probelms when it comes to changing the battery.

7. Voila!  The below example is for the kitchen.  That’s why there is a cute chef as one of the buttons: when you press the chef button, all the devices in the kitchen switch on.


8. Now it’s time to program what happens when you press the keys.  More on that elsewhere in this blog.


Here’s an example handset (this one is for my bedroom).  It’s been created in the same style as all the ‘hardware controllers’ in the flat, so that picking it up and using it should be second nature.

You can for once use your creative side and your geek side together for this project.  Why not speak to members of your family to get an idea of what they’d like to see on the controllers (favourite colours, family member/pet’s faces etc).  Maybe they could even design the templates for you!