Motion sensor malfunction

Hi!

I have this simple motion sensor TZ3040 in my Home Assistant and simple automation (turn on the lights on motion/ turn off). For months it was working flawlessly.

It has been working poorly for a few weeks now. Sometimes it does not work at all, sometimes it works with delay of seconds. Today for example when I approach sensor it blinks blue light (like usually when motion is detected) but entity in HA does not report movement.

Battery is 80%, newest system / core on HA, I tried to reconfigure sensor - nothing worked.

I will appreciate your help.

alias: turn on the light when motion is detected between 6:30 AM till 12:00PM
description: ""
triggers:
  - type: motion
    device_id: 738ff76201ba8af709e313a8173a23e7
    entity_id: e26dd31a9013224390ddf8ff326f1b62
    domain: binary_sensor
    trigger: device
conditions:
  - condition: time
    after: "06:30:00"
    before: "00:00:00"
actions:
  - type: turn_on
    device_id: 84d387fbbcff258952f530b102266230
    entity_id: 3bdc7db52a5879e58d49fef14189a6c6
    domain: light
mode: single

alias: turn off the light when motion is no longer detected
description: ""
triggers:
  - type: no_motion
    device_id: 738ff76201ba8af709e313a8173a23e7
    entity_id: e26dd31a9013224390ddf8ff326f1b62
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - type: turn_off
    device_id: 84d387fbbcff258952f530b102266230
    entity_id: 3bdc7db52a5879e58d49fef14189a6c6
    domain: light
mode: single

You need to post that here, properly formatted, so we can help. No way to fix something if we can’t see it.
Post the yaml code and use the </> key here to format it for us, please.

Sure, thank you! I will put it in the first post.

The documentation states:

If only after key is used, the condition will be true from the specified time until midnight .

So given your use case, the line:

    before: "00:00:00"

Is at minimum unnecessary, its unclear to me what the behavior would be with that line present in your automation - I suggest removing that line and testing again.

If it still doesn’t work please provide a trace.