Trying to achieve robust behaviour on `device_sun_light_trigger` and failing

I was happy when I discovered the Presence Based Lights (aka device_sun_light_trigger). Docs in https://home-assistant.io/components/device_sun_light_trigger/

The most basic behaviour works ok for me: when I arrive home, it switches on lights. However, sometimes undefined behaviour happens:

  • While there is nobody home, the light “tends to” turn on… why? The individual device_tracker seems to work ok.
  • If the device_tracker of one device fails, in the middle of the night, the light is turned on, even if there is another device at home. Is this the expected behaviour? I expected the and, not the or, amongst devices. If this is expected, can it be changed?

Is there a mechanism to disable it? I would be happy to “turn off” (just as can be done with automations) during the night and “turn it on” in the morning. But could not find the device, there is not? Not a service either.

My configuration (excerpts, hope it is complete enough):

device_sun_light_trigger:
  light_group: group.presence_lights
  device_group: group.albp_devices
  # Let another automation turn off ALL lights instead
  disable_turn_off: 1

group:
  albp devices:
    entities:
      - device_tracker.me_mobile
      - device_tracker.so_mobile

  presence lights:
    entities:
      - light.ambiance_menjador

@abarcelo - did you find a solution for these issues? I see the same behaviour with lights turning on if one device tracker fails but the other one is “home”

I changed a little bit and tweaked the device_tracker and at the end it worker slightly better. But there were some issues I had to attend. I plan to soon update to last version and check again how it works.

Good luck!