Rako Lighting

oh right, so your master room 0 is just showing up as a totally independent light. can you send me your rako.xml? (you can get it from http://<your-hub-ip>/rako.xml)

Yes - room 0 comes up as separate light in HA - I see that it is at the bottom of the rako.xml file. This is correct and I checked and it also comes into the rako app.

What I can’t work out is whether you have surfaced the events coming into the rako bridge which select scenes. These would normally come in from the rako keypads or remote control. This would be quite useful as it mean that other non-rako devices could be controlled via the rako keypads. As per my previous message these rako events are coming into HA when I look at the debug log.

This is the loft bedroom having lights switched on and off via scenes from the keypad.

2021-05-31 18:57:41 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 5, 0, 5, 0, 3, 248]
2021-05-31 18:57:41 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=5, channel=0, scene=1)
2021-05-31 18:58:27 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 5, 0, 5, 0, 0, 251]
2021-05-31 18:58:27 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=5, channel=0, scene=0)

Rako.xml

<rako>
<info>
<version>2.4.4 RTC</version>
<buildDate>Jul 25 2018 17:04:03</buildDate>
<hostName>RAKOBRIDGE </hostName>
<hostIP>192.168.1.9</hostIP>
<hostMAC>00:04:00:04:A3:92</hostMAC>
<hwStatus>1D</hwStatus>
<dbVersion>-92</dbVersion>
</info>
<config>
<requirepassword/>
<passhash>NAN</passhash>
<charset>UTF-8</charset>
</config>
<rooms>
<Room id="5">
<Type>Lights</Type>
<Title>Loft bedroom</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>Downlights</Name>
</Scene>
<Scene id="2">
<Name>All lights</Name>
</Scene>
<Scene id="3">
<Name>LH reading light</Name>
</Scene>
<Scene id="4">
<Name>RH reading light</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>switch</type>
<Name>Reading light left</Name>
<Levels>FFFFFF3F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>switch</type>
<Name>Reading light right</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="6">
<Type>Lights</Type>
<Title>Loft ensuite</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Channel id="1">
<type>switch</type>
<Name>Downlights</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Mirror</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
<Channel id="15">
<type>Default</type>
<Name>Channel 15</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="9">
<Type>Lights</Type>
<Title>First floor landing / stair</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Slope</Name>
</Scene>
<Scene id="3">
<Name>Landing</Name>
</Scene>
<Scene id="4">
<Name>Dimmed</Name>
</Scene>
<Channel id="1">
<type>Default</type>
<Name>Slope</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Landing</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>switch</type>
<Name>Top landing</Name>
<Levels>FFBFFF3F000000000000000000000000</Levels>
</Channel>
<Channel id="15">
<type>Default</type>
<Name>Channel 15</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="13">
<Type>Lights</Type>
<Title>Little bedroom</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Dimmed 1</Name>
</Scene>
<Scene id="3">
<Name>Dimmed 2</Name>
</Scene>
<Scene id="4">
<Name>Dimmed 3</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="14">
<Type>Lights</Type>
<Title>Front bedroom</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Downlights</Name>
</Scene>
<Scene id="3">
<Name>Dimmed</Name>
</Scene>
<Scene id="4">
<Name>Dimmed 2</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FFFF7F3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Windows wall lights</Name>
<Levels>FF007F3F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Default</type>
<Name>Wall lights</Name>
<Levels>FF007F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="15">
<Type>Lights</Type>
<Title>Middle bedroom</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Downlights</Name>
</Scene>
<Scene id="3">
<Name>Wall lights</Name>
</Scene>
<Channel id="1">
<type>switch</type>
<Name>Downlights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>switch</type>
<Name>Wall lights</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="17">
<Type>Lights</Type>
<Title>Porch</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Lantern</Name>
<Levels>00BF7F3F000000000000000000000000</Levels>
</Channel>
<Channel id="15">
<type>Default</type>
<Name>Channel 15</Name>
<Levels>00BF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="18">
<Type>Lights</Type>
<Title>Hall downstairs</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Dimmed</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FF7F7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="21">
<Type>Lights</Type>
<Title>Bathroom</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Dimmed</Name>
</Scene>
<Scene id="3">
<Name>Low light</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FFBF7F37000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Mirror</Name>
<Levels>FFBF7F00000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Default</type>
<Name>Fireplace</Name>
<Levels>FFBF7F00000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="22">
<Type>Lights</Type>
<Title>Front reception</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Wall lights</Name>
</Scene>
<Scene id="3">
<Name>Down lights</Name>
</Scene>
<Scene id="4">
<Name>Dimmed</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Slider</type>
<Name>Wall lights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Chandelier</Name>
<Levels>FF00003F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>switch</type>
<Name>Socket</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="23">
<Type>Lights</Type>
<Title>Middle reception</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Wall lights</Name>
</Scene>
<Scene id="3">
<Name>Pendant</Name>
</Scene>
<Scene id="4">
<Name>Down lights</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FF00003F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Slider</type>
<Name>Wall lights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Pendant</Name>
<Levels>FFBFFF3F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>switch</type>
<Name>Socket</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="25">
<Type>Lights</Type>
<Title>Toilet</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Mirror / LED</Name>
</Scene>
<Scene id="4">
<Name>LED</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FF007F00000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Mirror</Name>
<Levels>FFFF7F00000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>switch</type>
<Name>LED</Name>
<Levels>FFFF7FFF000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="29">
<Type>Lights</Type>
<Title>Living room</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Downlights</Name>
</Scene>
<Scene id="3">
<Name>Spiders</Name>
</Scene>
<Scene id="4">
<Name>Dimmed</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Downlights - fireplace</Name>
<Levels>FFFF007F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Slider</type>
<Name>Downlights - wall</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Wall lights</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>Slider</type>
<Name>Large spider light</Name>
<Levels>FF00FF62000000000000000000000000</Levels>
</Channel>
<Channel id="5">
<type>switch</type>
<Name>Small spider light</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="30">
<Type>Lights</Type>
<Title>Kitchen</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Pendants</Name>
</Scene>
<Scene id="3">
<Name>Wall lights</Name>
</Scene>
<Scene id="4">
<Name>Dimmed</Name>
</Scene>
<Scene id="5">
<Name>Pendant near doors</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Pendant lights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Slider</type>
<Name>Wall lights</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Downlights</Name>
<Levels>FF00003F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>switch</type>
<Name>Cabinet lights</Name>
<Levels>FF00003F000000000000000000000000</Levels>
</Channel>
<Channel id="5">
<type>Default</type>
<Name>Pendant near doors</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="33">
<Type>Lights</Type>
<Title>Back garden</Title>
<mode>4+OFF</mode>
<Scene id="1">
<Name>On</Name>
</Scene>
<Scene id="2">
<Name>Wall lights</Name>
</Scene>
<Scene id="3">
<Name>Soffit lights</Name>
</Scene>
<Scene id="4">
<Name>Dimmed soffit</Name>
</Scene>
<Channel id="1">
<type>Slider</type>
<Name>Soffit lights</Name>
<Levels>FF00FF3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>switch</type>
<Name>Stair lights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="3">
<type>Slider</type>
<Name>Wall lights</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
<Channel id="4">
<type>Slider</type>
<Name>Wall lights LHS</Name>
<Levels>FFFF003F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="10">
<Type>Lights</Type>
<Title>Ground floor stairs</Title>
<Channel id="1">
<type>Default</type>
<Name>Stairs</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
<Channel id="2">
<type>Default</type>
<Name>Landing</Name>
<Levels>FFBF7F3F000000000000000000000000</Levels>
</Channel>
</Room>
<Room id="28">
<Type>Lights</Type>
<Title>Living area</Title>
</Room>
<Room id="0">
<Type>Lights</Type>
<Title>Master</Title>
</Room>
</rooms>
</rako>

