So I think there may be two solutions to this issue. I first have an automation that will turn on a lightstrip to 40% brightness & colour temperature of ~2500K when motion is detected as long as the lightstrip was already off to begin with (that way if it’s already on, then it’s not going to dim or change off the existing colour) this is working for me without any problems.
I would like an automation to turn this lightstrip off, under the following conditions:
-there has been no motion in the past 2 mins
-as long as the lightstrip is currently 40% brightness
OR
Turn off my first automation once no motion detected after 2 mins.
I used to have this configured this way via SmartThings without much of a hassle, but I’m trying to move everything over to HA. I’ve spent the last 3 hours trying to get HA to recognise the brightness of the lightstrip but it just won’t play ball and I’m completely clueless.
Here’s the current YAML for the automation I’ve currently got:
alias: Kitchen Motion night {ON}
description: >-
Runs when kitchen motion sensor detects motion at night time, as long as
kitchen lightstrip is currently off
trigger:
- type: motion
platform: device
device_id: a099df7a277b4ac8185313f087d59b3a
entity_id: binary_sensor.kitchen_motion_sensor_iaszone
domain: binary_sensor
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
after: "21:00:00"
before: "06:00:00"
enabled: true
- condition: and
conditions:
- condition: device
type: is_off
device_id: a42aa752385cc87092757cc14e8cc9c6
entity_id: light.kitchen_island_lightstrip
domain: light
action:
- type: turn_on
device_id: a42aa752385cc87092757cc14e8cc9c6
entity_id: light.kitchen_island_lightstrip
domain: light
brightness_pct: 40
- service: light.turn_on
data:
entity_id: light.kitchen_island_lightstrip
color_temp: 397
mode: single