rbaron / b-parasite

🌱💧 An open source DIY soil moisture sensor
1.85k stars 143 forks source link

zigbee-herdsman converter for Zigbee sample to work out-of-the-box in Zigbee2MQTT and IoBroker #90

Closed Hedda closed 1 year ago

Hedda commented 1 year ago

zigbee-herdsman converter for sample based b-parasite Zigbee devices to work out-of-the-box in Zigbee2MQTT and IoBroker:

https://github.com/rbaron/b-parasite/tree/main/code/nrf-connect/samples/zigbee

As per the initial Zigbee sample pull request:

https://github.com/rbaron/b-parasite/pull/81

https://github.com/rbaron/b-parasite/tree/main/code/nrf-connect/samples/zigbee

The b-parasite.js file in this PR contains a converter that can be installed to Zigbee2MQTT to support this sample. See "Support new devices" for instructions.

https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

Will anyone submit that b-parasite.js converter file as a pull request to zigbee-herdsman-converters repo for inclusion by default?

https://github.com/Koenkk/zigbee-herdsman-converters

ginkel commented 1 year ago

If that's ok for @rbaron, I can submit a PR to zigbee-herdsman-converters.

rbaron commented 1 year ago

Thanks @ginkel, that would be great. Could you please test our converter against the latest HA just to be sure before submitting it? We also need to submit a photo. I would suggest this one.

Thanks!

ginkel commented 1 year ago

Excellent! I am using the b-parasite with z2m and latest HA 2023.5.4, so I can confirm that everything is working as expected. I just noticed in the converter that battery voltage reporting is commented out. Do you remember the reason for this?

Regarding the photo: I do have one with a more neutral background. The PCB has slightly rounded edges and the copper layer starts 1 mm from the PCB edge, though, but is unmodified otherwise: https://photos.app.goo.gl/smRuBSAahcgkgPyx8

Edit: I am preparing the converter PR in https://github.com/ginkel/zigbee-herdsman-converters/tree/feature/b-parasite

rbaron commented 1 year ago

Do you remember the reason for this?

IIRC I thought the batteryVoltage attribute was not reportable, only the percentage. But I see some devices in the converters repo that do configure it for reporting, so maybe I was wrong 😬. It would be great to give this a test, but we can also remove the commented code and just work with the percentage for now. Up to you!

Regarding the photo

I kinda like the one in our repo because it gives a sense of scale with the coin and also shows the battery clip on the back. Unless you feel strongly about it, I'd vote for that one.

Tks again!

rbaron commented 1 year ago

@ginkel I think I remember the reason now. In the Zigbee Cluster Library specs (section 3.3.2.2.3):

image

Only the BatteryPercentageRemaining is marked as reportable, and BatteryVoltage is not. But it's possible that different stacks also handle reporting on it.

ginkel commented 1 year ago

Interesting. I have a couple of ZigBee devices that report the battery voltage, so I'll see if I can get this working.

ginkel commented 1 year ago

I kinda like the one in our repo because it gives a sense of scale with the coin and also shows the battery clip on the back. Unless you feel strongly about it, I'd vote for that one.

I think we need a photo with a white background, at least that's what is usually requested when adding a new device.

rbaron commented 1 year ago

@ginkel Sounds good, if that's a requirement please feel free to use the one you took. Thanks for pushing this forward.

ginkel commented 1 year ago

The PR has been merged, I expect the support to be part of the next zigbee2mqtt release.

rbaron commented 1 year ago

That's great, thanks once again @ginkel.