JohanBendz / com.tuya.zigbee

MIT License
67 stars 127 forks source link

Device Request - [Motion Sensor] - [eWeLink] / [SNZB-03] #1008

Open evinxnl opened 3 weeks ago

evinxnl commented 3 weeks ago

Prerequisites:

Device Information

Device Interview

Device 1

{
    ["info 2024-10-28 21:11:20z2m: Removing device '0xa4c138f9f5e8df98' (block: false, force: true)
info 2024-10-28 21:11:20z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138f9f5e8df98', payload ''
info 2024-10-28 21:11:20z2m: Successfully removed device '0xa4c138f9f5e8df98' (block: false, force: true)
info 2024-10-28 21:11:20z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/remove', payload '{"data":{"block":false,"force":true,"id":"0xa4c138f9f5e8df98"},"status":"ok","transaction":"e32n3-11"}'
info 2024-10-28 21:11:43zh:controller: Interview for '0xa4c138f9f5e8df98' started
info 2024-10-28 21:11:43z2m: Device '0xa4c138f9f5e8df98' joined
info 2024-10-28 21:11:43z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0xa4c138f9f5e8df98"},"type":"device_connected"}'
info 2024-10-28 21:11:43z2m: Starting interview of '0xa4c138f9f5e8df98'
info 2024-10-28 21:11:43z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0xa4c138f9f5e8df98"},"type":"pairing"}'
info 2024-10-28 21:11:43z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138f9f5e8df98","ieee_address":"0xa4c138f9f5e8df98"},"type":"device_joined"}'
info 2024-10-28 21:11:43z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138f9f5e8df98","ieee_address":"0xa4c138f9f5e8df98","status":"started"},"type":"device_interview"}'
info 2024-10-28 21:11:44z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"announce","meta":{"friendly_name":"0xa4c138f9f5e8df98"},"type":"device_announced"}'
info 2024-10-28 21:11:44z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138f9f5e8df98","ieee_address":"0xa4c138f9f5e8df98"},"type":"device_announce"}'
info 2024-10-28 21:11:56zh:controller: Succesfully interviewed '0xa4c138f9f5e8df98'
info 2024-10-28 21:11:56z2m: Successfully interviewed '0xa4c138f9f5e8df98', device has successfully been paired
info 2024-10-28 21:11:56z2m: Device '0xa4c138f9f5e8df98' is supported, identified as: SONOFF Motion sensor (SNZB-03)
info 2024-10-28 21:11:56z2m: Configuring '0xa4c138f9f5e8df98'
info 2024-10-28 21:11:56z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Motion sensor","friendly_name":"0xa4c138f9f5e8df98","model":"SNZB-03","supported":true,"vendor":"SONOFF"},"type":"pairing"}'
info 2024-10-28 21:11:56z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Motion sensor","exposes":[{"access":1,"description":"Indicates whether the device detected occupancy","label":"Occupancy","name":"occupancy","property":"occupancy","type":"binary","value_off":false,"value_on":true},{"access":1,"category":"diagnostic","description":"Indicates if the battery of this device is almost empty","label":"Battery low","name":"battery_low","property":"battery_low","type":"binary","value_off":false,"value_on":true},{"access":1,"category":"diagnostic","description":"Remaining battery in %, can take up to 24 hours before reported","label":"Battery","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":1,"category":"diagnostic","description":"Voltage of the battery in millivolts","label":"Voltage","name":"voltage","property":"voltage","type":"numeric","unit":"mV"},{"access":1,"category":"diagnostic","description":"Link quality (signal strength)","label":"Linkquality","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"SNZB-03","options":[],"supports_ota":false,"vendor":"SONOFF"},"friendly_name":"0xa4c138f9f5e8df98","ieee_address":"0xa4c138f9f5e8df98","status":"successful","supported":true},"type":"device_interview"}'
info 2024-10-28 21:11:57z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138f9f5e8df98', payload '{"linkquality":86,"voltage":3000}'
info 2024-10-28 21:11:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138f9f5e8df98', payload '{"battery":100,"linkquality":84,"voltage":3000}'
info 2024-10-28 21:11:58z2m: Successfully configured '0xa4c138f9f5e8df98'"]
}

Device 2 Interview

Device 2

