home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.07k stars 29.73k forks source link

RFlink transmit not working #54250

Closed markusg1234 closed 2 years ago

markusg1234 commented 3 years ago

The problem

I can't seem to get rflink to transmit a 433Mz signal. A failed to call service message pops up on the dashboard. Errors occur in log.

This is the first time I have tried to transmit so I might be missing something.

I have no issues with receiving from rflink.

What is version of Home Assistant Core has the issue?

core-2021.8.3

What was the last working version of Home Assistant Core?

unknown

What type of installation are you running?

Home Assistant OS

Integration causing the issue

rflink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/rflink/

Example YAML snippet

switch:
  - platform: rflink
    devices:
      ev1527_04518f_0e:
        name: "test"

binary_sensor:  
    - platform: rflink
      devices:
        ev1527_04518f_0e:      
          name: "Remote Left"

Anything in the logs that might be useful for us?

2021-08-08 14:25:55 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: on to Rflink device: ev1527_04518f_0e
2021-08-08 14:25:55 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'ev1527', 'id': '04518f', 'switch': '0e', 'command': 'on'}
2021-08-08 14:25:55 DEBUG (MainThread) [rflink.protocol] writing data: '10;ev1527;04518f;0e;on;\r\n'
2021-08-08 14:25:55 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement
2021-08-08 14:26:00 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140480492770736] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/locks.py", line 226, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 856, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/rflink/__init__.py", line 600, in async_turn_on
    await self._async_handle_command("turn_on")
  File "/usr/src/homeassistant/homeassistant/components/rflink/__init__.py", line 537, in _async_handle_command
    await self._async_send_command(cmd, self._signal_repetitions)
  File "/usr/src/homeassistant/homeassistant/components/rflink/__init__.py", line 563, in _async_send_command
    await self._protocol.send_command_ack(self._device_id, cmd)
  File "/usr/local/lib/python3.9/site-packages/rflink/protocol.py", line 257, in send_command_ack
    yield from asyncio.wait_for(
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

rflink documentation rflink source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @javicalle, mind taking a look at this issue as it has been labeled with an integration (rflink) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

javicalle commented 3 years ago

Hi, could you include your RFLink configuration? There are 2 connections types (USB or TCP), if yours is TCP, could you explain how are you exposing the serial interface over TCP.

Regards.

markusg1234 commented 3 years ago

Hi, I am using TCP with esp-link v3.0.14

Under the uC console I can see received signals that also Home Assistant detects.

I don't see any logs for when I change this switch to on. All that happens is a failed to call service message pops up. switch:

Regards.

javicalle commented 3 years ago

I have no experience with those kinds of connections, but I think I have read about similar problems. Your case reminds me of this one, but I don't know if it is the same type of configuration as in your case:

In some cases I have read that it must be configured as 'raw', but it depends on how the connection is configured. Can you check if this may be your problem?

markusg1234 commented 3 years ago

Hi, The way I have it set up is mentioned in the documentation on page http://www.home-assistant.io/intergrations/rflink/ using the serial bridge esp-link with a ESP8266 Arduino Mega 2560. I was planning to have the receiver away from the server.

I tried decided to try a direct serial connection to home assistant server and both receive and transmit works correctly which was great to see it work.

On changing back to TCP I saw it work about 1 in 20 on TCP.

Not sure what the issue could be, I'm thinking of now moving the location to where the server is for direct serial connection.

javicalle commented 3 years ago

Hi, when you talk about a "direct serial connection", do you mean a connection via USB cable? Or a TCP (with host and port configuration)?

It seems clear that the RFLink hub is working properly. Could it be a distance problem? Have you tried the same configuration but closer to your HA?

If the problem were in the timeout, you would have the errors in HA but the devices would react to the signals. If the devices are not reacting, I think it must be more of a connectivity issue, either due to range or due to some other cause.

markusg1234 commented 3 years ago

Hi,

Sorry I did mean a usb connection works correctly.

I think it is some other cause for TCP not to work one way as I am monitoring the signal to HA which is working but the signal from HA to the RFLink hub is not.

I can see this with the comms monitor built into esp-link.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.