Using Alexa with OnControls

OnControls is a great platform for home controls, especially media center controls.  It works great for creating macros and automations using your phone or tablet.  However, its missing one feature that some customers have wanted to see, and that is integrated voice control.

Voice control systems like Amazon's Alexa or Google Home are becoming extremely popular. Its not exactly useful for media control once your already watching a tv show or listening to music, however using it to get setup is really convenient and super cool. Saying a command like 'Alexa, turn on the media room' and having it set the lights, TV backlighting, turning the TV & receiver on, and turning some background music on brings the wow factor when using your media room. Unfortunately, OnControls does not support this kind of function out of the box. So its time to get creative.

Using a cheap Raspberry Pi, open source software HomeAssistant.io and a little time, I was able to get exactly the results I was looking for. Here is how I did it.

Install HomeAssistant on a Raspberry Pi or any computer you have lying around. I used the Raspberry Pi because they have a pre-built SD Card that gets you up and running lightning fast. There is a ton of stuff online about using HomeAssistant so I won't go into detail about how to set it up here. However, check out Bruh Automations YouTube Channel, he has some great tutorials on HomeAssistant!

Once you have HomeAssistant up and running, now its time to get it talking with your IR or Serial adapter from OnControls. OnControls adapters are branded versions of the Global Cache line of products, and they have a database of commands for pretty much every main stream piece of equipment on the market. So head over to GlobalCache and download the command set for the equipment you are using, TV, Receiver, etc.

In your HomeAssistant configuration.yaml file, you need to configure the command you would like to be able to perform such as power on and off for your TV. You will also need the IP number of the OnControls transmitter. Here is an example of my YAML (keep in mind, the commands are for my specific TV):

# Remote

remote:

- platform: itach

name: "Basement TV"

host: "IP Number"

devices:

- name: Basement TV Power

connaddr: 3

commands:

- name: "ON"

data: "0000 006D 0000 0020 000a 0046 000a 001e 000a 001e 000a 001e 000a 001e 000a 001e 000a 0046 000a 0046 000a 001e 000a 0046 000a 001e 000a 001e 000a 001e 000a 0046 000a 001e 000a 0679 00”

- name: "OFF"

data: "0000 006D 0000 0020 000a 0046 000a 001e 000a 001e 000a 001e 000a 001e 000a 001e 000a 0046 000a 0046 000a 001e 000a 0046 000a 001e 000a 001e 000a 001e 000a 0046 000a 001e 000a 0679 00”

I recommend testing this part, by going into your HomeAssistant States and test to see if this is functioning before moving on to adding the Alexa or Google Home module. Once you have to working, follow the guide to install the voice command of your choice in HomeAssistant. With Alexa, you must use the Hue bridge emulation.

Finally, You need to create a group of devices you want to turn on and off together.

####GROUPS

basement:

name: Basement

entities:

- light.back_lights_level_6_0

- light.bar_lights_level_4_0

- light.bar_sidelights_level_3_0

- light.front_lights_level_5_0

- switch.christmas_tree

- remote.basement_tv_power

Using my example group, by saying “Alexa, turn on the basement”, all the devices in the group are trigger. You can go far beyond this by creating scripts to set light levels, etc. but that is for another blog post. I'll probably try blog this in more detail when I have more time. Until then, good luck having fun with home automation!

0 Comments

Leave a comment