{
    ["info 2024-10-28 21:26:02z2m: Accepting joining not in blocklist device '0xa4c1387b44fdf5a0'
info 2024-10-28 21:26:02zh:controller: Interview for '0xa4c1387b44fdf5a0' started
info 2024-10-28 21:26:02z2m: Device '0xa4c1387b44fdf5a0' joined
info 2024-10-28 21:26:02z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0xa4c1387b44fdf5a0"},"type":"device_connected"}'
info 2024-10-28 21:26:02z2m: Starting interview of '0xa4c1387b44fdf5a0'
info 2024-10-28 21:26:02z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0xa4c1387b44fdf5a0"},"type":"pairing"}'
info 2024-10-28 21:26:02z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1387b44fdf5a0","ieee_address":"0xa4c1387b44fdf5a0"},"type":"device_joined"}'
info 2024-10-28 21:26:02z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1387b44fdf5a0","ieee_address":"0xa4c1387b44fdf5a0","status":"started"},"type":"device_interview"}'
info 2024-10-28 21:26:03z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"announce","meta":{"friendly_name":"0xa4c1387b44fdf5a0"},"type":"device_announced"}'
info 2024-10-28 21:26:03z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1387b44fdf5a0","ieee_address":"0xa4c1387b44fdf5a0"},"type":"device_announce"}'
info 2024-10-28 21:26:12zh:controller: Succesfully interviewed '0xa4c1387b44fdf5a0'
info 2024-10-28 21:26:12z2m: Successfully interviewed '0xa4c1387b44fdf5a0', device has successfully been paired
info 2024-10-28 21:26:12z2m: Device '0xa4c1387b44fdf5a0' is supported, identified as: SONOFF Motion sensor (SNZB-03)
info 2024-10-28 21:26:12z2m: Configuring '0xa4c1387b44fdf5a0'
info 2024-10-28 21:26:12z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Motion sensor","friendly_name":"0xa4c1387b44fdf5a0","model":"SNZB-03","supported":true,"vendor":"SONOFF"},"type":"pairing"}'
info 2024-10-28 21:26:12z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Motion sensor","exposes":[{"access":1,"description":"Indicates whether the device detected occupancy","label":"Occupancy","name":"occupancy","property":"occupancy","type":"binary","value_off":false,"value_on":true},{"access":1,"category":"diagnostic","description":"Indicates if the battery of this device is almost empty","label":"Battery low","name":"battery_low","property":"battery_low","type":"binary","value_off":false,"value_on":true},{"access":1,"category":"diagnostic","description":"Remaining battery in %, can take up to 24 hours before reported","label":"Battery","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":1,"category":"diagnostic","description":"Voltage of the battery in millivolts","label":"Voltage","name":"voltage","property":"voltage","type":"numeric","unit":"mV"},{"access":1,"category":"diagnostic","description":"Link quality (signal strength)","label":"Linkquality","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"SNZB-03","options":[],"supports_ota":false,"vendor":"SONOFF"},"friendly_name":"0xa4c1387b44fdf5a0","ieee_address":"0xa4c1387b44fdf5a0","status":"successful","supported":true},"type":"device_interview"}'
info 2024-10-28 21:26:13z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c1387b44fdf5a0', payload '{"linkquality":89,"voltage":3000}'
info 2024-10-28 21:26:14z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c1387b44fdf5a0', payload '{"battery":100,"linkquality":86,"voltage":3000}'
info 2024-10-28 21:26:14z2m: Successfully configured '0xa4c1387b44fdf5a0'
}

Additional Comments:

https://www.zigbee2mqtt.io/devices/SNZB-03.html

How to interview a device

Note: To be able to add more devices to the Tuya Zigbee app, we rely on community members like you to provide interviews of the devices you want to be added. Thank you for your contribution!

evinxnl commented 2 days ago

Got it to work

its the same as motion sensor driver only different manufacturerName and batteries { "id": "motion_sensor", "name": { "en": "Motion Sensor" }, "class": "sensor", "platforms": ["local"], "connectivity": ["zigbee"], "capabilities": [ "alarm_motion", "measure_battery" ], "energy": { "batteries": [ "AAA" , "AAA" ] }, "images": { "large": "{{driverAssetsPath}}/images/large.png", "small": "{{driverAssetsPath}}/images/small.png" }, "zigbee": { "manufacturerName": [ "eWeLink" ], "productId": [ "SNZB-03" ], "endpoints": { "1": { "clusters": [0, 1, 1280], "bindings": [1, 1280] } }, "learnmode": { "image": "{{driverAssetsPath}}/icon.svg", "instruction": { "en": "Push the setup button on the side of the device for aprox 5 seconds until the LED blinks rapidly. If the pairing does not start, press the setup button again for 10-15 seconds until the led stops blinking and then try again." } } } }