Sonoff RF Bridge (ESPurna FW) how to activate /Auto OFF PIR Motion Sensor

I have a Sonoff RF Bridge running on ESPurna firmware.
I’m able to see the RF signal from sonoff PIR .
The Bridge has been setup (via code learning) to detect motion for switch #0 ON & motion for switch #0 OFF (Basically Both are the same code as the PIR don’t send any ON or OFF code).

I want to set up an automation when Motion is detected thru PIR Turn ON the Light.

The Problem is First-time Motion is detected the light goes to ON

After that, the PIR status in Sonoff RF Bridge running on ESPurna is always ON
How do I set it OFF automatically?

I am thinking something like below but not sure how to implement.

Automation 1: when Motion is detected thru PIR Turn ON the Light. (THis is possible & I have the code working)

Automation 2: Turn OFF the PIR Motion sensor to OFF automatically after few seconds (Say 3 Seconds)

I don’t see any code that will automatically OFF my sensor after few seconds. (Only Minutes or Hours delay available in automation Conditions)

Please help

Thanks in advance.

My Motion Sensor Configuration.yamal as below
yamal

My Sonoff Bridge ESPurana RF Learn Mode or LInk Page is as follows:

I have Tasmota on my Sonoff Bridge but it should work in a similar fashion. Here’s my anim:

  • alias: Reset RF Motion State
    hide_entity: true
    initial_state: ‘on’
    trigger:
    • platform: state
      entity_id: binary_sensor.hall_motion
      to: ‘on’
      for:
      seconds: 5
      action:
    • service: mqtt.publish
      data:
      topic: home/OpenMQTTGateway/SRFBtoMQTT
      payload: 13853614off

This resets the PIR status to off after 5secs.

Failing that, have you tried using fractional numbers? For example 3 Seconds = 0.05 Minutes.

1 Like

Thanks
The below code worked for Espurna

alias: Reset PIR Motion State
trigger:

  • entity_id: binary_sensor.movement
    for:
    hours: 0
    minutes: 0.083
    platform: state
    to: ‘on’
    condition: []
    action:
  • data:
    payload: 30A2019A04CED2908E
    topic: /SBRIDGE01/rfout/set
    service: mqtt.publish

I know this is an old thread but I was having the same problem and this is what my binary sensors look. You don’t need any automation for resetting the sensor, instead just add the off_delay flag. Mine resets in 5 seconds

- platform: mqtt
    state_topic: "tele/RF_Bridge/RESULT"
    name: 'Master Bedroom Motion'
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: 'E8282E'
    off_delay: 5
    device_class: motion
    optimistic: false
    qos: 1
    retain: false
1 Like