Automation to turn off rflink switch

I have rflink switch. I want to turn it off after xx seconds. It is motion sensor which send only ON signal. I created automation but it doesn´t run. Could anybody help?

Using automation editor inside HA this automation.yaml was created:
- action:
- delay: 0:10
- alias: ‘’
data:
entity_id: switch.senzor_pohybu_1
service: switch.turn_off
alias: off cidla
condition:
- condition: state
entity_id: switch.senzor_pohybu_1
state: ‘on’
id: ‘1510082561392’
trigger:
- entity_id: switch.senzor_pohybu_1
from: ‘on’
platform: state
to: ‘off’

This is what I do…

###############################################################################################
#                                                                                             #
# Turn off the PIR's once they have triggered                                                 #
#                                                                                             #
###############################################################################################
       
 - alias: 'Turn off PIRs'
   initial_state: 'on'
   trigger:
     - platform: state
       entity_id: switch.senzor_pohybu_1
       to: 'on'
   action:
     - delay: '00:00:10'
     - service: switch.turn_off
       entity_id: switch.senzor_pohybu_1

It works - @keithh666 YOU ARE A GENIUS! :smiley:

@keithh666 If I want to trigger sirene or send push message to phone could I do it using your automatization - only add another “action:” ? I want to do it with the same trigger.

Just add as many service calls as you like after the initial action: e.g.

   action:
     - service: switch.turn_off
       entity_id: switch.rfl_freezer_open
     - service: switch.turn_on
       entity_id: switch.rfl_freezer_closed
     - service: notify.mypushbullet
       data:
         message: 'Freezer Door Closed'     
     - service: light.turn_on
       data_template:
           entity_id: light.zw_uplight_dimmer_level
           #'{{ states.input_number.darkness.state | int * 35 }}'
           brightness_pct: '{{states.input_number.lruplighterbrightness_slider | float}}'