Outside lights not coming on correctly Due to confusions on APPS

I have some outdoor lights doing weird things and no clue where its coming from as in which Apps as I have done things in ALEX A, GOOGLE AND HOME ASSISTANT to automate these to come on when I return home.
But they are only 2 sets of lights coming on and they are doing it during the day when I want them to be doing it after sunset, which they seem to be set ok in-Home Assistant but not fully sure they are.
so I’m clueless to where they are set to be coming on also in Google and Alex a I have a set 4 lights to come on not two in Home Assistant.

why I’m confused where it’s doing the automation from has only 2 come on.
So I’m not fully sure if Home Assistant is doing the Automatons or the other Apps doing it to try to make changed on all my setups.

This is the Automation I have attempted so far!

I have another Automation that also works by a Sensor, which does the same things and turns the outside lights on when motion is detected but sensors are not able to pick up a further distance for it to come one in on a timely manner.

I hope someone can help me resolve these issues somehow and my confusion in it all too!

alias: TURN OUTSIDE LIGHT ON
description: When home
triggers:
  - device_id: 82cd23fd381d2080b488712ec51eb712
    domain: device_tracker
    entity_id: b9da231a38a9c00790f6d0f0954975e1
    type: enters
    trigger: device
    zone: zone.home
    id: Home Zone
  - device_id: 82cd23fd381d2080b488712ec51eb712
    domain: device_tracker
    entity_id: b9da231a38a9c00790f6d0f0954975e1
    type: enters
    trigger: device
    zone: zone.hynburn_area
    id: Hynburn Area
  - device_id: 82cd23fd381d2080b488712ec51eb712
    domain: device_tracker
    entity_id: b9da231a38a9c00790f6d0f0954975e1
    type: enters
    trigger: device
    zone: zone.europe
    id: Europe
  - type: not_occupied
    device_id: 86f56cc5b28fe9e72d1a1dcd16688a70
    entity_id: fc220d7efa081bb34ba72782fcb94bc0
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 3
      seconds: 0
    id: Became not occupied
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Home Zone
          - condition: sun
            before: sunrise
            after: sunset
        sequence:
          - action: light.turn_on
            target:
              entity_id:
                - light.h6811_5978_netting_lights
                - light.h7038_4757_fence_bulbs
                - light.h7075_763d_front_light
                - light.outside_light
                - light.path_lights_socket_1
                - light.path_light_2_socket_1
            data: {}
      - conditions:
          - condition: trigger
            id:
              - Became not occupied
        sequence:
          - action: light.turn_off
            target:
              entity_id:
                - light.h6811_5978_netting_lights
                - light.h7038_4757_fence_bulbs
                - light.h7075_763d_front_light
                - light.outside_light
                - light.path_lights_socket_1
                - light.path_light_2_socket_1
            data: {}
      - conditions:
          - condition: trigger
            id:
              - Hynburn Area
        sequence:
          - action: light.turn_off
            target:
              entity_id:
                - light.h6811_5978_netting_lights
                - light.h7038_4757_fence_bulbs
                - light.h7075_763d_front_light
                - light.outside_front_door_camera_floodlight_timed
                - light.path_lights_socket_1
                - light.path_light_2_socket_1
            data: {}
mode: single

Logs would help.

What happens when you manually trigger the automation?

You have 3 things controlling your lights, Alexa, Google and HA. Turn them all off then try one at a time and observe.

1 Like

Looking again, the condition before sunrise and after sunset will never be true. The day starts at midnight and finishes at the following midnight.

I usually use

conditions:
  - condition: template
    value_template: "{{ state_attr(\"sun.sun\", \"elevation\") < 4 }}"

How do I get log file for you?

Nothing Happens when I run the Actions!

what is

conditions:
  - condition: template
    value_template: "{{ state_attr(\"sun.sun\", \"elevation\") < 4 }}"

Has I never use Yaml to change the code! should I?

I figured to get the log file and download it how best to post it on here for you? I can see a lot of errors in it too!

Not looking a healthy HA and I seem to have too many devices but in the real world of my HA I don’t have 150