Lights on external motion sensor turning on automatically

In my floor I have an already builtin motion sensor with two ceiling lights. I’m using Ikea Tradfri lights in there and other places.

The problem is, that those lights always turn on, even if I turn them off manually from HA. Logs simply say “Light turned on”. The motion sensor is always-on (it has 3 states: always-off, always-on and auto) so it should be as if it doesn’t exist.

However I noted that if I only turn off one of the two lights, the other one does not turn on automatically. Only when both are being turned off, they turn on again. I assume the external motion sensor is somehow giving them power again or so?

I should maybe add that I’m using zigbee groups (one group for those two), but I do that in other places as well without these problems.

Is that a known phenomenon? Anything I can do?

So they are activating regardless of being in an automation or not correct?

Yes. In fact, I just bought two other Ikea lamps (the bigger ones) to replaced the old ones and added them to ZHA. Then, without doing anything else (not even giving them a new name) I turned one of them off from the add-device screen. That works. Then I turn the other one off and both turn on again after 3 seconds. The order in which I turn them off doesn’t matter.

I’m quite certain now that this neither a problem with homeassistant nor with my configuration. The builtin motion sesor in the switch probably removes power if resistance goes low and then brings it back 3 seconds later. Which makes the lights turn on by default (because they lost power).