[HOW-TO] Integrating a 433 RF Motion Sensor using a Pilight Switch (and extending range of a Z-Wave motion sensor)

I’m using a Z-Wave Fibaro 4-in-1 Sensor (http://amzn.to/2iabgdA) to detect presence in my corridor. But since my corridor is L shaped and with all that furniture, I was not able to cover every corner of the room. So I was searching for an easy and cheap solution to extend the range. First I was thinking about a second Fibaro Sensor but they are very expensive and I would not need a second sensor also reporting lux and temperature for one room.

In a hardware store I stumbled over an 433 RF motion sensor from Intertechno (similar to this one http://amzn.to/2iUBPSI) and since I already have a working pilight send and receive infrastructure running, I gave it a try.

FYI: This only works if the RF motion sensors also sends an “off” signal after a period of time without any motion. In my case with the Intertechno PIR-1000 there is even a switch on the back of the sensor to define after what period the off signal should be sent (5s/5m/10m).

A motion sensor is nothing more than a switch, sending on signals on movement and off signals after a period of time without any movement. So this is what I got with pililight-receive:

        "message": {
                "id": 22498586,
                "unit": 9,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "arctech_switch",
        "uuid": "0000-b4-27-eb-0486ee",
        "repeats": 7

Using this, I just created a new switch, just like I do for the remote controlled power plugs aka RF switches:

  - platform: pilight
    switches:
      22498586U9:
        on_code:
          protocol: arctech_switch
          id: 22498586
          unit: 9
          'on': 1
        off_code:
          protocol: arctech_switch
          id: 22498586
          unit: 9
          'off': 0
        on_code_receive:
          protocol: arctech_switch
          id: 22498586
          unit: 9
          state: 'on'
        off_code_receive:
          protocol: arctech_switch
          id: 22498586
          unit: 9
          state: 'off'

Since its not a switch and does not receive on/offs, only sends them, we only need the on_code_receive and off_code_receive definition. But on_code and off_code code are mandatory for the switch component so you have to add them, even if they are useless in this case.

Now, having a working switch I transformed it into a motion sensor using a binary template sensor to work with in automations and so on:

binary_sensor:
  - platform: template
    sensors:
      corridor_movement_rf:
        friendly_name: 'Flur: Bewegung RF'
        value_template: "{{ is_state('switch.22498586U9', 'on') }}"
        sensor_class: motion

Done! That’s an easy and working way to integrate 433 motion sensors, even if they are nor supported by pilight as a sensor and therefore can’t be integrated as a pilight sensor directly.

Regarding my issue about extending the range of one Fibaro Sensor I combined the sensor above with the Fibaro sensor into one motion sensor, again using a template binary sensor combining both with an OR-statement. That way I can just use the corridor_movement in all my motion depending corridor automations:

corridor_movement:
  friendly_name: 'Flur: Bewegung'
  value_template: "{{ is_state('binary_sensor.corridor_movement_zw', 'on') or is_state('binary_sensor.corridor_movement_rf', 'on') }}"
  sensor_class: motion

corridor_movement_zw:
  friendly_name: 'Flur: Bewegung ZW'
  value_template: "{{ states.sensor.fibaro_system_fgms001_motion_sensor_burglar_2_10.state == '8' }}"
  sensor_class: motion

I don’t know if this method (using switches for motion sensors) is known or not, but since I didn’t see it anywhere I just wanted to share it. :slight_smile:

3 Likes

Nice one!

How much time does it take for the light to come on?
I did a similar thing here, and it takes almost 2 seconds.

Cheers!

@Fonta the delay is less than a second I guess, it feels fast enough. I’m turning on Hue lights using scenes.