cancel
Showing results for 
Search instead for 
Did you mean: 

Bathroom - Automation

Drjay18
Community Member

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

 

 

1 REPLY 1

Drjay18
Community Member

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