# Description:
#   Dim lights 1/3 brightness each second
#
# Written for:
#   @JesseWebDotCom
#
# Components:
#   automation
#   light
#   script
#
# License:
#   MIT
#
# Author:
#   Dale Higgs <@dale3h>
#
# PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS

automation:
  - alias: slow_dim_lights
    trigger:
      ...
    action:
      - service: script.slow_dim_lights
        data:
          entity_id: light.living_room

script:
  slow_dim_lights:
    alias: 'Slow Dim Lights'
    sequence:
      - service: light.turn_on
        data_template:
          entity_id: "{{ entity_id }}"
          brightness: "{{ states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int * (2 / 3))|int }}"
      - delay:
          seconds: 1
      - service: light.turn_on
        data_template:
          entity_id: "{{ entity_id }}"
          brightness: "{{ ((states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int / (2 / 3))|int * (1 / 3))|int }}"
      - delay:
          seconds: 1
      - service: light.turn_off
        data_template:
          entity_id: "{{ entity_id }}"

# Description:
#   Dim lights 1/3 brightness each second
#
# Written for:
#   @JesseWebDotCom
#
# Components:
#   automation
#   light
#   script
#
# License:
#   MIT
#
# Author:
#   Dale Higgs <@dale3h>
#
# PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS

automation:
  - alias: slow_dim_lights
    trigger:
      ...
    action:
      - service: script.slow_dim_lights
        data:
          entity_id: light.living_room

script:
  slow_dim_lights:
    alias: 'Slow Dim Lights'
    sequence:
      - service: light.turn_on
        data_template:
          entity_id: "{{ entity_id }}"
          brightness: "{{ (states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int * (2 / 3))|int }}"
      - delay:
          seconds: 1
      - service: light.turn_on
        data_template:
          entity_id: "{{ entity_id }}"
          brightness: "{{ ((states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int / (2 / 3))|int * (1 / 3))|int }}"
      - delay:
          seconds: 1
      - service: light.turn_off
        data_template:
          entity_id: "{{ entity_id }}"

Fix slow dim lights config error
Fix slow dim lights config error
