HI! I’ve been trying to reverse the state of my SNZB-04, as I’ve repurposed it as a bed occupancy sensor (inspiration from here and here). I’ve been trying for hours to reverse the contact sensor state and classify the device as an occupancy sensor when paired. I know that I can create a custom template sensor, but I want it to show up under my Device in HA, so I would like to reverse it at the zigbee2mqtt level
Steps done:
- Pair the device to get the device ID (e.g.
0x00124b0024451e30
) - Add the custom configuration as suggested here
- Delete the device from HA (as outlined here)
- Restart zigbee2mqtt
I’ve also tried:
- Restarting Home Assistant
- Not deleting the device from Home Assistant
- Adding the custom device configuration directly to the zigbee2mqtt config
- Through HA frontend (Settings → Add-ons → Zigbee2mqtt → Configuration)
- Through File Editor:
/config/zigbee2mqtt/configuration.yml
- Through SSH:
/config/zigbee2mqtt/configuration.yml
- Trying all of the above multiple times in different order etc…
This is my zigbee2mqtt config:
data_path: /share/zigbee2mqtt
socat:
enabled: false
master: pty,raw,echo=0,link=/dev/ttyZ2M,mode=777
slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
options: "-d -d"
log: false
mqtt:
base_topic: zigbee2mqtt
server: mqtt://192.xxx.xx.xx:1883
user: homeassistant
password: xxx
availability: true
serial:
port: >-
/dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_xxx
external_converters: []
devices:
"0x00124b0024451e30":
homeassistant:
contact:
payload_on: true
payload_off: false
device_class: occupancy
icon: mdi:motion-sensor
"0x00124b00244523c6":
friendly_name: Bed config debug
homeassistant:
contact:
payload_on: true
payload_off: false
device_class: occupancy
icon: mdi:motion-sensor
groups: groups.yaml
homeassistant: true
permit_join: false
For the life of me, I can’t seem to affect any of my devices in any way.