Dumb motion sensor with hope for automation?

Home Assistant OS v.2020.12.2 on a Raspberry PI 3b.
I’m still in the process of getting to know Home Assistant and I have this motion sensor called Siemens Wirefree Indoor PIR For Wireless Doorbells & Chimes DCACC3 (https://www.ebay.co.uk/itm/Siemens-Wirefree-Indoor-PIR-For-Wireless-Doorbells-Chimes-DCACC3-/271724785330).
It’s recognized by HA as Byron SX 00:4f. It’s always in an Off state. From the log I can see this:

2021-01-10 17:41:13 DEBUG (MainThread) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 22, 'sub_type': 0, 'type_string': 'Byron SX', 'id_string': '00:4f', 'data': '0716005f004f0170', 'values': {'Command': 'Chime', 'Sound': 1, 'Rssi numeric': 7}}

2021-01-10 17:41:13 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: 00:4f Class: ChimeDevice Sub: 0)

2021-01-10 17:41:13 DEBUG (MainThread) [homeassistant.components.rfxtrx.sensor] Sensor update (Device ID: 00:4f Class: ChimeDevice Sub: 0)

2021-01-10 17:41:13 DEBUG (MainThread) [homeassistant.components.rfxtrx.sensor] Sensor update (Device ID: 00:4f Class: ChimeDevice Sub: 0)

As it’s not giving me any “Motion” or “No motion” or “On/Off” does anybody have an idea how I can use this in automation?

Please check if this particular sensor have any changes in the state attributes while there is motion? If there is any change we can use that to build a template or a template sensor in creating automation.

Or I think we can use the event Receive RFXCOM also in triggering automations.

Hi and thanks for answering! No, there is no change in state attributes. It’s only giving me the same lines every time it detects motion

Have a look at the RFXCOM integration:

There is a section there on configuring binary sensors.

Yes, I have read this page, but I think it doesn’t fit my sensor, or at least I don’t know what to do with it. My sensor doesn’t create any event code and has only one state attribute

Receive RFXCOM event is an event. May it might be triggered when there is motion.

Thanks again for your effort! This is strange. I can no longer see the loglines i posted above. Instead I have these lines and they have no data to listen to:

2021-01-11 20:48:29 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.byron_sx_00_4f_rssi_numeric, old_state=<state sensor.byron_sx_00_4f_rssi_numeric=-72; event=0720009c004f0200, unit_of_measurement=dBm, friendly_name=Byron SX 00:4f Rssi numeric, assumed_state=True, device_class=signal_strength @ 2021-01-11T20:13:29.574364+01:00>, new_state=<state sensor.byron_sx_00_4f_rssi_numeric=-72; event=072000ef004f0200, unit_of_measurement=dBm, friendly_name=Byron SX 00:4f Rssi numeric, assumed_state=True, device_class=signal_strength @ 2021-01-11T20:48:29.188776+01:00>>
2021-01-11 20:48:29 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.byron_sx_00_4f_sound, old_state=<state sensor.byron_sx_00_4f_sound=1; event=0720009c004f0200, friendly_name=Byron SX 00:4f Sound, assumed_state=True @ 2021-01-11T20:13:29.575710+01:00>, new_state=<state sensor.byron_sx_00_4f_sound=1; event=072000ef004f0200, friendly_name=Byron SX 00:4f Sound, assumed_state=True @ 2021-01-11T20:48:29.190113+01:00>>
2021-01-11 20:48:29 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.byron_sx_00_4f, old_state=<state binary_sensor.byron_sx_00_4f=off; event=0720009c004f0200, friendly_name=Byron SX 00:4f, assumed_state=True @ 2021-01-11T20:13:29.577064+01:00>, new_state=<state binary_sensor.byron_sx_00_4f=off; event=072000ef004f0200, friendly_name=Byron SX 00:4f, assumed_state=True @ 2021-01-11T20:48:29.192064+01:00>>

Any thoughts on this @sheminasalam ? I really feel that your way of listen to rfxtrx events is the way to go, but now with the new loglines there is no data to listen to.

Is this the log after you triggered motion? Did you change anything in the configuration regarding logging of this component?
To get debug info you should add the following in configuration.yaml

logger:
  logs:
    RFXtrx: debug

Yes, you know, when you really don’t know much you try everything, so I probably changed the logging settings several times, but I have the lines that you are mentioning and some more:

logger:
  default: error
  logs:
    homeassistant.core: debug
    homeassistant.components.automation: debug
    RFXtrx: debug

I tried deleting the integration and adding it again and now I can find:

Line 282153: 2021-01-12 15:26:37 DEBUG (MainThread) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 22, 'sub_type': 0, 'type_string': 'Byron SX', 'id_string': '00:4f', 'data': '071600aa004f0170', 'values': {'Command': 'Chime', 'Sound': 1, 'Rssi numeric': 7}}

So I set up this automation:

alias: Siemens motion
description: ''
trigger:
  - platform: event
    event_type: rfxtrx_event
    event_data:
      packet_type: 22
      sub_type: 0
      type_string: Byron SX
      id_string: '00:4f'
      values:
        Command: Chime
        Sound: 1
        Rssi_numeric: 7
condition: []
action:
  - service: notify.notifier_name
    data:
      message: Nå fungerer den dumme sensoren
mode: single

But it doesn’t seem to work…

Please you go to events tab in developer console and look for what exactly is the event name for RFXCOM integration and then listen to it.

Not sure if I understand how to listen to events. Here is what I have:



But when I force motion on sensor no events are recorded, so obviously I’m doing it wrong

Finally I got something to happen. Obviously not sure what I’m doing, but listening to state_changed and then triggering this motion sensor at least got some data:

Event 79 fired 10:10 PM:
{
    "event_type": "state_changed",
    "data": {
        "entity_id": "binary_sensor.byron_sx_00_4f",
        "old_state": {
            "entity_id": "binary_sensor.byron_sx_00_4f",
            "state": "off",
            "attributes": {
                "event": "07160096004f0180",
                "friendly_name": "Byron SX 00:4f",
                "assumed_state": true
            },
            "last_changed": "2021-01-12T21:07:46.415299+00:00",
            "last_updated": "2021-01-12T21:07:46.415299+00:00",
            "context": {
                "id": "1f4b156e1b8b1e07b2a7343317fe9a0a",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "binary_sensor.byron_sx_00_4f",
            "state": "off",
            "attributes": {
                "event": "071600ad004f0170",
                "friendly_name": "Byron SX 00:4f",
                "assumed_state": true
            },
            "last_changed": "2021-01-12T21:10:12.365538+00:00",
            "last_updated": "2021-01-12T21:10:12.365538+00:00",
            "context": {
                "id": "4d8e536949debae208126062575e7f85",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2021-01-12T21:10:12.365538+00:00",
    "context": {
        "id": "4d8e536949debae208126062575e7f85",
        "parent_id": null,
        "user_id": null
    }
}

Is it possible to use this in an automation? (as you can see the state is always OFF)

Finally I got something automated. Listening to state_changed did help:

alias: Siemens stupid motion sensor
trigger:
  - platform: state
    entity_id: binary_sensor.byron_sx_00_4f
action:
  - type: turn_on
    device_id: 186080b8fba2066e8df0aa7f987c3a6c
    entity_id: switch.tak_stue_sor_switch
    domain: switch

Thanks for guiding me in the right direction!