Help? with automation

Can I get some help i know that everythign up until the action is good
alias: prinmary-emaillightflash
description: flash lights on arrival of email in the INBOX folder
trigger:
platform: state
entity_id: sensor.imap_valera3025_gmail_com_primary
to: ~
condition:

  • condition: template
    value_template: >-
    {{ trigger.from_state.state|float < trigger.to_state.state|float }}
  • condition: time
    after: “08:00:00”
    before: “21:00:00”
    action:
  • if:
    • condition: state
      platform: state
      entity_id: light.studs_front_desk_left
      from: ‘on’
      then:
      • service: light.turn_on
        target:
        entity_id:
        • light.studs_front_desk_left
        • light.studs_room_rear_left
        • light.studs_room_rear_right
          data:
          brightness: 200
          rgbw_color: [0,0,255,0]
      • delay: “00:00:01”
      • service: light.turn_on
        target:
        entity_id:
        - light.studs_front_desk_left
        - light.studs_room_rear_left
        - light.studs_room_rear_right
        data:
        brightness: 255
        kelvin: 6535
        else:
      • service: light.turn_on
        target:
        entity_id:
        • light.studs_front_desk_left
        • light.studs_room_rear_left
        • light.studs_room_rear_right
          data:
          brightness: 200
          rgbw_color: [0,255,0,0]
      • delay: “00:00:01”
      • service: light.turn_off
        target:
        entity_id:
        - light.studs_front_desk_left
        - light.studs_room_rear_left
        - light.studs_room_rear_right

please post the code using the preformatted text option. it is otherwise hard to read

from a quick look it looks like you have an ‘if’ condition that should really be a trigger.

I think you have the same issue as in this question:

1 Like

You have a copy/paste error:

Conditions do not use platform or from.

action:
  - if:
      - condition: state
        entity_id: light.studs_front_desk_left
        state: 'on'