Saturday, 9 February 2019

Philips Lightstrip Connections


Background

In order to connect hue lightstrips up in a flexible way, with easy to dismount connectors, and a simple way of making Y connections, I've connected a BT phone extension socket to the driver box.

This means that some soldering is necessary, but once completed, it is possible to use phone extension cables and splitters.



Ingredients

  • Philips Lightstrip+ 2m (Including controller unit)
  • BT Extension Cable (6 Wire)
  • Plug Adaptor
  • Socket Adaptor
  • Mouldable Polymorphic Plastic
  • White Heat Shrink Sleeving (~1.5mm and ~14mm)

Method

Controller

  1. Cut the socket part off the extension cable, leaving a length of at least 300mm
  2. Open the controller unit box, and de-solder the 6 wires connected to the C,R,G,B,W,VCC terminals.
  3. Using the BT socket / cable, strip the wire associated with pin 1 - if in doubt, connect the plug into the socket, and buzz out the connections.
  4. Use some fine heatshrink cable on the wire, which will protect it from melting when soldering.
  5. Solder the wire to the controller board (VCC)
  6. Repeat for the other 5 wires.

Cable to Lightstrip
  1. Cut the remaining part of the extension cable (with the plug) to the desired length
  2. Strip the wire associated with pin 1
  3. Use some fine heatshrink cable on the wire, which will protect it from melting when soldering.
  4. Solder the wire to a plug-in adaptor, or directly to a length of lightstrip.
  5. Repeat for the other 5 wires

Testing

  1. Connect the BT socket and plug together, and buzz through VCC on the lightstrip to pin 1 on the controller, and make sure they are connected
  2. Buzz pin 1 to pin 2, and make sure they are not connected
  3. Repeat for the other 5 pins

Closing Up

  1. Put the lid back on the controller, making sure that the new wire is adequately supported
  2. Using some polymorphic plastic, craft a connector body over the plug adaptor or the end of the lightstrip
  3. Slide a short length of white heatshrink sleeving over the new connector body, and shrink

You can now use BT splitter sockets and extension cables for your Philips Hue light strips.

Notes

Ensure 6-wire BT cables and splitters are used.  4-wire ones will be useless.
Philips Hue Lighstrip Plus uses 24V and has 6 connections.  
Some other lighstrips (including the older Philips Hue ones) use 12V, and 4 or 5 connecitons.
Don't get them muddled up.




Monday, 4 February 2019

Home Automation with Google Home Routines

The Google Home is a great concept, and if you want to do something simple, it is great.  If you want to be a little more clever, however, there are several gotchas.

Setup

Broadlink Mini 3 IR Sender

tv - Television Device (Panasonic TV, from the library)
hifi - Custom Device (Denon Hifi, Manually configured)
tv on - Scene to turn on TV using a Discrete ON sequence (learned from a raspberry Pi, rather than the remote, which doesn't have discrete on/off codes), turns on the hifi, mutes the TV, and switches the hifi to use the TV output.
tv off - Scene to turn off the TV and Hifi using Discrete OFF sequences

Philips Hue

5 Light bulbs around the house
tv lights - Scene to set the lights in the living room for TV watching

Google Home

Routine: "tv on, turn on the tv, turn the tv on"
Activate Scenes: "tv on", "tv lights"
Say: "OK, Television is On"

Actions and Responses

1. OK Google, TV On
This turns on the TV, Hifi, and routes the audio as needed, and says "OK, Television is On"

2. OK Google, Turn the TV On
This turns the TV on, but just the TV

3. OK Google, Turn the TV On
This turns the TV off

4. OK Google, Turn on the TV
This responds with "OK, Executing 3 scenes", and promptly executes "tv on", "tv off" and "tv lights"

Analysis

The Google Home is trying to be clever, and looks for devices or sequences which have the matching device type, or contain the name.

1: works because the keyword "turn on", or "activate" etc. is not used.
2: finds a device of type 'TV' (the name in this case is irrelevant), and sends the programmed 'on/off' sequence.
3: As 2, but because the TV was already on, and the device has an 'on/off' control button on the remote, actually turns the device off, rather than on.
4: This searches for matching scenes, rather than devices, and finds 3 scenes with the name TV in them.

Changes Stage 1

First thing to change is to remove the tv device from the Broadlink Mini, and re-install it as a custom device, so that the underlying system does not know that it is a TV.  Also, give it a different name.

Broadlink Mini 3 IR Sender

pana - Custom Device (Panasonic TV, Manually configured)
hifi - Custom Device (Denon Hifi, Manually configured)
tv on - Scene to turn on TV using a Discrete ON sequence (learned from a raspberry Pi, rather than the remote, which doesn't have discrete on/off codes), turns on the hifi, mutes the TV, and switches the hifi to use the TV output.
tv off - Scene to turn off the TV and Hifi using Discrete OFF sequences

Philips Hue

5 Light bulbs around the house
tv lights - Scene to set the lights in the living room for TV watching

Google Home

Routine: "tv on, turn on the tv, turn the tv on"
Activate Scenes: "tv on", "tv lights"
Say: "OK, Television is On"

Changes Stage 1, Actions and Responses

5. OK Google, Turn on the Television
This turns on the TV, Hifi, and routes the audio as needed, and says "OK, Television is On"

Analysis Stage 1

5: This now turns on the TV as expected, because there is no longer a device of type 'TV' and there are no scenes containing the name "television".

Changes Stage 2

The next set of changes is to remove the name 'tv' from any device name or sequence.

Broadlink Mini 3 IR Sender

p99 - Custom Device (Panasonic TV, Manually configured)
d99 - Custom Device (Denon Hifi, Manually configured)
p99on - Scene to turn on TV using a Discrete ON sequence (learned from a raspberry Pi, rather than the remote, which doesn't have discrete on/off codes), turns on the hifi, mutes the TV, and switches the hifi to use the TV output.
p99off - Scene to turn off the TV and Hifi using Discrete OFF sequences

Philips Hue

5 Light bulbs around the house
h99lights - Scene to set the lights in the living room for TV watching

Google Home

Routine: "tv on, television on, turn on the tv, turn the tv on"
Activate Scenes: "p99on", "h99lights"
Say: "OK, Television is On"

Stage 2, Actions and Responses

6. Say "OK Google, TV On"
6. Say "OK Google, Television On"
6. Say "OK Google, Turn on the TV"
6. Say "OK Google, Turn the TV On"
This turns on the TV, Hifi, and routes the audio as needed, and says "OK, Television is On"

Stage 2, Analysis

6: This now works, because there are no matching devices, names or scenes.

Conclusion

The google home has a pecking order in which it processes requests, and it looks like:

1. Is there a matching device, and if so, does it have the required controls needed (e.g. on/off)
2. Are there any matching scenes
3. Is there a matching routine

For the first option, any inadequacies in the device itself (e.g. toggling power, rather than discrete on/off) show themselves.  This also means that other activities within the routine cannot be executed (e.g. a routine which would both turn on a hifi, set the volume and input to a chromecast audio, and stream a specific radio channel).

For the second step, if the exact scene is not named, all matching scenes are executed. It is possible to turn off the TV by saying "OK Google, turn on tv off" if there is a scene called "tv off", but it isn't very intuitive.

The last step is the most flexible, but it is essential that the possibility of matches at previous steps is eliminated.

Recommendations

1. Don't use a specific device type where possible (e.g. don't select a TV device, select a generic one)
2. Don't use names of the devices for the devices or any scenes associated with the device
3. Add all possible commands to the routines

Request from Google that routines can be set to a higher priority in the pecking order.