Support for RFLink Gateway

I updated to v0.40.0 today, but since then all my RFlink sensors and lights stopped working. The strange thing is that switches are still working correctly.

When pressing the on or off button, nothing happens. When using an alias’ed remote, the switch actually toggles, so it’s receiving command correctly. But if you then click the switch in HASS, it toggles back after a few secs to it’s old state without actually switching the light on or off.

Sensor data is simply not received.

Also, RFlink devices with a space in it’s name are triggering all kinds of errors since 0.40:

17-03-12 21:43:41 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
  File "/home/stefan/.local/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 359, in async_process_entity
new_entity, self, update_before_add=update_before_add
  File "/home/stefan/.local/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 208, in async_add_entity
    'Invalid entity id: {}'.format(entity.entity_id))
homeassistant.exceptions.HomeAssistantError: Invalid entity id: light.Overloop zolder

Maybe it’s no related to RFlink specifically, since nothing much has changed since 0.39.x as far as I can see, but does anyone else see these problems as well?

After downgrading back to 0.39.3 with the exact same config, everything is working fine again.

It probably has to do with the space in the entity name. I ran into the same issue with one of my devices. I still need to figure out why this is happening have not looked into it yet. For now the workaround is to add ‘_’ where the space was.

I tried that, but then lights and sensors still aren’t working, even after removing the database.

Also, after changing the spaces to underscores I tried setting the friendly_name in the customize options, but they didn’t seem to pick up, is that unsupported by RFlink device ID’s?

I created an issue where I will keep track of this bug and will be updating the status there:

When I have time to test this at home I will see what it requires to resolve this.

I was able to solve this by removing the spaces in the names in my 0.39.3 installation and setting friendly_names accordingly. Restarting the installation so the changes were picked up. And I then upgraded to 0.40 without problems. All my lights, sensors and switches are working correctly now.

So in case anyone else runs into this, tl;dr: remove spaces in names before you upgrade to 0.40.

Howto get the full usb port id ?
after trying
pi@masterpi:/ $ ls /dev/serial/by-id/
ls: cannot access /dev/serial/by-id/: No such file or directory

I cannot find the complete usb port id.
Any suggestions ?

passie

It depends on your Linux version, if it has support for udev and if udev is installed/enabled/configured correctly. (for reference: https://wiki.archlinux.org/index.php/persistent_block_device_naming)

Thank you, did a new install but now with Hassbian and now it works.

Another question ( sorry, just starting to learn HA)
I have added

sensor:
  platform: rflink
  new_devices_group: "New Rflink Lights"

But in the logs it’s complaining with the following message.

17-03-28 08:59:07 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.rflink]: 
[new_devices_group] is an invalid option for [sensor.rflink]

I have the same problem as you, I have just start to play with HASS

And i also notice that the auto discovery don’t work.

I’m using the following code and auto discovery is working.

rflink:
  port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0

sensor:
  platform: rflink
#   new_devices_group: "New"

light:
  platform: rflink
  device_defaults:
    fire_event: true
    signal_repetitions: 2
  devices:
    newkaku_0000c6c2_1:
      name: Living room

the device above is just for testing.
Though, after setting it up you don’t want auto discovery anymore since you don’t want to control the lights from others.
Maybe removing this would help.

discovery:

@passie @pixiandreas discovery is not related to rflink. A recent change removed support for the new_devices_group. Some mess still needs to be cleaned up for that.

Thsi is what i get in the log
I got some debug text but that all.

And from configfile:
# Discover some devices automatically
discovery:

But the device don’t show up in the GUI ?

17-03-29 18:16:14 INFO (MainThread) [homeassistant.components.http] Serving 
/api/12345678901234567890/lights to 192.168.6.144 (auth: True)
packet {'command': 'off', 'switch': '03', 'protocol': 'eurodomest', 'node': 'gateway', 'id': '0d509e'}
packet {'command': 'off', 'switch': '03', 'protocol': 'eurodomest', 'node': 'gateway', 'id': '0d509e'}
17-03-29 18:16:17 INFO (MainThread) [homeassistant.components.http] Serving 
/api/camera_proxy/camera.ffmpeg to 192.168.6.199 (auth: True)
17-03-29 18:16:18 INFO (Thread-1) [homeassistant.components.device_tracker.nmap_tracker] 
Scanning...
packet {'command': 'off', 'switch': '03', 'protocol': 'eurodomest', 'node': 'gateway', 'id': '0d509e'}

