Rako Lighting

Rako Cloud Gateway - nope. not sure

1 Like

Hi just new to the HA party and have a house full of Rako gear with a Rako bridge (ie not the new Rako hub or the Rako cloud gateway).

Struggling a bit to get the existing integration to work - I can get the container running in Portainer but then what. I had expected to enter the IP address of my Rako bridge somewhere but that doesn’t seem to be in the steps unless I missed it.

What Rako bridge device are you using? Just the regular one or the one that integrates with Alexa etc?

Great to see you’re working on native/core Rako integration. I’d be very happy to get involved in testing that if it helps.

I had the same interpretation as you from the Rako integration docs about how feedback works - does seem a bit shortsighted of them but I guess it is 15+ year old design.

What Rako bridge device are you using? Just the regular one or the one that integrates with Alexa etc?

It uses the regular Rako Bridge that controls yoru lights not the Rako Cloud Gateway that integrates with Alexa

Did you see the notes I wrote after I got it working?

It explains there what you need to put into your configuration.yaml

Hi Peter. Thanks for coming back so quick. I had seen that but couldn’t figure out why nothing was happening. Figured it out tonight though. There were a couple of issues - a rogue “Schema” instead of “schema” in the yaml file and an issue with Mosquitto user setup. All working now.

Back on the status updates on Rako lights…

I noticed yesterday that when the playroom lights were turned on at the switch the status of the light in HA correctly changed which doesn’t happen with my other lights. I realised this is because the playroom Rako switch directly turns the light in and off as opposed to triggering a scene in in Rako. Most other rooms, the switch activates a scene, even if the scene is ‘set the light at 100%’.

I’m tempted to reprogram Rako so the first button in each room (what most people use) is a simple switch so that HA gets the right state.

PR for this Integration is out and ready for review https://github.com/home-assistant/core/pull/45915

The aim of this pr is to get feature parity with the rako app, so if you notice anything that the app can do that this home assistant integration can’t, let me know!

If you have some time and wanna test it out and give feedback before it’s merged, please:

  • download the zip of my code
  • unzip and grab the directory at homeassistant/components/rako
  • put that directory on your home assistant server at <config_dir>/custom_components/rako (i use the VS code addon)
  • Reboot home assistant
  • put rako: in your configuration.yaml
  • Reboot home assistant
  • go to configuration > integrations > add > rako and everything should auto discover

If you’re already running rakomqtt, then you’ll have to stop that pod, otherwise there will be a port clash. Your mqtt broker can obvs stay running though

Debug logging can be enabled by amending your configuration.yaml to look like this (reboot after adding it):

logger:
  default: info
  logs:
    homeassistant.components.rako: debug
    python_rako: debug

in the configuration > logs page you will have to click ‘Load Full Home Assistant Log’ and search for ‘rako’.

Let me know your findings!

1 Like

I’ll have a try this weekend, thank you for doing this!

As you know I have been using your old method. Should i remove all the lights from the configuration.yaml file first?

I assume the entity names will remain as before so all the automations and node red flows should carry on working?

As you know I have been using your old method. Should i remove all the lights from the configuration.yaml file first?

these will not continue to work without the rakomqtt pod, but they will also not conflict, so you can leave them there if you want.

I assume the entity names will remain as before so all the automations and node red flows should carry on working?

your current entity names are arbitrarily defined by you in the config yaml. the entity ids for this new integration are autogenerated based on whatever they are named on the rako bridge.

1 Like

Great, thank you, I’m happy to say I mostly kept the same names as the Rako Bridge, but looks like I’ll need to do some updating.

I think I have done it all correctly…

But

Any ideas?

teeny error i didn’t see on my dev machine, because i never set up everything from a blank slate! nice catch!

i have now set up everything from scratch on a different machine and didnt find any more bugs.

here’s the fix i made to __init__.py which you can replicate on your side - https://github.com/home-assistant/core/pull/45589/commits/440d38b2c80ce2668d0e8cb513ad3cbd1d3749ef

Thanks for continuing to develop this. I have installed as described but hitting an error when trying to connect to the bridge.

  • I can connect and send commands using telnet on default port. I’ve closed all telnet sessions.
  • It was working using the rakomqtt in portainer linked to mqtt broker. I’ve stopped that service though.
  • It works using the iphone app but I’ve closed the app.
  • I haven’t got rasoft running.

I found Rako at configuration > integrations > add integration

