Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConBee implementation #72

Closed
ChrisHae opened this issue Oct 15, 2019 · 546 comments
Closed

ConBee implementation #72

ChrisHae opened this issue Oct 15, 2019 · 546 comments
Labels

Comments

@ChrisHae
Copy link
Collaborator

Hello, I have noticed you started on implementation of the conbee adapter. I am from dresden elektronik and we'd like to help with the implementation. What do you think is the best way to synchronize the workflow?

We could contribute the code for the following tasks, to start with:

  • CRC calculation
  • SLIP frame builder
  • Query and set Zigbee parameters

... in the files driver.ts and conbeeAdapter.ts.

Furthermore if you need any documentation or hardware to proceed just drop me a line. E.g. a ConBee II stick or the deCONZ serial line protocol documentation.

Note that this adapter not only work with the ConBee USB stick but also with the RaspBee Zigbee module for Raspberry Pi, because they share the same serial protocol. A more generic adapter name, like phoscon or deconz adapter, might be more fitting.

@Koenkk
Copy link
Owner

Koenkk commented Oct 15, 2019

Hi!

Could you perhaps contact me on telegram (@Koenkk)?

Koenkk added a commit that referenced this issue Oct 16, 2019
Koenkk added a commit that referenced this issue Oct 16, 2019
Koenkk added a commit that referenced this issue Oct 16, 2019
Koenkk added a commit that referenced this issue Oct 16, 2019
@Koenkk
Copy link
Owner

Koenkk commented Oct 16, 2019

I did some updates

  • Renamed conbee to deconz
  • zigbee-herdsman will automatically activate the deconz adapter when it detects one
    • Path auto detection is also support, for zigbee2mqtt just set
serial:
  port: null

Koenkk added a commit that referenced this issue Oct 16, 2019
@felixstorm
Copy link
Contributor

@Koenkk Is Conbee 2 support considered to be working as of now?

I am currently pretty displeased with the CC2531 in my environment using HA 1.2 firmware (unable to pair more than 20 routing devices (ubisys), loosing devices from time to time and ended up splitting my network, also tried source routing variant, but that seemed to make it even worse). And since the Zigbee side used to work fine and appeared to be very stable with deCONZ and a Conbee (1) for about 1 year before switching to zigbee2mqtt (besides incomplete support for the ubisys window covering devices 😉), being able to use a Conbee (2) might be another option for me to try...

Thanks,
Felix

@Koenkk
Copy link
Owner

Koenkk commented Oct 30, 2019

@felixstorm no it's not supported yet, you might want to give the CC2652R a try though Koenkk/zigbee2mqtt#1429 (which is fully supported in latest dev).

@felixstorm
Copy link
Contributor

@Koenkk Thanks, the CC2652R would also have been my next option - I will order one from TI and try it. The ConBee (1) was really stable in the past and the CC2652R is pretty new, that was the only reason for preference 😉.

@felixstorm
Copy link
Contributor

@felixstorm no it's not supported yet, you might want to give the CC2652R a try though Koenkk/zigbee2mqtt#1429 (which is fully supported in latest dev).

Just fyi for anybody following - I switched to the CC2652R and it has been working flawlessly for a few weeks now.

@BuhtigithuB
Copy link

Should this one be closed if Conbee/deconz is supported now as suggested by your answer... Sorry I have been and out of domotic and try to make progress on free time so I have been poking you on this topic here and there, sorry about that... Difficult to keep up will all the fork redirect I fall on and understand where the train is going exactly... :D

@osos
Copy link

osos commented Jan 21, 2020

Any news, expected timeline ?

Looking forward to test this out

@asdftemp
Copy link

asdftemp commented Feb 22, 2020

u/potedesballj posted this on Reddit

@Hedda
Copy link
Contributor

Hedda commented Mar 3, 2020

New reddit post says that Dresden Elektronik estimated that support will be ready mid-March 2020

https://www.reddit.com/r/homeassistant/comments/f8v81p/conbee_2_support_for_zigbee2mqtt_confirmed/

https://imgur.com/a/Tda0JJO

I wonder if this will only work with the newer ConBee II (ConBee 2) adapter or if it will also work with the older first-generation ConBee and RaspBee adapters as well?

