Rako Lighting

Sorry I know I have done this before but I am trying this again and I can’t seem to fix the code this time (starting from scratch again)

Which lines do I need to copy and paste into the init.py , 9 through to 27?

If you’re starting from scratch, this guide should work. No extra code changes
Rako Lighting

Hi. So the good news is that the RAKO Hub arrived, was detected straight away and I now have semi working lights.

However still not quite right:

  • HA slider successfully controls lights.
  • HA On/Off switch works. If I click the switch it moves to on position and lights go on. But then the switch returns itself to off position (similar to before) but lights stay on.
  • If I click the HA on/off switch again, the switch moves to on position and returns to off position after a couple of seconds. However the lights do not change.
  • If I double click the HA on/off switch, the lights do now switch off.
  • Controlling the lights from the wall panel does not change the switch or slider position in HA. However I wasn’t sure if you’d implemented feedback.

So some progress but not quite there fully.

Have to say the web interface for this HUB product is night and day better than the WRE I had.

Thanks
Rich

Hey Rich - glad to hear we’re not back at square one with the hub at least! Did you grab the most recent code? I pushed a fix for a bug I found which caused similar symptoms 2 days ago

Hi no I hadn’t realised! So I took the latest code and that worked(!!) … for a while and then stopped.

This is what worked:

  • HA light slider control and on/off switch on the Room or Device entity controls the lights fine.
  • When viewing the Room entity, HA slider updates the scene 1-4 based on position of slider. This also reflected in the iphone app.
  • When viewing the Device entity, HA slider updates the level of that dimmer directly. Obviously this is not updated in the iphone app as it does not match to a scene.
  • On/off buttons work fine and when controlled from the iphone app or wall plate the status updates in HA (slider, on/off switch and bulb icon).
  • As soon as I use the dimmer on iPhone app or wall plate it breaks. The HA controls will still control the lights, but a) the on/off switch in HA seems to always return to the on position (opposite symptom to what I spotted last night); and b) using the iphone app or wall plate to switch off or select scene no longer updates in HA.

My tests in detail …

Following an HA restart I used the iPhone app to turn lights off/change scenes in one of the rooms. Did not use the dimmer buttons. All worked as expected when monitoring the Room entity (as opposed to the device entity) - the slider, bulb icon and on/off button updated to show light status.

2021-02-12 15:49:26 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 0, 253]
2021-02-12 15:49:26 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=0)
2021-02-12 15:49:34 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 1, 252]
2021-02-12 15:49:34 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=1)
2021-02-12 15:49:39 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 3, 250]
2021-02-12 15:49:39 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=3)
2021-02-12 15:49:45 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 0, 253]
2021-02-12 15:49:45 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=0)
2021-02-12 15:49:48 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 1, 252]
2021-02-12 15:49:48 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=1)

Then I used the HA controls - room entity on/off switch and slider. This worked fine too and switched the lights as expected. It looks like on the room entity control (as opposed to device entity) the slider selects scene 1 to 4 depending on where the slider is. Note that this also correctly reflected in the iphone app (ie move slider to 60% it lights up scene 3 button)

