#Before/After Sunset not triggering properly

1 messages · Page 1 of 1 (latest)

coarse elm
#

My automation seems to always think it’s before sunset, leading to only that conditional set of actions taking place. I’m not sure what I’m doing wrong. I have tried using sunrise/sunset and before/after and nothing seems to work.

  - entity_id: media_player.lg_tv
    from: "on"
    to: "off"
    trigger: state
conditions: []
actions:
  - target:
      entity_id:
        - switch.sync_box_power
        - switch.sync_box_light_sync
    action: switch.turn_off
    data: {}
  - target:
      device_id:
        - 38abe3297a47f01c949d605f2afdfe7b
        - f26e20fa60702c1f7d55479a05a3827d
        - 05e23baad3f1a9b92dabf56312689ef2
    data:
      transition: 2
    action: light.turn_off
  - choose:
      - conditions:
          - condition: sun
            after: sunrise
        sequence:
          - target:
              device_id: 5169327fed5204139591037e2f1d001a
            data:
              transition: 2
            action: light.turn_off
          - delay: "00:00:10"
          - condition: state
            entity_id: media_player.lg_tv
            state: "off"
          - condition: state
            entity_id: cover.windowcovering_cover
            state: closed
            for:
              seconds: 5
          - target:
              device_id: b0f24750f4f6f6623ab65580c03a38dc
            action: cover.open_cover
            data: {}
      - conditions:
          - condition: sun
            before: sunrise
        sequence:
          - target:
              device_id: 5169327fed5204139591037e2f1d001a
            data:
              transition: 2
              rgb_color:
                - 254
                - 228
                - 168
              brightness_pct: 50
            action: light.turn_on
          - delay: "00:05:00"
          - target:
              device_id: 5169327fed5204139591037e2f1d001a
            data:
              transition: 2
            action: light.turn_off
mode: single```
cunning stirrup
fossil prairie
#

These conditions should work fine, however, besides elevation you could also use a state condition on the sun.sun entity

condition: state
entity_id: sun.sun
state: above_horizon
coarse elm
#

I’ll give these both a shot. Thank you both!

coarse elm
#

Is there a way to offset the above/below portion directly? Or would that then just be messing around with the elevation numbers?

cunning stirrup
#

this one was a hit:
"your attention please, the room appears to be getting dark so i am going to turn the light on, if this needs to be earlier or later please report this to the administrator and it will be adjusted"