I know that both the new and the old ConBee adapters support the same serial UART protocol: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/158

@manup
Copy link

manup commented Mar 3, 2020

It should work with ConBee I / II and RaspBee I / II since the protocol for all is the same. The difference is the device path:

  • ConBee I /dev/ttyUSBx
  • ConBee II /dev/ttyACMx
  • RaspBee I / II /dev/ttyAMA0 or /dev/ttyS0

@cheak1974
Copy link

Is this also working on windows? I have a conbee II plugged into my windows PC which I use for testing. It is connected as COM3 in device manager. How can I use it with zigbee2mqtt?

@arjankanis
Copy link

Is it possible to test the Conbee build using the deconz branch?

ChrisHae added a commit that referenced this issue Mar 12, 2020
* Start on conbee

* Updates.

* conbee -> deconz. #72

* Initial suppport for reading parameters

- Add basic frame parser
- Handle slip protocol and crc calculation
- Add queue for read and write parameters

* Add dummy function DeconzAdapter.supportsLED()

* Start working on write parameters

* supportsLED() returns false

* Implemented getCoordinator()

* Added deCONZ adapter dummy functions

* Implemented getCoordinatorVersion()

* Implemented getNetworkParameters()

* Added constants for APS layer

* Startet APS layer

Added readReceivedStateRequest, deviceStateRequest, deviceStateResponse,
readReceivedDataRequest

* Added APS layer parser functions

parseDeviceStateResponse, parseReadReceivedDataResponse, parseReceivedDataNotification,

* Added parser for APS responses

* Refactored some deCONZ adapter functions

* Added sendZclFrameNetworkAddress, sendZclFrameNetworkAddressWithResponse and sendZclFrameGroup

* Added constants for deCONZ adapter

* Added deCONZ driver functions for sending APS commands

* Added discoverRoute, supportsDiscoverRoute dummy functions

* Implemented NodeDescriptor

* Added constants

* Reworked debug messages and fixed send unnecessary device state requests

* Some smal fixes

* Implemented permit join

* Fixed check DeviceStatus variables

* implemented Active Endpoint request

* Implemented simple descriptor

* Removed reading request_id if data confirm fail

* Fixed reading payload of data indication

* Fix nodedescriptor devicetype

* Added waitFor dummy function

* Implemented lqi()

* Implemented routingTable()

* implemented bind()

* implmented unbind()

* Implemented removeDevice()

* Changes at driver.ts

* Fix for resolve aps request error

* ieeeAddr to String now add '0x' prefix

* Get correct APS data payload

* Fixes for some adapter functions

* Delete old code

* Added constant

* Added support of timeout for aps requests

* Refactored deCONZ adapter functions

* Added constants

* Refactored driver functions and debug logs

* Refactored frameparser debug logs

* Updated deCONZ adapter to newest adapter version

* Added device state intervall wand tweaked watchdog

* Removed unused code

* Removed unused code

* Added received msg event, removed discoverRoute

* Added catch for devicestaterequest

* Handle default response when sending zcl message

* Refactored debug print

* Added /* istanbul ignore file */

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
@Koenkk
Copy link
Owner

Koenkk commented Mar 14, 2020

This has now been integrated and is available in the latest zigbee2mqtt dev branch. Many thanks @ChrisHae !

Keep in mind that this is not ready for production yet.

It seems to start fine but unfortunately I couldn't pair any devices, nothing appeared in the log after resetting a device (tried with some Xiaomi plugs, sensors and an Innr bulb), log: https://pastebin.com/gBLANJHn

@ChrisHae
Copy link
Collaborator Author

I will update this over time and try to eliminate bugs, improve performance and add features.
Please note that interPAN functions likte touchlink are not implemented yet.
Right now I investigate why no devices are joining any more. This already worked but now I no longer receive any deviceAnnounce events when a device is powered on or was reset.

@ChrisHae
Copy link
Collaborator Author

@Koenkk It seems devices not joining is a fw problem. Please try FW version deCONZ_ConBeeII_0x264a0700.bin
http://deconz.dresden-elektronik.de/deconz-firmware/

@manup
Copy link

manup commented Mar 16, 2020

