Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.72k stars 1.64k forks source link

Sonoff ZigBee Bridge #4544

Closed akumamg closed 3 years ago

akumamg commented 3 years ago

Will there be support for Sonoff ZigBee Bridge in the future ?

Koenkk commented 3 years ago

Currently there are no plans, but if anybody is interested in implementing this I can give some support.

LudoOne commented 3 years ago

I have one! Also a TRV (TS0601) like in issue#3821. What do I have to do to replace the serial connection for a IP socket (socket://[IP]:8888)?

Johndolk commented 3 years ago

Currently there are no plans, but if anybody is interested in implementing this I can give some support.

I am really interessted in implementing this - But how to? :)

akumamg commented 3 years ago

Its simple, Write code

Westcott1 commented 3 years ago

I hope that Koenkk doesn't delete me for posting this, but I flashed my ZBbridge with T_smo_a, and wrote some Node.js to process the resulting MQTT.

LudoOne commented 3 years ago

I tried both: socat: slave: tcp:192.168.1.107:8888,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5 as https://www.zigbee2mqtt.io/how_tos/how_to_connect_to_a_remote_adapter.html#3-configure: serial: port: 'tcp://192.168.1.107:8888' But resulted in: Zigbee2MQTT:error 2020-11-08 01:42:28: Error while starting zigbee-herdsman Zigbee2MQTT:error 2020-11-08 01:42:28: Failed to start zigbee Zigbee2MQTT:error 2020-11-08 01:42:28: Exiting... Zigbee2MQTT:error 2020-11-08 01:42:28: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms) at ZStackAdapter.<anonymous> (/zigbee2mqtt-1.16.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:94:31) at Generator.throw (<anonymous>) at rejected (/zigbee2mqtt-1.16.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:25:65) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zigbee2mqtt@1.16.1 start:node index.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zigbee2mqtt@1.16.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-11-08T00_42_28_346Z-debug.log 2020-11-08T01:42:29: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT] 2020-11-08T01:42:29: PM2 log: App [npm:0] starting in -fork mode- 2020-11-08T01:42:29: PM2 log: App [npm:0] online

