I enabled Info Logging and inspected the logs. When I put my hand in front of the sensor, there is an immediate topic send, with occupancy set to true. Then there is another, which I assume is the illuminancy, which triggered it. About 5-6 seconds later it spammed my console with 9 topics, but there was no change. And occording to what I understand about the reporting, only occupied could have reported something, due the min values.
To test that, I removed every reporting section but the occupancy. Tried it again and it just worked normal. One topic when I hold my hand in front of the sensor and after about 10 seconds the occupancy: false topic.
I then reconfigured the illuminancy report and it seemed to work at first, but quickly it goes back to the odd behavior.
I reconnected the device (removed it completely and interviewed it again) and suddenly it seemed to work. After changing some settings, like illuminancy calibration, it started acting weird again.
In my experience with these sensors over Z2M (and non-Hue sensors, too), the hardware has a tendency to send multiple updates in quick succession even when there is no change in reported states across the succession. I don’t know why; possibly to improve reliability. Keep in mind that Philips primarily designed these sensors to work with a Hue hub, not Z2M.
In any event, Z2M is just faithfully reporting to you what comes in over the radio.
Z2M offers a “debounce” feature which might help reduce occurrences of this. But keep in mind that this feature might reduce the responsiveness of your automations to motion detections. For example, a debounce setting of 0.5 will cause Z2M to hold off reporting a payload for a half second, and anything that comes in over that window is collapsed into a single MQTT message.
I avoid using debounce with motion sensors. It’s more useful when a sensor can produce a quick succession of conflicting states (like a contact sensor). But motion sensors tend not to do that, because they usually have an internal timer during which they hold occupancy “true” once motion is detected. Plus, you aren’t ever guaranteed that a motion sensor won’t send the same occupancy state sequentially, whether in quick succession or 15-30 seconds apart. For this reason, if your automations depend on doing something only when occupancy changes from true to false or false to true, if you’re basing them on Z2M triggers, you probably need a helper Boolean or something of the sort to keep track of what the last update was.