New user - trying to set up rako lighting

Hi Guys, I am a new user and have managed to install Home Assistant on a Raspberry pi 4, thanks to the clear instructions on this site.

I am now on the next step trying to sort out integrations, Blink, Sonos and logitech were found discovered and configured pretty easily but I am having issues with RakoCloudGateway which controls my Rako lights.

It is discovered as “RakoCloudGateway via Homekit Accessory Protocol” and asks me for a Homekit Pairing Code.

Rako lights use a device called Rako Cloud Gateway to connect to Alexa and Apple Homekit. The unit generates a Homekit pairing code (which changes if you unpair and do it again). I have tried using the pairing code that I used when I set up homekit and I get the error “incorrect Homekit code. Please check and try again”

It feels like I may be going down the wrong path entirely, if I want to be able to use Home Assistant to control my Rako lights should I use the RakoCloudGateway via Homekit, and if so how?

If there is a better way I would very much appreciate other suggestions.

Suggestion from a friend - follow instructions here

I’ll try to update progress here

1 Like

I sent a while working my way through the instructions above only to discover from the Issues that it is not Raspberry Pi compatible.

Back to square 1

Any suggestions would be very welcome!

not having much luck on this so far, still happy to hear ideas.

I have tried a different approach, I have The Rako Cloud Gateway which integrates the lighting with Alexa and IOS Homekit.

The Homekit Controller Integration has found the Rako Cloud gateway and after I removed the pairing with IOS Home Kit I was able to pair with it using Home Assistant (ignore the dashes!).

Rako Cloud Gateway is now visible in under homekit controller in my integrations.

This is a great start!

However only two devices out of my many lights and switches are visible.

Any ideas?

I have finally got Rako lights working so I thought I’d write it up here as a beginners guide to setting up Rako on Home Assistant.

I used an Interpreter between rako bridge and home assistant’s mqtt light platform written by user Marengaz. It is installed on a container in portainer.

Before you start I believe there are issues implementing this on a Raspberry Pi, I switched HA to a NUC in order to avoid them.

You will need to install a mqtt broker, the recommended one is Mosquito which you can install from the supervisor Addons - addons/mosquitto at master · home-assistant/addons · GitHub

Once you start it, MQTT should be listed in your integrations

If you click on Configure under MQTT you will be able to get the username and password to use in the Portainer Container later.

Following the instructions here GitHub - marengaz/rakomqtt: Interpreter between rako bridge and home assistant's mqtt light platform

  1. Install the Home Assistant Portainer addon

This is done from the Add on store under supervisor more details here

On the ‘Containers’ view, click ‘Add Container’

  1. Name = rakomqtt
  2. Image = marengaz/rakomqtt

This contains the code that marengaz has written

in ‘Advanced container settings’ > ‘Command & logging’

  1. Command = ./ --mqtt-host <your_host_ip> --mqtt-user <your_username> --mqtt-password <your_password> --debug

When you go to type the code into the container it will look like this

‘./’ ‘–mqtt-host’ ‘’ ‘–mqtt-user’ ‘homeassistant’ ‘–mqtt-password’ ‘xiveifaeseifdsmbsfmhgefjwsgcbzjhkdwhkgPhooPwmejwdqdw,boz3a’ ‘–debug’’ - the ip address with the IP address of your home assistant and the

homeassistant - the username given to me by MQTT integration

xiveifaeseifdsmbsfmhgefjwsgcbzjhkdwhkgPhooPwmejwdqdw,boz3a - the password given to me my mosquito (obviously altered to put here but I wanted to show a typical password generated by the mosquito)

The part that says

  1. in ‘Advanced container settings’ > ‘Network’

  2. Network = host

  3. Hostname = <your_hostname>

I was wondering what the hostname was but, I think, you can call it what you want., I called it MQTTHost

  1. Click the ‘Deploy the container’ button
  2. The container should now launch and be viewable in the ‘Containers’ tab

This bit was quick straight forward, tick the box and start the container.

Find your RA-BRIDGE

There are a bunch of different ways to do this:

  1. Download this code and run python3 -m rakomqtt.RakoBridge
  2. Log into your router and trawl through the devices connected to your LAN
  3. Open Rako smartphone app. Click ‘Rako’ > ‘Advanced’ > ‘Diagnostics’
  4. See ‘Connected IP’

Identify your rooms

Visit http://<RA-BRIDGE-IP>/rako.xml . This will present a list of all the rooms in your house along with their internal ids

This was fine I have the ip address of my rako bridge and using in a browser gave me the info that I need for the next stage

Once the container was running, I had to edit the configuration.yaml, to keep it tidy I used a separate yaml file for all the lights so the configuration.yaml included

light: !include light-channels.yaml

And then in a file I called light-channels.yaml

- platform: mqtt

    name: Study

    schema: json

    state_topic: "rako/room/25/channel/0"

    command_topic: "rako/room/25/channel/0/set"

    brightness: true

  - platform: mqtt

    name: Study Main

    schema: json

    state_topic: "rako/room/25/channel/1"

    command_topic: "rako/room/25/channel/1/set"

    brightness: true

  - platform: mqtt

    name: Study Lamp

    schema: json

    state_topic: "rako/room/25/channel/2"

    command_topic: "rako/room/25/channel/2/set"

    brightness: true

Where 25 is the room number that I took from my rako system (by clicking where is the ip of my rako bridge)

The light should now be controllable from Home assistant

Test it in developer tools > Services

Choose service (or whatever you called it in the configuration.yaml)

Clicking call service should toggle the light on and off.

1 Like

I have not managed to find a way yo get the status of lights controlled by a different method into Home Assistant, so if anyone has any ideas please shout!

Hi @ShawWellPete - thanks for this guide!

I am currently planning a new system for a whole house renovation, and am considering Rako combined with Hue, among other things - hoping that home-assistant can help tie things together.

With your setup, is Home-Assistant able to detect Rako switch presses? Even if it’s only light state it can detect, how much delay is there?

The reason I ask is I’m looking at using Rako switches to control both Rako and Hue/Zigbee lights, or blinds etc - things in Home Assistant that Rako can’t control directly. Unfortunately I don’t have any of the kit yet to try anything out.

Any advice would be appreciated!


I believe the button presses are detected
@marengaz has since written a proper Rako integration which is currently waiting for approval. He’s the smart guy who created rakomqtt and may be able to answer better.

1 Like