#Automation for Increasing Brightness Depending on Motion

9 messages · Page 1 of 1 (latest)

stable tangle
#

Hi. Using Lewis's video on @cedar galleon YouTube about HASS automations for better smart lights (https://youtu.be/Uom2hZmc-qA?si=o-fvJudxSsm16CLN), I managed to create automation that switches lights on when motion is detected and off when no motion detected. However, I want to go further step by making the brightness of the lights 20% when motion is first triggered, then the brightness increases as long as motion duration increases. Any ideas how to do that?

Home Assistant Automations are insanely powerful but can be a little overwhelming if you are new to Home Assistant since it has SO MANY options, so in this video I take you through 5 different ways to automate Smart Lights in your Smart Home by using location, presence, zones, schedules, adaptive lighting and light level!

HACS: https://hacs.xyz...

▶ Play video
stable tangle
#

Can I have some help here?

cedar galleon
stable tangle
#

i consulted GPT to write me the code and I got this:

#

automation:

  • alias: "Motion-Activated Brightness Control"
    trigger:
    • platform: state
      entity_id: binary_sensor.motion_sensor # Replace with your motion sensor's entity_id
      to: "on"
    • platform: state
      entity_id: binary_sensor.motion_sensor
      to: "off"
      for:
      minutes: 5 # Adjust the time interval as needed
      action:
    • service: script.turn_on
      entity_id: script.motion_brightness_control

script:
motion_brightness_control:
sequence:
- service: light.turn_on
entity_id: light.your_light # Replace with your light's entity_id
data:
brightness: 20
- delay: "00:05:00" # Adjust this delay to set the increment interval
- service: light.turn_on
entity_id: light.your_light
data_template:
brightness: "{{ state_attr('light.your_light', 'brightness') | int + 10 }}"

#

but when i try it i get error message like this:

#

Message malformed: extra keys not allowed @ data['automation']

#

i could not find what's the issue about it, though

faint star
#

Probably cause you copy pasted the full thing into an automation yaml as-is?