WTH is RFLink doing with underscores - RESOLVED

I’m still a fan of 433 - cheap, and in the right setting, reliable enough to love. I run the RFLink component with the RFLink Gateway on Arduino but I have run into trouble with a Dooya_v4 protocol to control blinds. Usually an underscore from Hassio is turned into a semi colon to delineate protocol;device;switch. With an underscore in the protocol it creates an error:

2020-08-24 18:39:51 DEBUG (MainThread) [homeassistant.components.rflink] Rflink command for {'command': 'on', 'device_id': 'dooya_v4_6d5f8e00_3f'}
2020-08-24 18:39:51 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2815618640] 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1308, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1343, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/rflink/__init__.py", line 134, in async_send_command
    await RflinkCommand.send_command(
  File "/usr/src/homeassistant/homeassistant/components/rflink/__init__.py", line 457, in send_command
    return await cls._protocol.send_command_ack(device_id, action)
  File "/usr/local/lib/python3.8/site-packages/rflink/protocol.py", line 223, in send_command_ack
    self.send_command(device_id, action)
  File "/usr/local/lib/python3.8/site-packages/rflink/protocol.py", line 186, in send_command
    command = deserialize_packet_id(device_id)
  File "/usr/local/lib/python3.8/site-packages/rflink/parser.py", line 459, in deserialize_packet_id
    assert len(id_switch) < 3
AssertionError

Im pretty sure that the parsing is struggling with the underscore in the RFLink protocol WTH can I do to fix this?

IMHO it seems that this is a bug in the rflink library that HA uses.
Clearly the library expects no more than 2 underscores:

What you can do is open an issue in the library repository (or much better a PR) exposing the case.
I can’t say if the problem has an easy solution. In any case, surely the author can give you an answer.

Meanwhile, maybe there is another rflink protocol that can work with your dooya_v4 blinds, but sorry not to be of help in that matter.

1 Like

@javicalle I have noticed that you have made a few PRs for RFLink in Home assistant previously. I have no idea what I’m doing on github I can’t find the files for the merge that Aequitas has now changed here:

Can you help me create the PR? I don’t know how to do it with not being able to find the parser.py file within the HA repos.

Hi @jgrob1, sure I can. In this case will be pretty easy.

You need to know that rlink library is a HA dependency. What @aequitas has done is create a new version of the library (v0.0.54). Now what you have to do is tell HA to use this new version. To do this you just have to modify this file:

You can do it from browser (edit & create a PR).
Here are some similar examples:

Try it and if you have any problem I can help you.

Well done!

Now that PR #39342 has already been merged, it will surely be available in the next minor version of HA (I guess 0.115).

As reported by the development team, the version will be released around 09/17, a little later than usual:


.

Thanks. But its fixed already.

Maybe consider editing the title of the post to say resolved

Thanks. Done