Please help me correct my non working automation

Hi All

Unfortunately i need to recreate an automation due to a crashed system.

this is not working for me.

Automation is to dim lights at night .

Blockquote- id: ‘1763831505108’
alias: natlys
triggers:

  • trigger: state
    entity_id:
    • lights.lys_aktivitesrum
      from:
    • ‘off’
      to:
    • ‘on’
      conditions:
  • condition: time
    after: ‘23:00:00’
    before: 05:00:00
  • condition: state
    entity_id: light.kontor_tryk_lys
    state:
    • ‘off’
      actions:
  • action: scene.turn_on
    scene_id: light_ihc_kontor_lys
  • variables:
    brightness: 10
    mode: single

Blockquote

I don’t use scenes, myself (haven’t been in a position to find a use for one), but just perusing through your automation… First, you need to define the target and, also, is the name of the scene correct? The action block should look more like this -

action:
  - service: scene.turn_on
    target:
      entity_id: scene.test_scene

EDIT - In retrospect, are you even using a scene? If your action is just to dim a light or light group and you’re not using a scene, then your action block should look more like this -

action:
  - service: light.turn_on
    data:
      brightness_pct: 10
    target:
      entity_id: light.test_light

Hi Matt

thx for replying

i have realised that the automation is really off.

You are absolutely correct, i am not using a scene, i am “just” dimming a group of hue lights.

i will start over

I am really fighting this and after 20 failed attempts , i am begining to belive i might have issues in my system.

So i have made a really simple automation and it still fails.

Any comments to the below…

Blockquote

alias: KONTOR NAT LYS
description: “”
triggers:

  • trigger: state
    entity_id:
    • light.lys_aktivitesrum
      from:
    • “off”
      to:
    • “on”
      conditions:
      actions:
  • if:
    • condition: state
      entity_id: light.ihc_kontor_lys
      state:
      • “on”
        then:
    • action: light.turn_on
      metadata: {}
      target:
      entity_id: light.ihc_kontor_lys
      data:
      brightness_pct: 24
      mode: single

Blockquote

Please format your post properly so we can tell where issues are coming from.

1 Like

Like this ?

alias: KONTOR NAT LYS
description: “”
triggers:

* trigger: state
entity_id:
  * light.lys_aktivitesrum
from:
  * “off”
to:
  * “on”
conditions:
actions:
* if:
  * condition: state
entity_id: light.ihc_kontor_lys
state:
    * “on”
then:
  * action: light.turn_on
metadata: {}
target:
entity_id: light.ihc_kontor_lys
data:
brightness_pct: 24
mode: single

Not sure why all of those asterisks appear… but afaik, they shouldn’t be there. Unless it was a simple copy-pasta translation mistake when you used the preformatted text block. Whatever the case, let’s try this -

alias: KONTOR NAT LYS
description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - light.lys_aktivitesrum
    from:
      - "off"
    to:
      - "on"
conditions:
  - condition: state
    entity_id: light.ihc_kontor_lys
    state:
      - "on"
actions:
  - action: light.turn_on
    metadata: {}
    data:
      brightness_pct: 24
    target:
      entity_id: light.ihc_kontor_lys

EDIT - so this automation works if the light.ihc_kontor_lys is already on when light.lys_aktivitesrum is turned on, then light.ihc_kontor_lys will dim to 24%. Is that what you want? If you want light.ihc_kontor_lys to turn on with a brightness of 24% when light.lys_aktivitesrum is turned on, then just remove the condition.

Thank you for your help.

Although i get this error message, when i save the automation, and automation does not run

Have you done as the error message says? Seems there is something wrong in your configuration.yaml

that is my conclusion as well.

I am looking at configuration.yaml , but not sure how to find errors ?

in Developer tools you can click check configuration like this, if you get anything other than the green text paste it in here in this thread as preformatted text, redact any sensitive information if you have it in the file

nothing but green

i looking i the logs to find any kind of clue.

I see this, but not sure about it

and this. But it seems to be a long time “issues” with the IHC integration, but everything seems to work even with error message.