Skip to content

marengaz/rakomqtt

Repository files navigation

rako mqtt

Test RakoMQTT

Buy me a coffee

About

!!!! NO LONGER IN ACTIVE DEVELOPMENT !!!!

SEE:

!!!! NO LONGER IN ACTIVE DEVELOPMENT !!!!

A component to attach Rako lights (via the Rako bridge) to an mqtt broker for use with home assistant. Rako bridge interaction guide.

Only tested with mosquitto

Architecture

The docker container runs 2 processes

  • watcher mode listens for the Rako bridge to broadcast change of state updates, then posts a home assistant compatible message to your mqtt broker
  • commander mode subscribes to the home assistant command topic and upon receiving a message, posts a command to the Rako bridge via http

System architecture

Deploy

Portainer

  1. Install the Home Assistant Portainer addon

  2. On the 'Containers' view, click 'Add Container'

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

    name/image

    1. in 'Advanced container settings' > 'Command & logging'

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

      command

    2. in 'Advanced container settings' > 'Network'

      1. Network = host
      2. Hostname = <your_hostname>

      network

  3. Click the 'Deploy the container' button

  4. The container should now launch and be viewable in the 'Containers' tab

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'
    1. 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

Home assistant light config

Use the Home assistant mqtt light platform.

Room scenes

Rako room scenes 1,2,3,4,off are mapped to home assistant brightness levels 255,192,128,64,0 respectively (1 being the brightest, 4 being the dimmest).

- platform: mqtt
  name: <name of the room>
  schema: json
  state_topic: "rako/room/<rako-room-id>"
  command_topic: "rako/room/<rako-room-id>/set"
  brightness: true

For example

- platform: mqtt
  name: Hallway
  schema: json
  state_topic: "rako/room/42"
  command_topic: "rako/room/42/set"
  brightness: true

Channel levels

More granular control can be achieved with channel level commands.

NOTE: When lots of channels are changed at once, it's possible the Rako bridge will drop some commands leaving some channels unchanged.

NOTE: Rako's channel 0 in any room controls all the lights in that room

- platform: mqtt
  name: <name of the room>
  schema: json
  state_topic: "rako/room/<rako-room-id>/channel/<rako-channel-id>"
  command_topic: "rako/room/<rako-room-id>/channel/<rako-channel-id>/set"
  brightness: true

For example

- platform: mqtt
  name: Hallway Downlights
  schema: json
  state_topic: "rako/room/42/channel/1"
  command_topic: "rako/room/42/channel/1/set"
  brightness: true

Dev

Manual build and deploy:

SSH into your home assistant box and run this:

docker-compose -f docker-compose.yaml up -d --build

Run

python -um rakomqtt

About

Interpreter between rako bridge and home assistant's mqtt light platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published