RFXTRX adding switch: no success

I’m trying to add a switch to control the x-mas-light. The remote signal is pickedup by rfxtrx in HA. The switch is identified as: light.tristate_85568a_1

I added to the config:

light 2:
platform: rfxtrx
devices:
tristate_85568a_1:
name: Kerstboom

Logging:

16-12-11 19:38:24 homeassistant.bootstrap: Invalid config for [light.rfxtrx]: Rfxtrx device 85568a_1 is invalid: Invalid device id for OrderedDict([(‘tristate_85568a_1’, OrderedDict([(‘name’, ‘Kerstboom’)]))]) for dictionary value @ data[‘devices’]. Got OrderedDict([(‘85568a_1’, OrderedDict([(‘name’, ‘Kerstboom’)]))]). (See ?:?). Please check the docs at https://home-assistant.io/components/light.rfxtrx/

What am I doing wrong ?

Hmm, I have never seen a device id like that.
Have you follow the steps described here https://home-assistant.io/components/light.rfxtrx/ ?

Try to only add:

switch:
  - platform: rfxtrx
    automatic_add: True

Start HA and press the light button

Go to your_ip:8123/dev-state and look for your new light.
Under entity, you will your device id.

Followed those steps. Press the button on the remote. Then this switch appears in /dev-state: light.tristate_85568a_1

Adding this to configuration.yaml gives an error in the logging (see above). Used these switches before in Domoticz.

Hmm, there is something strange with the device id you are getting.

Could you try to add it as a switch a not a light?
Replace light with switch:

switch:
  - platform: rfxtrx
    automatic_add: True

And could you check the log when you add the device?
You should see something lik “Automatic add %s rfxtrx device …”

I only see light.tristate_85568a_1 appear in /dev-state, there is no logging when I press the button on the remote.

There is a log output the first time you add the device. But it might be a bit a hard to find it with all the other log outputs.
Try to remove the device from your config, make sure you do not filter any log entries and try again.

tail -f /home/hass/.homeassistant/home-assistant.log|grep device

Should catch it, right ?

I think home-assistant.log is deleted when you restart HASS.

The remote has buttons A through E each with an On and Off function. The device is only added as a light.

Off buttons pressed for A,B, D and E. On button pressed for C.

light.tristate_8554aa_1 off supported_features: 0
light.tristate_85562a_1 off supported_features: 0
light.tristate_85568a_1 on supported_features: 0
light.tristate_8556a2_1 off supported_features: 0
light.tristate_8556a8_1 off supported_features: 0

These switches are Impuls switchtes. Supported by RFXcom and sold bij Action, a retailer in the Netherlands, Belgium and France.

I can not help you, if you not do what I ask for. I need to see that log entry when you first add the light.
I also want you to try adding it as a switch

Sorry, that is was I did. I commented out the light section :

#rfxcom
rfxtrx:
  device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_08WDX7NV-if00-port0

#light:
#   platform: rfxtrx
  
sensor 2:
  platform: rfxtrx
  automatic_add: True
  devices:
    0a5207012d0e007e480359:
      name: Kelder
      data_type:
        - Humidity
        - Temperature
    0a520700690e00383d0159:
      name: Veranda
      data_type:
        - Humidity
        - Temperature   
 
switch:
  platform: rfxtrx
  automatic_add: True

I tail -f the log as I push the button on the remote. There is no logging.

We are talking about the same log file ?

tail -f /home/hass/.homeassistant/home-assistant.log

Have you disabled any logging?

You should have something like this in your config:

logger:
  default: info

Oke, the logger element was missing in my config. Added. This is the related logging;

16-12-12 20:14:19 homeassistant.components.rfxtrx: Receive RFXCOM event from (Device_id: 690e Class: RFXtrxDevice Sub: 7)

That is from your sensor.
It should be something like “Automatic add %s rfxtrx device”
Try to add it as a light again. Maybe you will get the log output now

This is all the logging I get, no “Automatic add…” or something like that. When I push the button:

16-12-13 07:04:03 homeassistant.core: Bus:Handling <Event rflink_switch_packet_received[L]: packet=node=gateway, switch=1, command=off, protocol=tristate, id=85568a>
16-12-13 07:04:03 homeassistant.core: Bus:Handling <Event state_changed[L]: entity_id=light.tristate_85568a_1, new_state=<state light.tristate_85568a_1=on; friendly_name=tristate_85568a_1, supported_features=0, assumed_state=True @ 2016-12-13T08:04:03.193772+01:00>, old_state=None>

And that is from the first time you press the button? The device should not have been added before.
If so, what version of HA are you using? If you use an old version you should upgrade.

Yes, that is on the first button press. I’m using 0.35 dev version. Installed with: pip3 install --upgrade --user https://github.com/aequitas/home-assistant/archive/rflink.zip

That is because I also use the RFLINK hardware.

Hmm, then I do not understand why this line is not executed: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/rfxtrx.py#L226

Just to be sure. Did a grep on Automatic. No results. Maybe I should revert back to the stable version (without RFlink) and try again.