Problems adding RFXtrx switches

My goal is to use a RFXtrx remote to turn on/off my lights, to do that I want to use automations, but first, I have to add the switches.

I tried this:

switch:
  - platform: rfxtrx
    automatic_add: true

and flipped the switches and they are added automatically, but I can’t seem to use them for automations?

Also, some of the switches should do one action (ex. toggle light 1) if pressed “on” and if pressed “off” it should toggle another light or do some other unrelated action, so i assume i need to add fire_event: true to the switches.

So, i got the id of the first switch and added it to the config and restarted homeassistant:

switch:
  - platform: rfxtrx
    automatic_add: true
    devices:
      0710011442010170:
        name: Remote_B1
        fire_event: true

and I got this error in the log:
2017-11-10 21:52:08 ERROR (Thread-15) [homeassistant.components.rfxtrx] Invalid device: 31337365377144

After this, none of the autodetected switches respond to input (they actually disappear) and no new rfxtrx switches will be autodetected.
The only way I get any response out of these switches is if I only use autodetection.

Why does the log show a completely unrelated device number, and why can’t I add the devices in the configuration?

Edit: These are ARC switches.

Did you solve this issue? I have the same problem with a cheap window sensor / power switch.

Auto-add produces a working switch - but adding this switch into the configuration reports an invalid device (with a completely different number).

The switch was working before on an FHEM installation and I noticed that the ID reported by auto-add differs from it. So I copied the ID from FHEM and added it to HAs configuration: et voila, it works. Looks as if auto-add uses internally a different ID than reported within the GUI (?).

2018-06-24 13:03:53 DEBUG (Thread-14) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: d3 Class: LightingDevice Sub: 1, Pkt_id: 0710010044030050) 
2018-06-24 13:03:53 DEBUG (Thread-14) [homeassistant.components.rfxtrx] Automatic add d3 rfxtrx device (Class: LightingDevice Sub: 1 Packet_id: 0710010044030050) 
2018-06-24 13:03:53 DEBUG (Thread-14) [homeassistant.components.rfxtrx] Device_id: d3 device_update. Command: Off 
2018-06-24 13:05:14 DEBUG (Thread-14) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: d3 Class: LightingDevice Sub: 1, Pkt_id: 0710010144030150) 
2018-06-24 13:05:14 DEBUG (Thread-14) [homeassistant.components.rfxtrx] Device_id: d3 device_update. Command: On

This is an example debug log of the switch auto-added by HA. As you can see the switch has been detected with packet ID 0710010044030050. This switch is also visible in the web UI and can be used to toggle the attached power plug.

As soon as I add this ID manually to configuration.yaml like so:

 switch:
   - platform: rfxtrx
     automatic_add: True
     signal_repetitions: 2
     devices:
       0710010044030050:
         name: Dunstabzug

The switch is gone from web UI and log shows:

2018-06-24 13:11:12 ERROR (Thread-6) [homeassistant.components.rfxtrx] Invalid device: 31337164582952

(btw: this is no different ID but the decimal version of the hexadecimal ID provided within the configuration file)

The packet ID in my previous FHEM installation for this switch was a bit different: 0710013c44030040

When I change the yaml file to this ID, the switch becomes functional in the web UI again!

For me this looks like a bug in the RFXTRX component … ?

Hi,

Sorry for the long delay, I did actually solve this.

It’s actually a “bug” in yaml.
It happens because your ID, 0710010044030050 is all digits, so instead of interpreting it as a string, it is interpreted as a number.

Long story short, enclose your ID in quotes like “0710010044030050”: and it should work.

Took me days to figure it out, sorry for taking so long to reply.

Thanks for your reply - that YAML “issue” is something I would not have thought about ever :wink:

Will try it out!