#Automations using sunrise/sunset not triggering

1 messages · Page 1 of 1 (latest)

white fjord
#

I have automations which use sunrise/sunset that have stopped working in the last month or so. The automation configurations haven't changed, and other automations are working, it's just the sunrise/sunset ones that broke.

Thoughts on why?

#

Here's the automation code:

id: '1755516189591'
alias: Turn porch light on when motion detected after hours
description: ''
triggers:
  - type: motion
    device_id: 49e3c4e51eab11eb89eebbd6c6af6baa
    entity_id: e2c87c3a6796e2b0fee0766dd3340e97
    domain: binary_sensor
    trigger: device
conditions:
  - condition: sun
    before: sunrise
    after: sunset
actions:
  - type: turn_on
    device_id: e1c54d37ec3beb5c37a4a78e13bbf74e
    entity_id: 2c5789b6fd8640ff0023be065eb9770b
    domain: switch
mode: single
velvet void
#

you forgot the closing code tags 🙂

grand dove
#

I have a very similar setup. The YAML looks about the same? Maybe verify the motion sensor is happy and still detecting?

description: ""
triggers:
  - type: motion
    device_id: 91f96825c5891d8aac0778b398701856
    entity_id: 1cb5e3a5377ad37c046e5fdc82300fc4
    domain: binary_sensor
    trigger: device
conditions:
  - condition: sun
    after: sunset
    before: sunrise
actions:
  - action: switch.turn_on
    metadata: {}
    target:
      entity_id: switch.driveway_lights
    data: {}
mode: single```
limber horizon
#

I set up a dining room light with two separate automations for on and off, with offset from sun state:

alias: turn-on-one-hour-pre-sunset
description: ""
triggers:
  - trigger: sun
    event: sunset
    offset: "-01:00:00"
conditions: []
actions:
  - type: turn_on
    device_id: ff8912eda118b2348f7a9dd61295466b
    entity_id: ecdce6bda91d74a6d954e1d714e3f2c9
    domain: switch
mode: single
#

Mine triggers on the sun state offset instead of just as a condition on a different trigger though

white fjord
#

And it's not working either

#

Like, here, we can see that I'm in "sunrise"

#

But this never fired:

#

This uses a Ring camera and a Meross WiFi light switch, and a Meross plug.

I have another Meross plug that operates on specific times, and that one is working, which leads me to believe that the Meross integration seems to be fine.

#

It appears to be just strictly the sunrise/sunset options that are misbehaving

limber horizon
#

Last time I had an issue with an integration not firing, I restarted HA and it fixed it, heh (might be worth a try)

white fjord
#

Was one of the first things I tried when the issue popped up

blazing elm
white fjord
#

I'm less familiar with troubleshooting in traces, so you'll need to be patient with me there:

blazing elm
#

no that's fine... that's really weird though because 20:37:08 is definitely before 23:44:59...

white fjord
#

Indeed.

That's why I'm here

blazing elm
#

also... where are you that sunset is 15 mins before midnight in March!?

white fjord
#

I'm in Florida.

So, now I'm questioning whether or not this is even tracking time properly at all

#

As noted in an image higher up, the next sunset is expected around 7:46

blazing elm
#

ah no, that should be correct then, as the timestamp will be in UTC and y'all are at UTC-4

#

in which case it's working correctly to not run after 7:47, no?

white fjord
#

No, because it should be turning the light off after sunrise, but before sunset

#

So, the fact that it's trying to execute at 8:37pm is likely part of the problem

#

I think I see the issue

#

I think I got my triggers and conditions backwards

#

Well, on THIS one anyways

#

The issue with the motion sensor automation is still a problem

blazing elm
#

what's the issue with that?

white fjord
#

The automation is supposed to be "If motion detected in driveway, between sunset and sunrise, turn on porch light", but it seems like despite the motion being detected, it's not turning on the light.

blazing elm
#

ok, but the condition is set to be between sunrise and sunset?

white fjord
#

Yes

blazing elm
#

so swap it round, then it should work

white fjord
#

Not on the camera, sorry

#

Camera is set up properly.

#

But in digging into it further, it's possible that the camera is not firing the motion detected sensor to Home Assistant properly.

#

Starting to wonder if it's Ring's fault.

They recently gave me a 14 day trial of their stupid AI motion describer thingy

blazing elm
#

ah ok, well - check the traces, that will help you differentiate between "the trigger is failing" and "the condition is behaving weirdly"

white fjord
#

Trace isn't showing anything because the thing appears to have stopped working on the 23rd of March

#

Hasn't fired since, because I think the motion events aren't coming through

blazing elm
#

yeah, if there are no traces, the trigger isn't occurring, likely a ring thing

white fjord
#

Yeah, I'm starting to lean towards Ring.

I'm looking at the other devices, and they all seemed to stop firing motion detection events on the 23rd

blazing elm
#

then you should finish leaning towards ring

white fjord
#

It's weird. The "Last motion activity" sensor is working

#

But the "Motion detected itself" is broken

blazing elm
#

hmm

#

try changing to a state trigger based on that "last motion activity" sensor then

white fjord
#

It's a short driveway, that'll turn the light on after Amazon drops the packages off, versus while they're wlaking up

blazing elm
#

ok, but if the data isn't there you've got to make do with what you've got

white fjord
#

I think it's related tot his:

https://www.home-assistant.io/integrations/ring/

There's a spot in there saying that after a 2023 update if you have too many authorized devices motion detection may not work properly, so you need to clear out the authorized devices.

Home Assistant

Instructions on integrating Ring.com devices with Home Assistant.

#

I'm starting to suspect that after each Home Assistant update it was registering with Ring as a new device, and I may have hit my "limit"

#

Yes

#

That appears to have fixed it

#

FFS, what a stupid bug

#

Just to close the loop