marengaz / rakomqtt

Interpreter between rako bridge and home assistant's mqtt light platform
MIT License
6 stars 2 forks source link

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

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

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

      1. Command = ./start.sh --mqtt-host --mqtt-user --mqtt-password --debug

        command

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

      1. Network = host
      2. 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