Ecolink motion detector question - automation

Just got the Z-Wave Ecolink motion detector and set it up as follows:

    automation 4:
      alias: Motion Detector Garage On
      trigger:
        - platform: state
          entity_id: binary_sensor.ecolink_motion_detector_sensor_7_0
          state: 'on'
      action:
        - service: light.turn_on
          data:
            entity_id: light.ge_unknown_type4c42_id3031_level_6_0
    automation 5:
      alias: Motion Detector Garage Off
      trigger:
        - platform: state
          entity_id: binary_sensor.ecolink_motion_detector_sensor_7_0
          state: 'off'
          for:
            minutes: 3
      action:
        - service: light.turn_off
          data:
            entity_id: light.ge_unknown_type4c42_id3031_level_6_0

I think I kinda have nailed it but I have a timing question. I originally set this up thinking it was an on off detection and I set a 3 minute delay. Seems the switch stays active for 4 minutes and then my delay kicks in keeping me alive 7 minutes. To get to 4 minutes which I think is as good as it gets would I just remove

   for:
      minutes: 3

Next question. If this were yours would you have done anything more elegantly?

You can simplify to a single automation for on/off – makes it a bit easier to manage when you have a lot of automations…

##########################################################
## Turn on/off family room when motion
##########################################################

- alias: Turn on/off family room lights when motion

  trigger:
    - platform: state
      entity_id: binary_sensor.family_room_sensor_65_0
      to: 'on'

    - platform: state
      entity_id: binary_sensor.family_room_sensor_65_0
      to: 'off'
      for:
        minutes: 10

  condition:
    - condition: sun
      after: sunset
      before: sunrise

  action:
    - service_template: >
       {% if trigger.to_state.state == "on" %}
       homeassistant.turn_on
       {% elif trigger.to_state.state == "off" %}
       homeassistant.turn_off
       {% endif %}
      entity_id: light.family_room_level_13_0
      data_template:
        brightness: 200
1 Like

Very nice. Exactly why I asked the question. Thanks.

automation 4:
  alias: Motion Detector Garage On/Off
  trigger:
    - platform: state
      entity_id: binary_sensor.ecolink_motion_detector_sensor_7_0
      state: 'on'

    - platform: state
      entity_id: binary_sensor.ecolink_motion_detector_sensor_7_0
      state: 'off'
      for:
        minutes: 1
  action:
    - service_template: >
       {% if trigger.to_state.state == "on" %}
       light.turn_on
       {% elif trigger.to_state.state == "off" %}
       light.turn_off
       {% endif %}
      entity_id: light.ge_unknown_type4c42_id3031_level_6_0

One more question. If it possible for me to always detect motion and turn on the light as noted above and then set a condition that I get a text (Pushbullet) between a block of time, say 7 to 5 when there should be no movement in the garage.

Actually I sat and thought about it and it seemed like another automation would handle it. Did this and it seems to work.

automation 5:
  alias: Motion Detector Garage Send Text
  trigger:
    - platform: state
      entity_id: binary_sensor.ecolink_motion_detector_sensor_7_0
      state: 'on'
  condition:
    condition: time
    after: '07:00:00'
    before: '16:30:00'
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  action:
    - service: notify.mypushbullet
      data_template:
        title: "Garage Motion"
        message: >-
          Send in the Hounds!

Nope. the one I just wrote works and sends the text when triggered but it broke the motion detection one for turning on the light.

I see 0.41 solves a issue with multiple automations off a wave trigger. That might be your cause. I have several automations off same triggers and no issues.

1 Like