Asking for help with creating "night light"

I am only 2 days into homeassistant, so please bear with me.

This is my first automation

I am trying to lower brightness of hue lights at night. Night condition is not implemented yet due to
testing.

My attempt is not working .Any help ia appriciated

id: '1672412534760'
alias: Ny automatisering
description: nat lys
trigger:
  - platform: state
    entity_id:
      - light.kontor_aktivitetsrum_i_77659
    for:
      hours: 0
      minutes: 0
      seconds: 0
    to: 'on'
condition: []
action:
  - service: scene.turn_on
    data:
      brightness: 10
    target:
      entity_id: scene.ny_scene
  - parallel:
      - repeat:
          count: '10'
          mode: single

Can you describe what you are trying to do more specifically…

Asking a Good Question

From what you have posted… there a couple problems

  1. brightness is not a valid key for a scene.turn_on service call. You can only use transition which will alter how long it takes for the light to change from it’s current state to the scene-defined state.
  2. Your parallel and repeat actions are not currently doing anything.

Thank you for your answer.

What i am trying to achieve is , is to lower brigthness when lights turn on at night.

So when ligths ON , i want to activate phillips Hue scene with 10% brightnes , since i dont have physical dimmers.

this is my current version. it does work when i manually run it so dont know if trigger is wrong or something

Not sure if it makes sence.

Current version

alias: Ny automatisering
description: nat lys
trigger:

  • platform: state
    entity_id:
    • light.kontor_lys_gruppe
      to: “on”
      condition:
  • condition: time
    after: “19:00:00”
  • condition: time
    before: “05:00:00”
    action:
  • service: hue.activate_scene
    data:
    brightness: 12
    transition: 0
    target:
    area_id: office
    mode: restart

i am running latest hassOS 2024.3

When set up as two separate conditions, midnight acts as a threshold for each. So the combined logic becomes something like “Is the current time both between 00:00-05:00 AND between 19:00-00:00?”… This will always be false.

Instead, consolidate the Time conditions.

condition:
  - condition: time
    after: “19:00:00”
    before: “05:00:00”
action:

You could alternatively use an Or condition:

condition:
  - or:
      - condition: time
        after: “19:00:00”
      - condition: time
        before: “05:00:00”
action:
1 Like

thanks AGAIN

I see you logic,but cant seem to grasp how to do it

So how would the best way be to setup between 2300 at night to 0500 in the morning ?

I missed you already suggeted something. i really appriciate it.

Just want to thank you.

It works now . I really appriciate your patience and quick help…