Rako Lighting

Hi @gadgetbazza
I believe I’m right in saying that the python library (which can be implemented with MQTT functionality in docker) predates the HA Rako Bridge custom integration and that the latter uses the former to assert services, entities etc. in HA. So, it’s a step further on but not essentially a replacement.

I personally use the integration even though I have an MQTT broker running for other purposes.

The Rako Bridge sends UDP status update broadcasts to any device that cares to listen on its subnet. The HA integration listens and updates its entities when for example, you manually control lights from a wall switch. I don’t know if you can achieve this with the MQTT implementation. Maybe you can, but it would need to be listening and issuing MQTT packets when updates arrive.

Check your router/firewalls to see if there is any reason the UDP update packets might be blocked or lost.

One thing to watch out for is the difference between changing the brightness vs the brightness_pct as the range of values differ. My downlights don’t react to an increase of 15 units in brightness but do react to an increase on 15%. I will depend on the characteristics of the lights themselves.

HTH

I’m still using rako to mqqt in Portainer. Do you think the integration is a better route? does it need to be manually reinstalled when you update Home Assistant?

I never used rako2mqtt so I can’t make a direct comparison but I am very satisfied with the integration. With a little effort you can do cool stuff like the interactive dashboard below. The light icons are clickable controls and update in real time when a physical button is pressed.

Also, I’ve found that quite complex logic can be built (in my case I use Node-RED) manipulating entities via call_service. I’m not saying you can’t do that with scripts and MQTT but I suspect it might feel less ‘immediate’.

It doesn’t need to be reinstalled when I update HA.

Thanks Graeme,

I did have the integration running, but I have a few lights that just don’t play ball with it. That’s why I tried the MQTT version. I don’t believe there will be an issue with the firewall, indeed I can see the UDP broadcasts being picked up by the Docker and making the MQTT updates. The bit that’s missing for me, is HA updating the MQTT light based upon the topic configuration I’ve entered in the yaml, so I think that’s where the issue lies.

Does anyone use the MQTT version that they can share their YAML with my so that I can compare? Maybe this won’t solve the issue with those specific channels, but I just wanted to try it.

I have long since got rid of most of my Rako stuff but I do still have a control panel installed in my living room that I’ve not yet got round to replacing. If I was to plug my bridge back in could I use this to be able to use the buttons to trigger scenes/automations in HA?

SInce the recent update, there is a change for the syntax for MQTT so in the confifuration.yaml I have

mqtt: !include mqtt.yaml

And inside mqqt.yaml

light:
  - name: Study Main
    schema: json
    state_topic: "rako/room/25/channel/1"
    command_topic: "rako/room/25/channel/1/set"
    brightness: true
            
  - name: Study Lamp
    schema: json
    state_topic: "rako/room/25/channel/2"
    command_topic: "rako/room/25/channel/2/set"
    brightness: true
  - name: StudyMQTT
    schema: json
    state_topic: "rako/room/25/channel/3"
    command_topic: "rako/room/25/channel/3/set"
    brightness: true
  - name: Boot Room
    schema: json
    state_topic: "rako/room/65/channel/1"
    command_topic: "rako/room/65/channel/1/set"
    brightness: false
  - name: Bedroom Landing
    schema: json
    state_topic: "rako/room/33/channel/1"
    command_topic: "rako/room/33/channel/1/set"
    brightness: true
  - name: Bedroom Ensuite
    schema: json
    state_topic: "rako/room/81/channel/1"
    command_topic: "rako/room/81/channel/1/set"
    brightness: true

with lots more other lights following. Is that what you wanted?

Yes. I have done that but I think you will need the Rako software (Rasoft) to do it.

Using RASOFT added a new channel (3) with no device to the room (25)


Using Rampi and RASOFT set button 4 to turn that light on

MQTT explorer detected that light
I then used mqqt directly in node red, I’m sure there is a way to do it directly in Home assistant

I’m guessing that when I finally get around to switching to the integration from Rako to MQTT that I will lose the ability to use the switches as triggers for Home Assistant / Node Red?

The states of the light entities controlled by a wallplate button will change when you press it, so you can use HA triggers & the various Node-RED state nodes to detect this. I imagine that it’s possible to set up a virtual device in Rasoft Pro (as you’ve described above) and have its corresponding entities appear in HA - although I’ve not tried this. Maybe the integration knows the difference.

Sounds like a good thing to try, as I never use the fade-up/fade-down buttons in my set-up and it would be quite cool to reassign them to HA stuff.

1 Like

One to try!

Hi Peter,

Thanks for that example. I have also wondered about triggering something from a Rako button. I follow what you have done using the MQTT solution and am familiar with node-red so the overall flow makes sense.

Does anyone following this thread have a view about how this might be possible with the custom Rako integration? I can see the button-press events in the debug log but can’t get my head around how to trap them in HA.

Kind regards,

Tom

Hi Tom,

If you want something to happen and you can see the event then it should be pretty easy to set up an automation

alias: TEST RAKO
description: ''
trigger:
  - platform: state
    entity_id:
      - light.study_main
    to: 'on'
condition: []
action:
  - service: light.toggle
    data: {}
    target:
      entity_id: light.hallwaylamp_level_on_off
mode: single

The example above toggles another light when a light is turned on.

If you want a rako button to do something in home assistant without doing anything in rako, try creating a virtual light using Rasoft like I did in my previous post.

If you do not have rasoft you can still work around your current lights, say a current button sets a rako light on or off, you can have other appropriate actions when that happens.

Hi Peter,