Another thing to improve USB startup was found today by disabling Linux MTP probes and Network Manager messing with serial interface. This might be useful for the CC2531 too.

Source: dresden-elektronik/deconz-rest-plugin#2419 (comment)

MTP probes and Network Manager access for ConBee II can be disabled by following udev rules:

cat /etc/udev/rules.d/69-conbee.rules

# ConBee II disbale modem manager and mtp probing
ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", ENV{MTP_NO_PROBE}="1"

After creating this file the udev rules needs to be reloaded:

sudo udevadm control --reload-rules

The difference should be visible in journald when plugging the USB dongle:

sudo journald -xb -f

@bwolleb
Copy link

bwolleb commented Mar 17, 2020

@ChrisHae Thank you for your work on the ConBeeII support. I have a ConBeeII stick an I plan to use it with zigbee2mqtt. As mentioned, it starts correctly now on the dev branch but no device can join. Flashing the 0x264a0700 firmware didn't help for me.

@ChrisHae
Copy link
Collaborator Author

I uploaded a fix to this problem to the deconz branch. In addition to the zdp permit join request there is now also a write parameter request that sets the permit join parameter. I created a pull request for the master branch. Then you can test if it works.

@Pasha1402
Copy link

@johras, unlikely you'll find many people who use Symphonisk to give you an opinion. Both Symphonisk and MI Aqara cube (in rotation) are quite weird zigbee devices as zigbee is not designed to handle multiple same messages to produce steps rotation. Zigbee made to guaranty delivery, not sequence nor low latency... you are quite lucky if it works well for you with CC2652RB. If you need a dimmer, better look for something transferring value instead of "pulse". Ideal example is Google Assistance - "Hey google, set brightness to 83" - works 100 of 100 attempts regardless.

@amaciuc
Copy link

amaciuc commented Oct 15, 2021

Guys, how have you updated the firmware on ConBee II? What is the stable way to do that?

@haumacher
Copy link

@amaciuc I followed the guide at https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually this worked flawlessly:

ConBee
sudo GCFFlasher_internal -t 60 -d 0 -f deCONZ_ConBeeII_0x26680700.bin.GCF

You need to install the deconz package which provides the GCFFlasher_internal tool.

@sim-maz
Copy link

sim-maz commented Oct 20, 2021

So what is the situation with the implementation? Is it stable? Does not seem like it is anymore in development.

@rocket59
Copy link

Mine works perfectly and has been rock solid. @ChrisHae does get involved if you have a potential bug otherwise not sure what other development is required?

@Pasha1402
Copy link

The only problem with Conbee II is LQI doesn't work for 99% of users... fix require coordination between Z2M and deCONZ which has never happened. Otherwise there is nothing to fix: mine works "in prod" for more than year with zero issues, cannot say that for my failed CC2652P experiment.

@amaciuc
Copy link

amaciuc commented Oct 20, 2021

It is working without any problem for me too.
But why is still under experimental in Z2M? Link
image

There are other implementations to be made?

@Pasha1402
Copy link

Rather not. Experimental means "buggy - we don't like it" :)

@rocket59
Copy link

The only problem with Conbee II is LQI doesn't work for 99% of users... fix require coordination between Z2M and deCONZ which has never happened. .

Mine seems to be report close to 255 for most devices close by. There's one about 210 but that's the furthest out. So all appears to be ok for me in any case.

@sim-maz
Copy link

sim-maz commented Oct 23, 2021

Well I've tried z2m with my Conbee II on HA and despite following all instructions (setting up mosquitto, changing to the correct path /dev/ttyACM0) it still gives me errors:

