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:
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?
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 (?).
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:
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.