zigbee2mqtt@1.16.1 start /zigbee2mqtt-1.16.1 node index.js`

CJMarais commented 3 years ago

I hope that Koenkk doesn't delete me for posting this, but I flashed my ZBbridge with T_smo_a, and wrote some Node.js to process the resulting MQTT.

Can you share more of what you did?

Westcott1 commented 3 years ago

Hi CJMarias, You are welcome to what I've done so far. It's an add-on to more Node.js that I wrote to interface between Domoticz and Z2M A config file holds the idx of any Domoticz devices that can be updated from incoming MQTT. The ZBbridge is a coordinator for a separate ZigBee network. It also reads from a Sonoff 433 bridge, also flashed with T-sm-ta.

tyjtyj commented 3 years ago

after my cc2531 keep dropping device, i got sonoff zigbee. Its disappointed to learn it is not supported by z2m. anyone start working on this? The problem is i dont know where to start.

MattWestb commented 3 years ago

@tyjtyj I 110% agree with you but for the moment its looks like 3 or 4 devs have starting and doing little but not so much for getting it released in public. What i have understanding is EZSP mutch "low level" command that is making mutch work for implanting it but is very powerful and flexible. The sonoff is working good with tasmota zigbee bridge but is little limited in functionality but OK for small system with sensors (Was implanted of one dev in some months from scratch !!). ZHA devs have updating the code in the summer with around 20K lines for implanting the new EZSP protocol and is working well and is stabile and is have good support for real zigbee 3 devices. Its with Rasp/CornBee the most powerful coordinator on the market and much better then first and second gen TI:s. I hope that some devs is going together and getting it working on the Z2M (java)train.

lotohov commented 3 years ago

there is another firmware for esp. https://www.zigbee2mqtt.io/information/connecting_cc2530.html it migt work ?

github-actions[bot] commented 3 years ago

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

akumamg commented 3 years ago

Any news about this ?

LudoOne commented 3 years ago

Did you write code?

On Tue, Dec 29, 2020, 22:12 akumamg notifications@github.com wrote:

Any news about this ?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/4544#issuecomment-752242551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEG4FTWEX2VJ35LHP72LIXDSXJA5PANCNFSM4SCXN4ZQ .

svrooij commented 3 years ago

If it just has a tcp socket and you want to connect zigbee2mqtt without changing code you can checkout this answer. You have socat it’s an app that lets you configure a local virtual serial port that just connects to a tcp socket.

then you can connect zigbee2mqtt to /dev/virtualcom0 which it actually socat that connects to a tcp socket. Changing this inside zigbee2mqtt will require refactoring actual communication to the serial port, but should be doable.

tyjtyj commented 3 years ago

If it just has a tcp socket and you want to connect zigbee2mqtt without changing code you can checkout this answer. You have socat it’s an app that lets you configure a local virtual serial port that just connects to a tcp socket.

then you can connect zigbee2mqtt to /dev/virtualcom0 which it actually socat that connects to a tcp socket. Changing this inside zigbee2mqtt will require refactoring actual communication to the serial port, but should be doable.

EZSP not supported by z2m yet. So connecting via tcp has not use as the z2m does not speak EZSP language.

github-actions[bot] commented 3 years ago

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

anubisg1 commented 3 years ago

This is extremely important for me too, has there been any update? This hub is very powerful and using zigbee2mqtt would really simplify a lot of things... Please make it happen

svrooij commented 3 years ago

@anubisg1 this is an opensource project. A lot of work needs to be done before this will happen. Since this issue is already closed (because it was getting old) I would not get your hopes up. Sponsoring Coen €1000 might draw some attention to this topic.

anubisg1 commented 3 years ago

@anubisg1 this is an opensource project. A lot of work needs to be done before this will happen. Since this issue is already closed (because it was getting old) I would not get your hopes up. Sponsoring Coen €1000 might draw some attention to this topic.

Thanks for the reply... I understand what you say but I think you added an extra 0 without noticing... Probably a typo

svrooij commented 3 years ago

I was just send a on first look high amount, but people have no idea how much it would cost to get this build.

The device you're talking about probably needs custom firmware to enable some sort of tcp socket where zigbee2mqtt could talk to.

I cannot check the wallet of Koen or the other contributors, so I don't know what it would take to get attention to this issue.

Maybe ask on discord or start investing the device yourself.

Personally I really like the zig-a-zag (zzh) usb stick, it works perfectly with a raspberry (that is needed anyway), and would thus not invest any time in building support for a new coordinator

shyney7 commented 3 years ago

+1 for implementing support for the sonoff zb bridge

gabeale commented 3 years ago

Hi guys, it would be nice to get Z2M working also on Silicon Labs based chips (e.g. Sonoff Zigbee bridge) that are as powerful as Texas Instruments ones (e.g. CC253x) or even more. I know that this is costing a big effort for developers and that a great job has already been done till date. I'm available to give my contribution for sponsoring this. Thx to all! ;-)

kirovilya commented 3 years ago

Guys i'm trying to do this... https://github.com/Koenkk/zigbee-herdsman/pull/317

gasecki commented 3 years ago

I would love to see it working one day! So of bridges works fine. Only missing the way to get more out of it for automation.

Hedda commented 3 years ago

FYI; a tip is to first follow these step-by-step instructions on how to flash Zigbee chip with ncp-uart-sw_6.7.8_115200.ota firmware:

https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html

Only after once managed to successfully flashed the ncp-uart-sw_6.7.8_115200.ota to the Zigbee chip should you attemt to follow:

https://www.digiblur.com/2021/03/zigbee2mqtt-with-sonoff-zigbee-bridge.html

Seams that many miss that they also need to flash the Zigbee chip or read other docs that refer to older or withdrawn versions:

https://github.com/arendst/Tasmota/tree/development/tools/fw_SonoffZigbeeBridge_ezsp

Today it is only 6.7.8 that is the recommended version however 6.7.9 version should also work (but not any older or newer).

Note! EZSP support is still in a very experimental phase so you should really post your feedback here -> https://github.com/Koenkk/zigbee-herdsman/issues/319

I am not sure if developer(s) is currently actively working on improving or maintaining that experimental support(?).

Only clear tips is to try upgrade EmberZNet NCP UART EZSP firmware Zigbee firmware version 6.7.9 or later and test dev branch (a.k.a. Edge):

https://github.com/arendst/Tasmota/tree/development/tools/fw_SonoffZigbeeBridge_ezsp

https://github.com/Koenkk/zigbee2mqtt/tree/dev

There looks to be some ezsp related fixes in the zigbee-herdsman dependency that might have not yet made it into Z2M dev/edge yet:

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

Regardless you still want to direct most if not all feedback and issues to subscribers of the WIP discussion in the zigbee-herdsman repo:

https://github.com/Koenkk/zigbee-herdsman/issues/319

Also, please take note that WiFi based Zigbee bridges like ITead Sonoff ZBBridge are generally not recommended with the EZSP protocol. See the warnings about it:

https://www.zigbee2mqtt.io/guide/adapters/#notes

WiFi-based Serial-to-IP bridges are not recommended for Silicon Labs EZSP adapters as the serial protocol does not have enough fault-tolerance to handle packet loss or latency delays that can normally occur over WiFi connections. If cannot use a locally connected USB or UART/GPIO adapter then the recommendation is to use remote adapter that connected via Ethernet (wired) to avoid issues with EZSP caused by WiFi connections.

https://www.zigbee2mqtt.io/advanced/remote-adapter/connect_to_a_remote_adapter.html

WiFi-based Serial-to-IP bridges are not recommended for Silicon Labs EZSP adapters as the serial protocol does not have enough fault-tolerance to handle packet loss or latency delays that can normally occur over WiFi connections.

More warning about Zigbee to WiFi bridges for EZSP is not recommended for production as it does not do well with packed loss:

https://github.com/zigpy/bellows#warning-about-zigbee-to-wifi-bridges

https://www.home-assistant.io/integrations/zha/#warning-about-wi-fi-based-zigbee-to-serial-bridgesgateways

FYI, I also understand that the EFR32 board antenna design of the "SM-011 V1.0" Zigbee module used inside ITead's Sonoff ZBBridge have very high receive sensitivity to electromagnetic interference (EMI) / radio-frequency interference. This means that it will be extra important to keep it away from any other electronic devices or appliances that may generate an electromagnetic field (EM Field) or send our interfering radio signals. That includes the computer that you run your home automation application software on as well as any devices such as for example external harddrives or storage devices, power-supplies, etc., and of course any Wi-Fi access points or routers nearby.

Note! The new ITead Zigbee 3.0 USB Dongle Model: 9888010100045 (Hardware Revision Version 1.3) circuit board share the same type of antenna design so its radio is as well extremely sensitive to signal interference on its receiving end. The current recommendation for using it is to connect it via a long USB extension cable and try to move it as far away from all electronics and other possible sources of signal interference.

PS: Another general tip that always applies when building a Zigbee network is to begin by adding a few good mains-powered Zigbee router devices so that they will make use a stable baseline. Many start by buying three "IKEA TRADFRI Signal Repeater" (E1746).

https://zigbee.blakadder.com/Ikea_E1746.html

https://www.ikea.com/us/en/p/tradfri-signal-repeater-30400407/

https://www.ikea.com/gb/en/p/tradfri-signal-repeater-80424255/

https://www.ikea.com/se/sv/p/tradfri-signalfoerstaerkare-10400408/