2021-02-12 15:49:54 DEBUG (MainThread) [python_rako.bridge] Sending command: CommandUDP(room=209, channel=0, command=<CommandType.SET_SCENE: 49>, data=[1, 3], message_type=<MessageType.REQUEST: 82>)
2021-02-12 15:49:54 DEBUG (MainThread) [python_rako.bridge] Sending command bytes: [82, 7, 0, 209, 0, 49, 1, 3, 243]
2021-02-12 15:49:54 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 3, 250]
2021-02-12 15:49:54 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=3)
2021-02-12 15:49:58 DEBUG (MainThread) [python_rako.bridge] Sending command: CommandUDP(room=209, channel=0, command=<CommandType.SET_SCENE: 49>, data=[1, 4], message_type=<MessageType.REQUEST: 82>)
2021-02-12 15:49:58 DEBUG (MainThread) [python_rako.bridge] Sending command bytes: [82, 7, 0, 209, 0, 49, 1, 4, 242]
2021-02-12 15:49:58 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 4, 249]
2021-02-12 15:49:58 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=4)
2021-02-12 15:50:02 DEBUG (MainThread) [python_rako.bridge] Sending command: CommandUDP(room=209, channel=0, command=<CommandType.SET_SCENE: 49>, data=[1, 4], message_type=<MessageType.REQUEST: 82>)
2021-02-12 15:50:02 DEBUG (MainThread) [python_rako.bridge] Sending command bytes: [82, 7, 0, 209, 0, 49, 1, 4, 242]
2021-02-12 15:50:02 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 4, 249]
2021-02-12 15:50:02 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=4)
2021-02-12 15:50:04 INFO (MainThread) [homeassistant.components.upnp] No UPnP/IGD devices discovered
2021-02-12 15:50:04 INFO (MainThread) [homeassistant.components.upnp] Unable to create UPnP/IGD, aborting
2021-02-12 15:50:04 WARNING (MainThread) [homeassistant.config_entries] Config entry for upnp not ready yet. Retrying in 80 seconds
2021-02-12 15:50:05 DEBUG (MainThread) [python_rako.bridge] Sending command: CommandUDP(room=209, channel=0, command=<CommandType.SET_SCENE: 49>, data=[1, 0], message_type=<MessageType.REQUEST: 82>)
2021-02-12 15:50:05 DEBUG (MainThread) [python_rako.bridge] Sending command bytes: [82, 7, 0, 209, 0, 49, 1, 0, 246]
2021-02-12 15:50:06 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 0, 253]
2021-02-12 15:50:06 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=0)
2021-02-12 15:50:08 DEBUG (MainThread) [python_rako.bridge] Sending command: CommandUDP(room=209, channel=0, command=<CommandType.SET_SCENE: 49>, data=[1, 1], message_type=<MessageType.REQUEST: 82>)
2021-02-12 15:50:08 DEBUG (MainThread) [python_rako.bridge] Sending command bytes: [82, 7, 0, 209, 0, 49, 1, 1, 245]
2021-02-12 15:50:08 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 1, 252]
2021-02-12 15:50:08 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=1)

Then I tried using the wall plate. Selecting Off or scenes while monitoring the room entity in HA. All was fine as above - HA controls/slider/icon responded to show the scene/status of the lights…

2021-02-12 15:50:31 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 0, 253]
2021-02-12 15:50:31 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=0)
2021-02-12 15:50:35 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 1, 252]
2021-02-12 15:50:35 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=1)
2021-02-12 15:50:41 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 2, 251]
2021-02-12 15:50:41 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=2)
2021-02-12 15:50:44 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 0, 253]
2021-02-12 15:50:44 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=0)
2021-02-12 15:50:46 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 209, 0, 49, 1, 1, 252]
2021-02-12 15:50:46 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=209, channel=0, scene=1)

Then finally using the wall plate I started to use the dimmer buttons. I got one trace as below and then nothing worked anymore. HA does not respond to scenes/off being selected in iPhone app or wall plate. When using HA controls they control the lights fine but the on/off switch always returns to on position. Restarting HA server fixes it again. Note this also happens with the iphone app dimmer buttons.

It seems maybe the wall dimmer buttons are knocking it out somehow. However when using the slider on either Room entity (which selects a scene) or the Device entity (which sets the dimmer level directly) this does not break it.

2021-02-12 15:50:59 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 6, 0, 209, 0, 50, 129, 124]

Note I have noticed I am getting the following sometimes in HA logs (appears periodically in the traces above). May not be related.

2021-02-12 15:51:34 INFO (MainThread) [homeassistant.components.upnp] No UPnP/IGD devices discovered
2021-02-12 15:51:34 INFO (MainThread) [homeassistant.components.upnp] Unable to create UPnP/IGD, aborting
2021-02-12 15:51:34 WARNING (MainThread) [homeassistant.config_entries] Config entry for upnp not ready yet. Retrying in 80 seconds

I did notice when monitoring the UDP-Feedback tab in Rasoft that when using the dim up/down buttons on the wall plate that not every command is recognised (although it is more than is shown in the trace above). Sometimes I only get the Stop command coming through (ie when I release the dimmer button) sometimes I get both the Dim Up (when pressed) and Stop commands (when released).

Sorry lots of detail but hopefully helps narrow it down.

seems like fade and friends (other unsupported messages from the bridge) were killing the hass process listening for updates. i thought i fixed this a few days ago, but clearly i did a poor job!

