RFX with cheap motion detetor

Hi,

Since the first release i have some chineses ‘cheap’ motion detector.
It works fine until the 0.42 release.

Since the 0.42, my motion detector stops to work.

So with the release i decided to use binary_sensor but with the docs i can’t handle to success pairing it with HA.

in my configuration file i declared :
binary_sensor: - platform: rfxtrx automatic_add: True

I found my binary_sensor on the sensor panel :
Jul 3 17:20:13 gano-vm hass[19018]: INFO:homeassistant.components.binary_sensor.rfxtrx:Binary sensor update (Device_id: ecad69 Class: LightingDevice Sub: 0)

But if i add this binary_sensor

i have this message :
Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/homeassistant/setup.py", line 156, in _async_setup_component Jul 3 17:14:41 gano-vm hass[18809]: conf_util.async_process_component_config(hass, config, domain) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/homeassistant/config.py", line 598, in async_process_component_config Jul 3 17:14:41 gano-vm hass[18809]: p_validated = platform.PLATFORM_SCHEMA(p_validated) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 221, in __call__ Jul 3 17:14:41 gano-vm hass[18809]: return self._compiled([], data) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 538, in validate_dict Jul 3 17:14:41 gano-vm hass[18809]: return base_validate(path, iteritems(data), out) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 315, in validate_mapping Jul 3 17:14:41 gano-vm hass[18809]: cval = cvalue(key_path, value) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 716, in validate_callable Jul 3 17:14:41 gano-vm hass[18809]: return schema(data) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/validators.py", line 262, in __call__ Jul 3 17:14:41 gano-vm hass[18809]: v = schema(v) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 221, in __call__ Jul 3 17:14:41 gano-vm hass[18809]: return self._compiled([], data) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/voluptuous/schema_builder.py", line 716, in validate_callable Jul 3 17:14:41 gano-vm hass[18809]: return schema(data) Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/rfxtrx.py", line 105, in valid_binary_sensor Jul 3 17:14:41 gano-vm hass[18809]: return _valid_device(value, "binary_sensor") Jul 3 17:14:41 gano-vm hass[18809]: File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/rfxtrx.py", line 66, in _valid_device Jul 3 17:14:41 gano-vm hass[18809]: if 'packetid' in device.keys(): Jul 3 17:14:41 gano-vm hass[18809]: AttributeError: 'NoneType' object has no attribute 'keys'

my motion detector are lightning 4.

If somebody has a great solution for that i take it :wink:

Problem solved.

For those who have the same problem :slight_smile:

declaration of 2 binary_sensor
`binary_sensor:

  • platform: rfxtrx
    automatic_add: False
    devices:
    091300479308f9019a70:

    09130010ecad69019f70:

      name: mvtsdb
      data_bits: 4
      command_on: 0x9
      command_off: 0x0
      device_class: motion
      fire_event: True
      off_delay:
        seconds: 5
    09130025ecad69019f80:
      name: mvtwc
      data_bits: 4
      command_on: 0x9
      command_off: 0x0           
      device_class: motion
      fire_event: True
      off_delay:
        seconds: 5
     `
    

If i set automatic_add to True, the neighbour’s motion sensor send me a command which HA don’t understand (because not declared), and kill my module rfx. With a HA restart or reload Core option, the module reloads fine.

With automatic_add to False, everything works fine.