Rfxtrx switch automations not working after 24h

Hi, I have a simple automation that works good the first time it is fired. The day after it seems like something with the connection to my rfxcom-usb is not working. Here is a working log:

2018-11-24 14:15:17 INFO (MainThread) [homeassistant.components.automation] Executing turn on the 
lights when the sun sets

2018-11-24 14:15:17 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Running script

2018-11-24 14:15:17 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Executing step call service

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x10 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x03 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x01 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x0e 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x02 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x0f 0x01 0x00 0x00

2018-11-24 14:15:17 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Executing step call service

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x04 0x02 0x01 0x00 0x00

RFXTRX: Recv: 0x08 0x50 0x03 0xa5 0xf9 0x01 0x00 0x10 0x49 

And here is the log when it´s not working:

2018-11-25 14:13:11 INFO (MainThread) [homeassistant.components.automation] Executing turn on the 
lights when the sun sets

2018-11-25 14:13:11 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Running script

2018-11-25 14:13:11 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Executing step call service

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x10 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x03 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x01 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x0e 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x01 0xa0 0x83 0x42 0x02 0x01 0x00 0x00

RFXTRX: Send: 0x0b 0x11 0x00 0x00 0x03 0x8d 0xb7 0x4a 0x0f 0x01 0x00 0x00

2018-11-25 14:13:11 INFO (MainThread) [homeassistant.helpers.script] Script turn on the lights when the 
sun sets: Executing step call service

2018-11-25 17:28:08 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 
172.18.0.12 (auth: False)

2018-11-25 17:28:08 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 
172.18.0.12 (auth: True)

more logs:

2018-12-19 07:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Morning lights On
2018-12-19 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights On: Running script
2018-12-19 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights On: Executing step call service
2018-12-19 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights On: Executing step call service
2018-12-19 07:10:19 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 172.18.0.11 (auth: False)
2018-12-19 07:10:20 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 172.18.0.11 (auth: True)
2018-12-19 07:10:21 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139821253482480] Error handling message: {'id': 2, 'type': 'subscribe_events', 'event_type': 'state_changed'}
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/connection.py", line 66, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 102, in handle_subscribe_events
    if not connection.user.is_admin:
AttributeError: 'NoneType' object has no attribute 'is_admin'
2018-12-19 07:10:21 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139821253482480] Error handling message: {'id': 3, 'type': 'get_states'}
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/connection.py", line 66, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 161, in handle_get_states
    entity_perm = connection.user.permissions.check_entity
AttributeError: 'NoneType' object has no attribute 'permissions'
2018-12-19 07:10:26 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 172.18.0.11 (auth: True)
2018-12-19 07:10:26 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.139821253482480] Connection closed by client
2018-12-19 07:10:26 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 172.18.0.11 (auth: False)
2018-12-19 07:10:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139821253484440] Error handling message: {'id': 4, 'type': 'subscribe_events', 'event_type': 'state_changed'}
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/connection.py", line 66, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 102, in handle_subscribe_events
    if not connection.user.is_admin:
AttributeError: 'NoneType' object has no attribute 'is_admin'
2018-12-19 07:10:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139821253484440] Error handling message: {'id': 5, 'type': 'get_states'}
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/connection.py", line 66, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 161, in handle_get_states
    entity_perm = connection.user.permissions.check_entity
AttributeError: 'NoneType' object has no attribute 'permissions'
2018-12-19 07:10:29 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 172.18.0.11 (auth: True)
2018-12-19 07:10:31 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 172.18.0.11 (auth: True)
2018-12-19 07:10:32 INFO (MainThread) [homeassistant.components.http.view] Serving /api/states to 172.18.0.11 (auth: True)
2018-12-19 07:30:00 INFO (MainThread) [homeassistant.components.automation] Executing Car warmer off
2018-12-19 07:30:00 INFO (MainThread) [homeassistant.helpers.script] Script Car warmer off: Running script
2018-12-19 07:30:00 INFO (MainThread) [homeassistant.helpers.script] Script Car warmer off: Executing step call service
2018-12-19 07:46:34 INFO (MainThread) [homeassistant.components.http.view] Serving / to 172.18.0.11 (auth: False)
2018-12-19 09:17:00 INFO (MainThread) [homeassistant.components.automation] Executing Morning lights Off
2018-12-19 09:17:00 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights Off: Running script
2018-12-19 09:17:00 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights Off: Executing step call service
2018-12-19 09:17:10 INFO (MainThread) [homeassistant.helpers.script] Script Morning lights Off: Executing step call service
2018-12-19 09:43:46 INFO (MainThread) [homeassistant.components.http.view] Serving / to 172.18.0.11 (auth: False)
2018-12-19 09:43:47 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 172.18.0.11 (auth: False)
2018-12-19 09:43:47 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 172.18.0.11 (auth: False)
2018-12-19 09:43:51 INFO (MainThread) [homeassistant.components.http.view] Serving /manifest.json to 172.18.0.11 (auth: False)
2018-12-19 09:43:55 INFO (MainThread) [homeassistant.components.http.view] Serving /api/error/all to 172.18.0.11 (auth: True)
2018-12-19 09:43:59 INFO (MainThread) [homeassistant.components.http.view] Serving /api/error/all to 172.18.0.11 (auth: True)
2018-12-19 09:44:01 INFO (MainThread) [homeassistant.components.http.view] Serving /api/error_log to 172.18.0.11 (auth: True)

Use rfxcom with node-red and send all rf to mqtt. Is better and more responsive way to use rfxcom.

ok, I have installed node-red and played with it, seems nice.
If I mount the rfxcom transreceiver for node-red is it not possible to use with home-assistant at the same time?

Got this error:
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Hi @mapa0402

You don’t need to be connected to both.

Connect rfxcom only to node-red and then send mqtt commands to home assistant.

1 Like

thanks for your help, one more q:
what’s the easiest way to find the id to all my rfxtrx switches and sensors, use the program from rfxcom?

I am using debug node in node-red.

Ok I’ve set up node-red and mqtt but can’t for my life understand how to send mqtt msg to home-assistant that switch on/off a lamp?

in home-assistant I have:

switch:
- platform: rfxtrx
  automatic_add: False
  signal_repetitions: 2
  devices:
  0b110082038db74a10010f60:
    name: vrum_hollywood

and in node-red the id of the switch seems to be AC/0x01A08342/3.
I have tried to send that id as msg.topic and msg.payload to 1 or on.

What should I send to home-assistant, and what should HA be listening after?