Help with set up RFXTRX + EtekCity Sockets

I’m trying to set up an RFXTRX with EtekCity ZAP outlets but having some problems (all on Hassbian, homeassistant 0.65.6).

My setup is this:

rfxtrx:
  device: '/dev/ttyUSB0'
  debug: true
  dummy: false
light:
  - platform: rfxtrx
    automatic_add: True
switch:
  - platform: rfxtrx
    automatic_add: True

/dev/ttyUSB0 is correct and writable by the homeassistant user. According to the documentation, this should automatically add my devices as soon as I push the button on the remote control. But there’s absolutely nothing.

This is all I see in the logs:

2018-03-25 19:40:40 INFO (MainThread) [homeassistant.loader] Loaded rfxtrx from homeassistant.components.rfxtrx
2018-03-25 19:40:40 INFO (MainThread) [homeassistant.loader] Loaded switch.rfxtrx from homeassistant.components.switch.rfxtrx
2018-03-25 19:40:40 INFO (MainThread) [homeassistant.loader] Loaded light.rfxtrx from homeassistant.components.light.rfxtrx
2018-03-25 19:40:42 INFO (MainThread) [homeassistant.setup] Setting up rfxtrx
2018-03-25 19:40:42 INFO (MainThread) [homeassistant.setup] Setup of domain rfxtrx took 0.1 seconds.
2018-03-25 19:40:42 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=rfxtrx>
2018-03-25 19:40:42 INFO (MainThread) [homeassistant.components.switch] Setting up switch.rfxtrx
2018-03-25 19:40:42 INFO (MainThread) [homeassistant.components.light] Setting up light.rfxtrx
2018-03-25 19:40:42 DEBUG (Thread-10) [homeassistant.components.rfxtrx] Add blanket rfxtrx
2018-03-25 19:40:48 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1757505424: Sending {'result': {'longitude': 13.465133, 'config_dir': '/home/homeassistant/.homeassistant', 'whitelist_external_dirs': {'/home/homeassistant/.homeassistant/www'}, 'elevation': 35, 'version': '0.65.6', 'components': {'sensor.steam_online', 'sensor', 'binary_sensor', 'media_player', 'device_tracker', 'group', 'config.entity_registry', 'light.rfxtrx', 'logbook', 'tts', 'recorder', 'switch.rfxtrx', 'notify', 'http', 'climate', 'zone', 'automation', 'mqtt', 'api', 'frontend', 'updater', 'media_player.samsungtv', 'binary_sensor.maxcube', 'config.customize', 'system_log', 'hue', 'google_assistant', 'maxcube', 'influxdb', 'sensor.yweather', 'script', 'sun', 'logger', 'config', 'rfxtrx', 'switch.mqtt', 'binary_sensor.mqtt', 'switch', 'light.hue', 'light', 'config.core', 'conversation', 'history', 'media_player.cast', 'climate.maxcube', 'config.script', 'websocket_api', 'config.automation', 'duckdns', 'config.group'}, 'time_zone': 'Europe/Berlin', 'latitude': 52.506191, 'location_name': 'Home', 'unit_system': {'mass': 'g', 'volume': 'L', 'length': 'km', 'temperature': '°C'}}, 'id': 8, 'success': True, 'type': 'result'}
2018-03-25 19:40:48 DEBUG (Thread-13) [homeassistant.util.json] JSON file not found: /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/.translations/rfxtrx.en.json
2018-03-25 19:40:48 DEBUG (Thread-13) [homeassistant.util.json] JSON file not found: /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/.translations/rfxtrx.en.json
2018-03-25 19:40:48 DEBUG (Thread-13) [homeassistant.util.json] JSON file not found: /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/.translations/rfxtrx.en.json

I then tried to follow the doc of “training” one of the sockets. I generated a new ID using the template and added it to my config:

switch:
  - platform: rfxtrx
    automatic_add: True
    devices:
      0b11000197bc0cfe00010f70:
        name: blanket

I then pushed the programming button on the socket, and turned on the switch in HA. But again nothing happend, the remote was still paired and my HA switch does nothing. There wasn’t even some debug info related to me triggering the switch in HA. It seems to me like I’m missing some important part, but I can not figure it out.

Interesting enough, when I also configured sensors like this:

sensor:
  - platform: rfxtrx
    automatic_add: True

After while time three Temperature sensors were detected with varying values (one was 191°C :crazy_face:) - I have no idea what those sensors are, maybe my neighbours have some weird tech. But is seems to suggest that my RFXTRX at least somehow works.

Any hints on how to get this working (and how to get more debug data) would be much appreciated.

try and set your logs to debug for the rfx then you should be able to see the id of your devices to allow you to add them manually:

# Logging level
logger:
  default: error
  logs:
    homeassistant.components.rfxtrx: debug

I did that. Above logs are with logger: debug. Except for the weird temperature sensors I’m not seeing any rfxtrx logging.

Are you sure the correct protocol (Lighting 1 / Energenie5) is enabled for your sensors? (it’s not enabled by default)
See the manual for more info

Thanks for the reply. I finally came around to connect the rfxtrx to a windows machine and check the protocols in RFXmngr. This is what I have enabled:

I had another look at the manual you linked. I noticed that is says “no” in the “rec” column, but “yes” in the “xmit” column!? This would indicate to me that I can only send to the power sockets but not record what the remote control is sending?

However I have no idea how to figure out what and how to send!?

After reading this german article I managed to control the socket from RFXManager by

  1. go to “Lightning 1” tab
  2. select Energenie5,Etekcity as type
  3. select an arbitrary house code
  4. select an arbitrary unit code (you probably should use the socket’s number from the label)
  5. set command to “On”
  6. press the learn button on the side of the socket for ten seconds (starts to blink)
  7. click “Transmit”

Interestingly enough, the remote control still works, so it seems it’s possible to connect multiple controllers with one socket.

So now I can control the socket via the RFXmngr windows tool, but still am not sure how to do that from HomeAssistant.

And I finally got it working!

There is a tool called RFXcomIdGenerator that will create the correct device ID for you. However it was missing support for the Etekcity protocol which I added in a PullRequest. Simply call it like this:

python2 generateId.py -t Lighting1 -s Energenie5 -p A,1

Where the last two values are the Housecode (A) and the UnitID (1).

Then add the generated ID in your configuration:

switch:
  - platform: rfxtrx
    automatic_add: false
    devices:
      0710090041010000:
        name: Socket1

After realoading your configuration, follow the steps in the post above. Switch the socket to learning mode and trigger the switch in HomeAssistant.

This blog post on similar Maplin sockets was very helpful in the end.

1 Like