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
- 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’
- Name = rakomqtt
- Image = marengaz/rakomqtt
This contains the code that marengaz has written
in ‘Advanced container settings’ > ‘Command & logging’
- Command = ./start.sh --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
‘./start.sh’ ‘–mqtt-host’ ‘192.168.1.157’ ‘–mqtt-user’ ‘homeassistant’ ‘–mqtt-password’ ‘xiveifaeseifdsmbsfmhgefjwsgcbzjhkdwhkgPhooPwmejwdqdw,boz3a’ ‘–debug’
192.168.1.157’ - 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
-
in ‘Advanced container settings’ > ‘Network’
-
Network = host
-
Hostname = <your_hostname>
I was wondering what the hostname was but, I think, you can call it what you want., I called it MQTTHost
- Click the ‘Deploy the container’ button
- 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:
- Download this code and run
python3 -m rakomqtt.RakoBridge
- Log into your router and trawl through the devices connected to your LAN
- Open Rako smartphone app. Click ‘Rako’ > ‘Advanced’ > ‘Diagnostics’
- 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 http://192.168.1.76/rako.xml 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 http://192.168.1.76/rako.xml where 192.68.1.76 is the ip of my rako bridge)
The light should now be controllable from Home assistant
Test it in developer tools > Services
Choose service light.study (or whatever you called it in the configuration.yaml)
Clicking call service should toggle the light on and off.