here’s a patch
youll only need to

  • apply the changes in bridge.py and manifest.json
  • reboot

i’m now 99% sure it’ll work resiliently!

now, when fade and friends comes through, you’ll see messages like below in hass.

question: should change these 'warning’s to 'info’s so they dont show up?

Apologies for not getting a chance to try this last weekend, I was busy integrating Konnected with my house alarm which took a lot more time than I expected. Hope to test weekend.

no probs! i think the code is actually working properly now, so your time before might have been wasted!

unfortunately, i also don’t think there’s any rush. my PR is on page 3/13, so fairly near the back of the queue to be reviewed!

1 Like

Legend. That seems to have done the trick. Thanks so much for this and the speedy responses are greatly appreciated!

Hi

Thank you so much for working on Rako integration. I would like to help test this if I can.

I have followed the installation instructions but don’t get very far when starting the integration. There is no prompt for the Rako bridge address. Any suggestions would be much appreciated.

The log shows:

2021-04-24 11:01:18 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration rako: cannot import name ‘FlowResultDict’ from ‘homeassistant.data_entry_flow’ (/usr/src/homeassistant/homeassistant/data_entry_flow.py)

The Rako bridge is a WTC so I think reasonably current. It supports web/app access, control, and configuration.

I have mosquito up-and-running and have just been able to use this to hook up to a Texecom alarm panel.

The first section of the rako.xml shows

-<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>3D</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>

Many thanks

Tom

hi tom

to fix this issue, make the following changes to homeassistant/components/rako/config_flow.py :
lines 27-29: change this

    async def async_step_user(
        self, user_input: Optional[ConfigType] = None
    ) -> FlowResultDict:

to this

    async def async_step_user(
        self, user_input: Optional[ConfigType] = None
    ):

remove line 13 (from homeassistant.data_entry_flow import FlowResultDict)


reason for issue:
the FlowResultDict object is a very recent addition to home assistant. so recent that it hasn’t been released yet (it will be released with v2021.5.0 in a few weeks).
i have already updated the Rako code in my PR to account for this

Thank you so much. I just made the change and it works. There is something quite impressive in seeing it find the Rako bridge, auto discover the lights and then being able to toggle the lights on and off from the overview screen all in a few seconds.

It looks like it has read the information in from the bridge perfectly including the current state.

Thanks again,

Tom

1 Like

Hi

Apologies if I am missing something obvious; I am still finding my way around HA. Your Rako integration is running fine. I can’t work out if it is possible to trap keypad events. I have a master RP07 keypad which is set to room 0 and can therefore be used to switch off all the lights. The Rako bridge picks up the event if I set the room scene to “off”. Is there a way to see this within HA? Is your integration listening for this?

Many thanks,

Tom

hey tom

i didnt realise room 0 was a proxy for switching all lights to a certain scene/brightness. i imagine that the integration is receiving this event, then just ditching it because it’s unaware of any ‘room 0’. you can check what its doing by adding debug logging, as mentioned here.

as for supporting this in hass, its probs something i can do, but im hesitant to make any more changes to the PR right now (and make it even bigger) because im struggling to get it reviewed and merged as it is! hopefully once this first big one is merged, smaller features will be more quickly merged in the future.

best regards
ben

Hi Ben,

No worries - I don’t expect you to adapt your code for me and I hope the PR gets to the top of the pile soon. Rako hard code Room 0 as the master so it can be used to control the whole house. It’s a bit like the other group master room numbers.

Rooms

Thanks for the link - I had this setup badly so couldn’t see what was happening. Now I have fixed it and can see the rako events in the HA log.

2021-05-30 18:37:38 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 23, 0, 49, 0, 1, 183]
2021-05-30 18:37:38 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=23, channel=0, scene=1)
2021-05-30 18:37:59 DEBUG (MainThread) [python_rako.bridge] Received bytes: [83, 7, 0, 0, 0, 49, 0, 0, 207]
2021-05-30 18:37:59 DEBUG (MainThread) [python_rako.bridge] Deserialised received message as: SceneStatusMessage(room=0, channel=0, scene=0)

Room 0 is picked up. The integration has also created an entity for Room 0 and I can call services with this entity but I’m not sure how I can watch for the events that come from the Room 0 (or any other) keypad.

Best wishes,

Tom

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.