It prompts with the correct autopopulated bridge and port details, but then fails to connect to bridge.

I added the logger section above but nothing appearing in /config/home-assistant.log

Any thoughts?

Thanks
Richard

Hi Marengaz,

I managed to get it installed and mostly working correctly but there was a problem with the ui-lovelace. When I turned a light on or off, the state would not correctly update. I mostly use a combination of regular entities card and Custom Slider Entity Row, eg

type: entities
title: Floor 0
entities:
  - type: section
    label: Kitchen
  - type: 'custom:slider-entity-row'
    entity: light.kitchen_lh_downlights
    name: Left
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.kitchen_rh_downlights
    name: Right
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.kitchen_pelmet
    name: Pelmet
    hide_when_off: true
    toggle: true
  - type: section
    label: Family Room
  - type: 'custom:slider-entity-row'
    entity: light.family_room_downlights
    name: Ceiling
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.family_room_pendant
    name: Pendant
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.family_room_tiffany
    name: Tiffany Lamp
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.family_room_reading_lamp
    name: Reading Lamp
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.family_room_picture_lamp
    name: Picture Lamp
    hide_when_off: true
    toggle: true
  - type: section
    label: Dining Room
  - type: 'custom:slider-entity-row'
    entity: light.dining_room
    hide_when_off: true
    toggle: true
  - type: section
    label: Store Rooms
  - type: 'custom:slider-entity-row'
    entity: light.lower_hallway
    name: Lower Hall Way
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.boot_room
    name: Boot Room
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.plant_room
    name: Plant Room
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.pantry
    name: Pantry
    hide_when_off: true
    toggle: true
  - type: 'custom:slider-entity-row'
    entity: light.wine_cellar
    name: Wine Cellar
    hide_when_off: true
    toggle: true

The light would turn off the button pops back to the on position.

I have had to restore to the old method to keep my wife happy but I’ll be able to test further at the weekend

hey pete - good to hear you got the integration set up ok.

with the lovelace dash, maybe you can create an autogenerated dash alongside your custom one, just to make sure the behaviour is the same?

can you also add the debug logging config to your configuration file and let me know what you see when you hit wall plate switches vs hitting the same switch in hass? in the ‘logs’ page you will have to click ‘Load Full Home Assistant Log’ and search for ‘rako’

1 Like

hey richard - thanks for taking the time to test this out!

did you reboot after adding the debug logging config? im not sure if this is necessary, but i think it is?
in the ‘logs’ page you will have to click ‘Load Full Home Assistant Log’ and search for ‘rako’.

this ‘cannot connect’ error may arise when the rako xml is not parsable. please can you send me your rako.xml? it can be found here: http://<your_bridge_ip>/rako.xml

Will do, may have to wait for the weekend

No problem - really hope I can get it working.

I’ve sent you a couple of direct messages with the result of the “rako” log search and the xml file.

hi @ShawWellPete @ralc

i had to make quite significant changes (every file!) to adapt the integration to work for @ralc’s rako bridge, which doesn’t show its mac address. can you let us know it works now?

before copying the new files, please can you delete the old instance of the integration (on the configuration > integrations page)
then follow along this guide again to re-install?
note that it includes an extra reboot compared with last time. apparently the ‘bug’ pete first found was not a bug, just a quirk of custom components

Wow thanks @marengaz!

So good news is that it auto-detects and installs the integration fine. However it does not seem to find any entities.

To summarise my steps:

  • Removed Rako: entry from configuration.yaml
  • Emptied the light-channels.yaml I was using with the mqtt solution I was using previously

Installed the integration and restarted server.
Added Rako: entry and restarted server.

Log entries:
2021-02-02 21:27:07 DEBUG (MainThread) [python_rako.bridge] Requesting cache: RequestType.SCENE_LEVEL_CACHE

2021-02-02 21:27:17 WARNING (MainThread) [homeassistant.components.light] Setup of light platform rako is taking over 10 seconds.

2021-02-02 21:28:07 ERROR (MainThread) [homeassistant.components.light] Setup of platform rako is taking longer than 60 seconds. Startup will proceed without waiting any longer.

Thanks again.

Richard

making progress at least!

this bit where it times out is where hass asks the rako bridge what the light levels currently are, so it can set the initial brightness of the light.

i added a 3s timeout here

i also bumped the version of my lib so that it reports some more logging

let me know what happens in the logs this time