Using a virtual motion sensor to trigger blueprint

Hey there,

i am using a blueprint to send me a picture of my entry if movement was detectet. The blueprint only accepts a motion sensor as trigger.

So, now i want to use a automation in front of the blueprint, wich indicates if f.e. the front door is open or closed. The notifiy should only be send if the front door is closed.

For that i want to create a virtual motion sensor. I want to use this sensor in a automation wich checks the status of the front door. If the door is closed, and the real motion sensor detects motion, the automation should set the state of the virtual motion sensor to “movement detectet”.

I already created the virtual motion sensor:

    - platform: template
      sensors:
        helper_notify_eingang:
          value_template: "on"
          friendly_name: 'Helper Notify Eingang'
          device_class: motion

But i am not sure if this is correct for what i want to do.
I can manipulate the state of the virtual sensor manually. But i cant manipulate the state out of a automation.
How can i do that?
Regards
Sebastian

your code didn’t include any of your entities so i’m going to make them up… please replace them as appriopriate.

if i were you i’d do this as a simple helper… settings->helper->create helper->template->binary sensor:

choose motion class

then in the template field, put this:

{{ states('binary_sensor.real_motion_sensor') == 'on' or 
  states('binary_sensor.door_open_sensor') == 'on'}}

no automation needed. that helper is a mention sensor you can use directly in your blueprint…

if you want to use your yaml, you could put that in your value_template:

- platform: template
      sensors:
        helper_notify_eingang:
          value_template: "{{ states('binary_sensor.real_motion_sensor') == 'on' or states('binary_sensor.door_open_sensor') == 'on'}}"
          friendly_name: 'Helper Notify Eingang'
          device_class: motion

(i think i got that right… i’m freehanding it)