05-08-2024 07:42 AM - edited 05-08-2024 07:43 AM
Hello everyone.
I am searching for more concepts, ideas, or even scenarios where my current automation could cause some issues in order to enhance my bathroom light automation.
This will be fantastic if I can get some helpful criticism and suggestions.
Smart Devices
Kasa Lights
AQARA FP2 Sensor
Here is my bathroom automation:
metadata:
name: Bathroom Light test
description: As soon as you enter the restroom, the light will go on and stay on till you leave.
automations:
#
- starters:
- type: device.state.MotionDetection # For devices that can detect motion.
state: motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: true
device: Bathroom - Sensor - Bathroom
- type: device.state.OccupancySensing # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing. # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing.
state: occupancy
# Whether the device senses occupancy. [available operators: is, isNot]
isNot: OCCUPIED
device: Bathroom Door - Bathroom
actions:
- type: device.command.OnOff # Turn the device on or off.
# Whether to turn the device on or off.
on: true
devices: Bathroom Light - Bathroom
- starters:
- type: device.state.MotionDetection # For devices that can detect motion.
state: motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: false
device: Bathroom - Sensor - Bathroom
for: 10min
condition:
type: and
# "OR" together two or more conditionals
conditions:
- type: device.state.MotionDetection # For devices that can detect motion.
state:
motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: false
device: Bathroom - Sensor - Bathroom
- type: device.state.OccupancySensing # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing.
state: occupancy
# Whether the device senses occupancy. [available operators: is, isNot]
isNot: UNOCCUPIED
device: Bathroom Door - Bathroom
actions:
- type: device.command.OnOff # Turn the device on or off.
# Whether to turn the device on or off.
on: false
devices: Bathroom Light - Bathroom
05-10-2024 05:39 AM
I am not getting any results with my "and" condition. Any ideas?
@Drjay18 wrote:Hello everyone.
I am searching for more concepts, ideas, or even scenarios where my current automation could cause some issues in order to enhance my bathroom light automation.
This will be fantastic if I can get some helpful criticism and suggestions.
Smart Devices
Kasa Lights
AQARA FP2 Sensor
Here is my bathroom automation:
metadata:
name: Bathroom Light test
description: As soon as you enter the restroom, the light will go on and stay on till you leave.
automations:
#
- starters:
- type: device.state.MotionDetection # For devices that can detect motion.
state: motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: true
device: Bathroom - Sensor - Bathroom
- type: device.state.OccupancySensing # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing. # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing.
state: occupancy
# Whether the device senses occupancy. [available operators: is, isNot]
isNot: OCCUPIED
device: Bathroom Door - Bathroom
actions:
- type: device.command.OnOff # Turn the device on or off.
# Whether to turn the device on or off.
on: true
devices: Bathroom Light - Bathroom
- starters:
- type: device.state.MotionDetection # For devices that can detect motion.
state: motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: false
device: Bathroom - Sensor - Bathroom
for: 10min
condition:
type: and
# "OR" together two or more conditionals
conditions:
- type: device.state.MotionDetection # For devices that can detect motion.
state:
motionDetectionEventInProgress
# <code>true</code> if a motion detection event is occurring. [available operators: is, isNot]
is: false
device: Bathroom - Sensor - Bathroom
- type: device.state.OccupancySensing # For devices that can detect occupancy, whether through PIR, ultrasonic, or physical contact sensing.
state: occupancy
# Whether the device senses occupancy. [available operators: is, isNot]
isNot: UNOCCUPIED
device: Bathroom Door - Bathroom
actions:
- type: device.command.OnOff # Turn the device on or off.
# Whether to turn the device on or off.
on: false
devices: Bathroom Light - Bathroom