Hue bulb trigggered with no reason

Hello, I have this code to turn on the light with the motion sensor:

- id: motion_light
  alias: Turn on the light when motion detected and not too much light and light not already on
  trigger:
  - entity_id: binary_sensor.front_door_motion_sensor
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: light.hue_hall
    state: 'off'
  action:
  - service: input_boolean.turn_on
    entity_id: input_boolean.motion_lights_on
  - service: light.turn_on
    data:
      entity_id: light.hue_hall
      brightness: 200

which turns on the light whenever the motion is detected and saves sets the input boolean, that motion lights are on (for the purpose of switching off, see later).
Then I have another automation, which turns motion lights off:

- id: motion_light_off
  alias: Turn off the light turned on by motion
  trigger:
  - entity_id: binary_sensor.front_door_motion_sensor
    platform: state
    to: 'off'
    for:
      seconds: 60
  condition:
  - condition: state
    entity_id: input_boolean.motion_lights_on
    state: 'on'
  action:
  - service: light.turn_off
    entity_id: light.hue_hall
  - service: input_boolean.turn_off
    entity_id: input_boolean.motion_lights_on

These 2 work perfectly fine 95% of times. Sometimes I find this in the logbook:

7:40 PM Hue Hall turned on
7:40 PM Motion lights on turned off
7:40 PM Hue Hall turned off
7:40 PM Turn off the light turned on by motion has been triggered
7:39 PM Front door motion sensor cleared (no motion detected)

The Hue hall just turns on by itself with no reason and never goes off. Can somebody help me how to debug this? Sensor is using third party library, but I don’t think the problem is there. Sensor is set to “Do nothing” in the official hue app.

Nothing there looks wrong.

My guess is it’s something with the hue hub. Maybe it’s caching a command and sending it out later.

Try cleaning the bridge rules?

https://www.reddit.com/r/Hue/comments/f30t5x/hue_lights_turning_off_randomly/

  1. Open the Philips Hue app
  2. Go to settings
  3. Select your bridge
  4. Click the info icon
  5. Select Clean up
  6. Click the Clean up button

Thank you for your fast reply and suggestion. I cleaned up Hue Bridge this morning and I’ll report back how this behaves further.

Ok, cleaning up the bridge did not help. I’ll try to delete the boolean flag - motion_lights_on (I use it to indicate wheather light is supposed to be turned of by motion sensor if it was switched on this way) to see if it helps