Looking for advice on how to do a motion scensor

I am looking to use a RING camera Motion to trigger an ISTEON light

  1. Detection Motion
  2. Store current condition of light (on / off / level)
  3. Turn on
  4. wait (could be 3 minutes might be based on sensor still investigating)
  5. Return the light to the previous condition

I have the light coming on and off with motion now, it is the record current state, and return to it that I have a knowledge gap on.

Thank You in advance.

You can create input_text entities and set the value of the current condition of light in it and then restore it. It would require templating, thats all

1 Like

Take a look at creating scenes on the fly, does exactly this.

1 Like

Thank You - needed to do a bunch of learning and setups before I got to understand and use this advice.

this is now working (Thank You )

#  capturing state before trigger
- alias: "Main Hall motion on"
  trigger:
  # this sets the trigger for the automation
  - platform: state
    entity_id: binary_sensor.front_hall_motion
    from: "off"
    to: "on"
  # only do this at night
  condition:
  # one or the other.
    condition: or
    conditions:
      # 30 minutes after sunset
      - condition: sun
        after: sunset
        after_offset: "+00:30:00"
      # 30 min after sunrise
      - condition: sun
        before: sunrise
        before_offset: "+00:30:00"
  # what to do when the trigger occurs
  # first is to create a scene on the fly, to reserve the current conditions
  action:
  - service: scene.create
    data:
      scene_id: before
      snapshot_entities:
      - light.switchlinc_dimmer_3d_14_e0
  # Now that the contition of the light is reserved, execute the automation
  - service: light.turn_on
    data:
      entity_id: light.switchlinc_dimmer_3d_14_e0
  - delay: 60
  # now return the light to previous state
  - service: scene.turn_on
    data:
      entity_id: scene.before

Now I am needing to reuse this for difference motion sensor and different lights. I probably will wimp out and copy and paste, but think there is probably a way to create a variables in JSON and call the same automation…

for now, it works, I walk in front of the ring camera, and the light turns on, and then it returns to the state it was before! <edit: added the condition of dark>

1 Like