Hi!
Can some one please help me.
Im stuck on a simple thing.
I have a motin sensor wich i recive ”motion detected date/time” how do i turn this to sensor a with on/off instead? So i can trigger an automation.
Hi!
Can some one please help me.
Im stuck on a simple thing.
I have a motin sensor wich i recive ”motion detected date/time” how do i turn this to sensor a with on/off instead? So i can trigger an automation.
Motion sensors should work ‘on’ or ‘off’… that’s what you use to create your automation something like this:
- alias: 14 - Motion Sensor Hallway Lights On
id: Motion Sensor Hallway Lights
trigger:
platform: state
entity_id: binary_sensor.hallway_motion_sensor_motion
from: 'off'
to: 'on'
condition:
- condition: time
after: '07:30:00'
before: '23:00:00'
action:
service: switch.turn_on
entity_id: switch.hallway_light
- alias: Motion Sensor Hallway Lights Off
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion_sensor_motion
from: 'on'
to: 'off'
action:
- service: switch.turn_off
entity_id: switch.hallway_light
That’s the one I use to turn hallway light on with motion. Still have to tweak to only work at certain times but hopefully you get the jist of the motion sensor. So in my automation when it’s ‘tripped’ it’s ‘state’ shows ‘on’. When it resets the ‘state’ shows ‘off’. I didn’t have to do anything it’s just how it already works.
You can use this as a template and put in what you want it to do
Thank you!