`[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] socat.sh: executing...
[13:14:56] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing...
[13:14:57] INFO: MQTT available, fetching server detail ...
[13:14:57] INFO: MQTT server settings not configured, trying to auto-discovering ...
[13:14:58] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[13:14:58] INFO: Previous config file found, checking backup
[13:14:58] INFO: Creating backup config in '/config/zigbee2mqtt/.configuration.yaml.bk'
[13:14:58] INFO: Adjusting Zigbee2mqtt core yaml config with add-on quirks ...
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:14:59] INFO: Handing over control to Zigbee2mqtt Core ...

zigbee2mqtt@1.21.2 start
node index.js
Zigbee2MQTT:error 2021-10-23 13:15:27: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-10-23 13:15:28: Failed to start zigbee
Zigbee2MQTT:error 2021-10-23 13:15:28: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-10-23 13:15:28: Exiting...
Zigbee2MQTT:error 2021-10-23 13:15:28: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
at Zigbee.start (/app/lib/zigbee.ts:63:27)
at Controller.start (/app/lib/controller.js:116:27)
at start (/app/index.js:95:5)
[13:15:29] INFO: Handing over control to Zigbee2mqtt Core ...
zigbee2mqtt@1.21.2 start
node index.js
Zigbee2MQTT:error 2021-10-23 13:15:56: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-10-23 13:15:56: Failed to start zigbee
Zigbee2MQTT:error 2021-10-23 13:15:56: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-10-23 13:15:56: Exiting...
Zigbee2MQTT:error 2021-10-23 13:15:56: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
at Zigbee.start (/app/lib/zigbee.ts:63:27)
at Controller.start (/app/lib/controller.js:116:27)
at start (/app/index.js:95:5)
[13:15:56] INFO: Handing over control to Zigbee2mqtt Core ...
zigbee2mqtt@1.21.2 start
node index.js`

I read through https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start but nothing helped.

@mamrai1
Copy link

mamrai1 commented Oct 23, 2021

serial:
port: /dev/ttyACM0
adapter: deconz

@disaster123
Copy link

i've some problems regarding reachability i get random timeouts in iobroker. Even for devices just 5m away and nothing in between while using the latest deconz firmware for conbee II. While older Firmware like 0x26680700 seems to work fine.

@ChrisHae @manup @Smanar can we expect any updates from dresden electronic for newer firmwares?

@sim-maz
Copy link

sim-maz commented Oct 24, 2021 via email

@kwetnico
Copy link

finished I do not update everything works perfectly with the firmware: deCONZ_ConBeeII_0x26680700.bin
image

@Pasha1402
Copy link

@kwetnico: Only for you my friend! only for you :)

Same firmware, and map works as it uses another attribute, the one collected during map request
Screenshot 2021-10-24 at 14 06 23

And on the list of devices it always 255 as this one built based on info from latest packet received a Conbee II sends something odd

Screenshot 2021-10-24 at 14 06 56

@kwetnico
Copy link

Ok but for me no problem :
image

@samip5
Copy link

samip5 commented Oct 25, 2021

I don't know if this should be posted under this, but why do I get for TouchLink scan that it's not supported? It should be according to deCONZ rest api at least.

Using RaspBee 2.

Zigbee2MQTT:info  2021-10-25 16:14:02: Start Touchlink scan
Zigbee2MQTT:error 2021-10-25 16:14:02: Request 'zigbee2mqtt/bridge/request/touchlink/scan' failed with error: 'not supported'
Zigbee2MQTT:info  2021-10-25 16:14:02: MQTT publish: topic 'zigbee2mqtt/bridge/response/touchlink/scan', payload '{"data":{},"error":"not supported","status":"error","transaction":"1d13k-7"}

@MattWestb
Copy link

Some brave zigpy user (devs of jeedom) have making one future request for it dresden-elektronik/deconz-rest-plugin#3485 and is have being moved to there forum https://forum.phoscon.de/t/feature-request-touchlink-support-on-conbee-ii/340.
Then RaspBee II and CorBee II is using the same firmware base so very likely both is getting it then / if is being implanted.
If you is one lucky one with RaspBee I or CornBee I its already is in the firmware :-))

Pleas posting more in the request issue and perhaps DE is implanting it so its not being one half product comparing with the first gens.

@samip5
Copy link

samip5 commented Oct 25, 2021

So Dimmer Switch it is... :/

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale label Nov 25, 2021
@malloy139
Copy link

Any news regarding LQI?

@Pasha1402
Copy link

Nope

@github-actions github-actions bot removed the stale label Dec 1, 2021
@amaciuc
Copy link

amaciuc commented Dec 1, 2021

Any news regarding LQI?

Do not use the latest firmware

@amaciuc
Copy link

amaciuc commented Dec 1, 2021

Any news regarding LQI?

Do not use the latest firmware

I use this version of firmware 0x26690700 without any problem

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests