Hi Paul,
Happy to hear of your progress! Glad you are finding Zigbee2MQTT a place where you can be pretty successful with this ‘wild west’ firehose of new zigbee devices. I do hope ZHA does make some good strides as well, however for now Mr. Kanters and team at Z2M are doing the amazing work. Yes, it is frustrating that some Zigbee devices do not communicated with each other. Of the problems I have had, 90% of them have been with Aqara devices, that guides my future Zigbee device purchase strongly. Again, when figuring out some of these these issues, the logs and tools at Zigbee2MQTT have really been the most helpful of any of the 10 or so Zigbee networks I have experimented with over the years.
Enough of my blathering. To your issue with as I understand it issue you have with the Ikea motion sensors commanding the FUT036Z LED controller.
First, I am really not sure from your writing what ‘level’ you are referring to with your issue. If you can spell this out a bit clearer this might help the many knowledgeable folks hear help pinpoint the root cause. When I say ‘level’, I am not sure if you are talking Home Assistant Automations, Home Assistant sensors/lights, MQTT messages or raw Zigbee commands. The raw zigbee level is pretty hard and very often not necessary to get down to. The MQTT message level is IMHO the right starting point. You really need to understand what MQTT messages Z2M is creating from the raw Zigbee commands/messages and what Z2M will do when a MQTT message is sent to it for a device.
This is why I recommend either the command line tool I showed in my previous post or a very useful GUI tool, ‘MQTT Explorer’ :
http://mqtt-explorer.com/
From my experience with the Ikea motion sensors, I would make sure the switch that shows the ‘sun’ vs. ‘moon’ on the back is in the ‘sun’ position, I have never been able to figure out the ‘illuminance_above_threshold’ function that I believe this switch controls.
Below is a binary sensor that I use for the Ikea motion sensor. You have to extract out the JSON attribute “occupancy” true/false as the important message. And VERY important in any automations you need to explicitly check for a binary sensor based “occupancy” change from ‘on’ to ‘off’ or ‘off’ to ‘on’. This is due to the fact the Ikea sensor will go to sleep and cause HA to set the binary sensor to ‘unknown’. Then when the sensor wakes up for a battery check or some reason other than a true occupancy change, your automation may fire. I have the HA binary sensor to ‘time out’ after 3600 seconds, this might or might NOT be a good idea.
I’m not sure where you found that the “occupancy clear” defaults to 180 seconds (3 minutes). The switch on the back has setting for 1 5 and 10 minutes. However, I believe the Z2M setting default of 90 seconds overrides this switch. And again, it’s default on my Zigbee2MQTT is 90 seconds.
Fundamentally, you have to make sure your HA binary sensor and automations based on it are only triggering on the exact state changes you want.
- name: "Ikea Motion Detector West"
device_class: motion
unique_id: "0x000b57abce8b6af8-Motion"
expire_after: 3600
state_topic: "zigbee2mqtt/0x000b57abce8b6af8"
value_template: "{{ value_json.occupancy }}"
payload_off: false
payload_on: true
availability_topic: zigbee2mqtt/0x000b57abce8b6af8/availability
json_attributes_topic: "zigbee2mqtt/0x000b57fffe8b6af8"
{"battery":100,"elapsed":65096,"illuminance_above_threshold":false,"last_seen":"2023-08-16T16:17:05-07:00","linkquality":83,"occupancy":true,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"}}
{"battery":100,"elapsed":90003,"illuminance_above_threshold":false,"last_seen":"2023-08-16T16:17:05-07:00","linkquality":83,"occupancy":false,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"}}
Second, I have used the Ikea motion sensors for a couple years with the Native Ikea hub, ZHA and Z2M. While they have for the most part done their job. They are a rather odd device.
Good hunting!