You can completely ignore the discovery in regard to Rflink. Can you post your Rflink config. Also can you enable debug logging and show the output:

logger:
  default: info
  logs:
    rflink: debug
    homeassistant.components.rflink: debug
1 Like

Here is my config

rflink:
port: /dev/ttyUSB1

And here is the debug:

17-03-30 19:00:17 DEBUG (MainThread) [rflink.protocol] received data:
20;05;Eurodomest;ID=0d509e;SWITC
17-03-30 19:00:17 DEBUG (MainThread) [rflink.protocol] received data: H=03;CMD=OFF;
17-03-30 19:00:17 DEBUG (MainThread) [rflink.protocol] got packet: 20;05;Eurodomest;ID=0d509e;SWITCH=03;CMD=OFF;
17-03-30 19:00:17 DEBUG (MainThread) [rflink.protocol] decoded packet: {‘command’: ‘off’, ‘protocol’: ‘eurodomest’, ‘node’: ‘gateway’, ‘switch’: ‘03’, ‘id’: ‘0d509e’}
17-03-30 19:00:17 DEBUG (MainThread) [rflink.protocol] got event: {‘id’: ‘eurodomest_0d509e_03’, ‘command’: ‘off’}
17-03-30 19:00:17 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {‘id’: ‘eurodomest_0d509e_03’, ‘command’: ‘off’}
17-03-30 19:00:17 DEBUG (MainThread) [homeassistant.components.rflink] device_id not known, adding new device
packet {‘command’: ‘off’, ‘protocol’: ‘eurodomest’, ‘node’: ‘gateway’, ‘switch’: ‘03’, ‘id’: ‘0d509e’}

and one more:

17-03-30 19:00:06 DEBUG (MainThread) [rflink.protocol] received data: 20;04;EV1527;ID=099fc0;SWITCH=02
17-03-30 19:00:06 DEBUG (MainThread) [rflink.protocol] received data: ;CMD=ON;
17-03-30 19:00:06 DEBUG (MainThread) [rflink.protocol] got packet: 20;04;EV1527;ID=099fc0;SWITCH=02;CMD=ON;
17-03-30 19:00:06 DEBUG (MainThread) [rflink.protocol] decoded packet: {‘command’: ‘on’, ‘protocol’: ‘ev1527’, ‘node’: ‘gateway’, ‘switch’: ‘02’, ‘id’: ‘099fc0’}
17-03-30 19:00:06 DEBUG (MainThread) [rflink.protocol] got event: {‘id’: ‘ev1527_099fc0_02’, ‘command’: ‘on’}
17-03-30 19:00:06 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {‘id’: ‘ev1527_099fc0_02’, ‘command’: ‘on’}
17-03-30 19:00:06 DEBUG (MainThread) [homeassistant.components.rflink] device_id not known, adding new device
packet {‘command’: ‘on’, ‘protocol’: ‘ev1527’, ‘node’: ‘gateway’, ‘switch’: ‘02’, ‘id’: ‘099fc0’}

Hi aequitas,

Thanks for the excellent work on support for the RFLink gateway. The fact HA is now supporting RFLink made me migrate to HA.

Unfortunately I can’t get it working because the new_devices_group is no longer working. Do you have a suggestion on how to find out the device names without the new_devices_group feature?

Regards,
Ruud

Sorry for the late response. Output looks good. Let me check if there is not a bug since the latest changes and come back on it.

New devices should be added to Hass automatically unless the automatic add config option is set to false. Maybe your configuration does not show ungrouped devices on you frontpage? Check the states debugging screen if devices are listed there. And check logging if you can see any errors.

Thanks, works fine now!

I have added some devices (kaku lights ) with rflink and added them to there groups. Every time I restart HA the devices are gone. When i press the remote they become visible again. what should i do so HA remembers these lights after a reboot?

@passie You need to add your kaku lights to your configuration.yaml file.

E.G.

light:
  platform: rflink
  device_defaults:
    fire_event: true
    signal_repetitions: 2
  devices:
    kaku_7654321_1: #replace with your lights
      name: Living room 1
    kaku_1234567_1: #replace with your lights
      name: Living room 2