Thank you. I think I had a mental block and seeing your example has made it clear.

I have most of my automations working through MQTT and then into node red. This particularly applies to PIRs - I have a mix of Rako PIRs, ones from my Texecom alarm with IKEA filling in gaps.

As you say - I can trap a light turning on (possibly virtual) and then do anything I want. In my case that could be toggling whether a PIR is active or not. The toggle being a helper in HA. I have Rako everywhere and use Rasoft.

Thanks again,

Tom

1 Like

Thanks Pete, I have reverted to the HA integration again currently as I couldn’t get the MQTT version to work, but I still have the same issues I’ve always had… I will add another post here regarding those to see if anyone can help, but I may end up going back to the MQTT option again, so thanks for sharing that.

Hi all,

I am still having a few issues with the Rako integration. I don’t have many Rako circuits, it is used for controlling RGBW lighting I have in a couple of rooms.

Sticking with the simplest room for the minute, I have an RGBW LED strip in the Lounge (Room Id 17).

I’ve attached my rako.xml here for reference.

<rako>
<info>
<version>2.5.0 RA</version>
<buildDate>Sep 26 2019 16:03:54</buildDate>
<hostName>RAKOBRIDGE</hostName>
<hostIP>192.168.4.65</hostIP>
<hostMAC>00:1E:C0:99:A2:A2</hostMAC>
<hwStatus>05</hwStatus>
<dbVersion>-18</dbVersion>
</info>
<config>
<requirepassword/>
<passhash>NAN</passhash>
<charset>UTF-8</charset>
</config>
<rooms>
<Room id="9">...</Room>
<Room id="10">...</Room>
<Room id="17">
<Type>Lights</Type>
<Title>Living Room</Title>
<Channel id="1">
<type>Slider</type>
<Name>Channel 1</Name>
<Levels>FFA27F3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Slider</type>
<Name>Channel 2</Name>
<Levels>FF007F3F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Channel 3</Name>
<Levels>FFA57F3F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>Slider</type>
<Name>Channel 4</Name>
<Levels>FF007F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="13">...</Room>
</rooms>
</rako>

This is what I see in HA Devices for the Rako integration searching by Lounge area…

and the same search in the Entities area:

Each of the 4 channels aligns with one of the colours on the LED strip.

All the light states show as off regardless of the channel state. I can control the light to a degree via HA. For example if I

  • Toggle the light switch in HA on, the channel moves to 100%, but the HA switch reverts to off shortly after and the brightness stays at 0%.
  • Move the brightness slider, the channel follows the setting, but the brightness slider reverts to 0% in HA shortly after, the switch always shows off.
  • If the LED channel is on and I want to turn it off via HA, since the toggle and brightness are already off / 0%… I can press the toggle to turn it on and then press it again to turn it off (before it reverts on its own) and the light will turn off.

So it would seem that the primary issue is that the lights states are not being maintained in HA. What could be wrong with my setup?

Once I have overcome the basics, I’d like to understand if it’s possible to use HA to create a single light control that can be used to pick the colours and manage the 4 channels of the RGBW strip, but 1 step at a time…

Any help would be much appreciated.

This is the behaviour I was seeing previously. I would suggest trying:

  1. Reload the rako integration in HA. Does it work temporarily?
  2. Check you’re using python-rako 0.0.14 (See marengaz post above).
  3. Check that your bridge and HA host are on the same VLAN. The bridge can’t send UDP broadcast updates to HA unless it is.

HTH

I received my WK-HUB today and replaced my old hub. This improved the Rako integration considerably but I still experienced some issues with channels becoming unavailable/not syncing, etc.

Anyway I noted that Homekit was available now in the WK-HUB (albeit beta) and of course HA now has local homekit support.

I enabled Homekit within the WK-Hub and set it to expose channels, HA then saw it as a homekit advice and I added it (there is a key required which you can find on the back of the WK-Hub).

So far (touch wood) it works flawlessly, all channels found, dimmer levels working from live HA to Rako App, and visa versa, also wall panel/rako scene selection dynamically updates the levels correctly within HA.

I will see how stable it is over the next few days but looking like a good alternative for anyone struggling with the integration.

1 Like

Hi, I am a complete newbie so apologies for digging up these previous posts. I am super keen to get Rako integration working as my whole house is Rako.

I have followed your instructions, copied the files to the custom_components/rako folder, restarted, and added the line rako: to the configuration.yaml.

HA would not restart after that as it said the configuration was invalid and could not find rako integration. I then modified the init.py file as per your instructions. But it hasn’t helped, same error it won’t restart with rako: in the configuration.yaml.

I have copied the files from your link in this post, but I get the impression that I also need to do something with python_rako?

Where am I going wrong?

Many thanks in advance

I think from memory and reading your post…

After copying the files and restarting

    • You need to go to Integrations and Add Integration
    • Search for Rako (which will only show after adding the custom_components/rako folder and a restart and clear browser cache) and Add.
    • Add rako: to the Yaml and restart.

Do you have Rako showing in your integrations page? If not, then I think point 2 is what’s missing.

HTH

Firstly, massive thank you for responding, it is much appreciated

So I added the folder under custom_components (see picture from VS Code)

Then I restarted HA and cleared my browser cache (I am using Chrome)

I went to Settings/Devices & Services/ and clicked the big blue buttons that says ‘Add Integration’ and searched for ‘rako’ but nothing found. Searched in HACS too, but nothing

I thought maybe I had done something wrong creating the Custom_Components folder but HACS has been installed there too and is functioning correctly

Any ideas?

Thanks again

Magnus