kabbi / zigbee2mqtt-adapter

zigbee2mqtt adapter for WebThings gateway
Mozilla Public License 2.0
21 stars 13 forks source link

cannot get data from window sensor #7

Closed flatsiedatsie closed 3 years ago

flatsiedatsie commented 5 years ago

After dealing with the previous issue, and adding support for my version of the magnetic sensor to the devices list, I got another issue.

If the add-on receives the actual device data, it's hoping to find a device ID in msg.device.modelId. However, the device dictionary is not sent with a normal open/close message. It only contains: { battery: 100, voltage: 3055, contact: true, linkquality: 68 }

The deviceId itself is available as the MQTT topic title.

flatsiedatsie commented 5 years ago

I've created a pull request that fixes this issue.

The add-on is now working for me.

kabbi commented 5 years ago

I thought that device field is always sent by bridge when include_device_information is set in https://www.zigbee2mqtt.io/configuration/configuration.html . Isn't it the case for you? Or is it missing only for specific device type?

kabbi commented 5 years ago

Anyway, I think I should mention this config option in my readme

flatsiedatsie commented 5 years ago

I didn't know about that setting. But using the default add-on, as it was, it was not re-sending that data. At least not as one single incoming message.