Here is a screengrab of the rakosoft view. This gives Room 0 a lightbulb icon. The other group master “rooms” aren’t in the rako.xml file. Rako reserves multiples of 4 as group masters, if you don’t use them for rooms, which permits you to address the next rooms in sequence together. For example, the loft bedroom (#5) and ensuite (#6) come within the group master (#4)

Rooms

Within HA your integration has picked up 67 entities from individual rako devices (dimmers and PIRs) plus the rooms I have defined and also room 0. It hasn’t created entities for the group masters.

In this screengrab Loft bedroom and Loft ensuite are rooms and the items beneath are individual rako devices. This is similar to the Rako app which shows the rooms (including Master) and the devices within each room (as channels).

What the Rako app can also do is control scenes which switch one or more devices (channels to preset levels).

The integration is extremely useful as it stands.

Best wishes,

Tom

Hi,

I should have been more cautious but I upgraded the HA core to core-2021.6.5. This wants a version number in the manifest.json file (which I have added) but also stopped the rako integration from loading. I have tried putting the latest code from your zip file in the custom_components/rako directory but still have this error:

2021-06-20 19:31:20 INFO (MainThread) [homeassistant.setup] Setting up rako
2021-06-20 19:31:20 INFO (MainThread) [homeassistant.setup] Setup of domain rako took 0.0 seconds
2021-06-20 19:31:20 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Rako Bridge (7253d571eb) for rako
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 293, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/config/custom_components/rako/init.py”, line 24, in async_setup_entry
name=entry.data[CONF_NAME],
KeyError: ‘name’

Kind regards,

Tom

Hi again

The Rako integration was fine until I upgraded to Home Assistant 2021.6.5. It looks like this requires a version number in the integration manifest. I fixed this and also refreshed the code from your zip file. However, I still have an error:

Logger: homeassistant.config_entries
Source: custom_components/rako/init.py:24

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 293, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/config/custom_components/rako/init.py”, line 24, in async_setup_entry
name=entry.data[CONF_NAME],
KeyError: ‘name’

I’m not sure what I can do next to fix this.

Best wishes,

Tom

Hi,

Thank you @marengaz for your work on this integration. I have Rako lighting and I’m excited about getting this working on my HA installation. I have to admit to being new’ish (3 months) to HA so I could be missing something trivial but I’m falling at the first hurdle.

I am following the instructions in the post above. I’ve downloaded and copied the files to config/custom_components/rako

~ $ ls -al config/custom_components/rako
total 56
drwxrwxr-x    3 root     root          4096 Jul 24 10:31 .
drwxr-xr-x    4 root     root          4096 Jul 24 10:31 ..
-rw-rw-r--    1 root     root          1908 May 28 11:56 __init__.py
-rw-rw-r--    1 root     root          4526 May 28 11:56 bridge.py
-rw-rw-r--    1 root     root          3510 May 28 11:56 config_flow.py
-rw-rw-r--    1 root     root            58 May 28 11:56 const.py
-rw-rw-r--    1 root     root          6865 May 28 11:56 light.py
-rw-rw-r--    1 root     root           245 May 28 11:56 manifest.json
-rw-rw-r--    1 root     root           416 May 28 11:56 model.py
-rw-rw-r--    1 root     root           723 May 28 11:56 strings.json
drwxrwxr-x    2 root     root          4096 Jul 23 11:18 translations
-rw-rw-r--    1 root     root           230 May 28 11:56 util.py

It’s not clear whether “Reboot home assistant” means a full reboot of the host or just a a restart of HA core so I’m doing the former.

On putting rako: in my configuration.yaml

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

homeassistant:
  customize: !include customize.yaml

google_assistant: !include google-assistant.yaml

rako:
  

and checking the config I get

Component error: rako - Integration 'rako' not found.

I’ve noted the response to this error above and I’m assuming the patch has been committed so I don’t need to figure out how to do that.

I’m guessing I need to tell HA somehow that the integration is installed? Any suggestions would be gratefully received. Thank you.

heya @hunterdrayman - i think there was a security problem at some point that affects custom components. the manifest.json file requires you to put a version in. heres an example in HACS
hopefully that will make it work?

1 Like

Great! Thank you. That did the trick. My bridge is on a VLAN isolated from the main network but when I put in the IP/MAC etc. it discovered my circuits (and areas too, I note - clever!).

Are you still interested in feedback? I don’t want to trouble you unnecessarily.

i wont be making any more changes to this PR because its taking ages to get approved and i feel like any extra stuff will slow it down further. following that though, sure. best place for it is probably this thread at the moment?

1 Like

I have frustrating little issue. I had the component installed manually (i think a version from May) and working with a few issues (sliders not updating, etc.). I grabbed the latest version (July) and simply copied over the directory in custom components and it fixed most of the problems but there were some oddities, so I tried a fresh install. As usual fixed the version in the manifest, added rako: to my configuration, rebooted. All the logs look good, but when I go to add the integration in HA the rako integration doesn’t appear!

I’m sure its something stupid I have done, but I can’t figure out what! Any ideas?

Grrr my bad - browser caching the integrations list. Sorted now.

It looks like I can switch my lights on & off from a standard light card (and use a dimming slider OK) but the UI switch/dimmer states only update when I restart HA. The logs show the command UDP packet going out, but nothing coming back. My Rako bridge and HA host are on separate VLANs - could this be the problem?

quite possibly. you can double check by using the rako app on your phone. press a button on one of your physical keypads and see if the app updates

Yup, that was it. I’ve had Rako kit for two years and never noticed that the phone app didn’t update when the physical buttons were pressed.
Fortunately, my HA host is a VM and it was easy to add another interface from it to the Rako bridge VLAN. The HA dials now update when I press a keypad button. Success! I just need to keep my fingers crossed that a multi-homed HA doesn’t break anything else.

@marengaz I have had rakomqtt working for a while. Until the proper integration gets approved what do you recommend, should I stick to what I have or install your new integration manually?

I should have some time this week to update the entities after the change.

@ShawWellPete If it helps, I have been using the integration for several months and have found it very stable. Using both the Rako bridge web API and the light.turn_on/off service has given me flexibility to select bridge-programmed scenes and to independently control channel-level brightness changes in Node-RED flows.
In that time I’ve had two problems: One where a reboot of the bridge and one where a reload of the integration were needed to set things right.
There’s one issue I yet need to solve. That’s where, sometimes a wall plate selected scene doesn’t update my Home Assistant dashboard with the new levels, but I suspect this is a network issue.

Thank you, what is the process for a new version of HA?

Configuration->Add Integration->Search for Rako and then follow the prompts

I have copied the rako directory from the downloaded core-rako and copied it to custom components (next to HACS), rebooted HA, then added rako: to the configuration.yaml and I get this error

2021-12-20_14-51-14

Don’t use HACS for this one. It’s a core integration.
Configuration->Add Integration->Search for Rako and then follow the prompts

Thanks for the reply, I didn’t try to use HACS but I copied the rako directory from the downloaded core-rako so it was in custom components (where HACS also is)

When I try to add in the integration as you described I get

2021-12-21_10-56-34