arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.09k stars 4.79k forks source link

Sonoff ZbBridgePro not working with ZHA Home Assistant #20922

Closed tzago closed 7 months ago

tzago commented 7 months ago

PROBLEM DESCRIPTION

A clear and concise description of what the problem is. Sonoff ZbBridgePro not working with ZHA Home Assistant Latest version deployed in my Sonoff ZigbeePro is Tasmota 13.4.0(zbbrdgpro) by Theo Arends Installed from Web Installer

Following the instructions from here to connect my ZHA to my Sonoff Tasmoted to 13.4.0(zbbrdgpro) by Theo Arends https://zigbee.blakadder.com/Sonoff_ZBBridge-P.html

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  Configuration output here:

#Console run: Backlog Template; Module; GPIO 255
05:12:41.927 RSL: RESULT = {"NAME":"TCP ZBBridge Pro","GPIO":[0,0,576,0,480,0,0,0,0,1,1,5792,0,0,0,5472,0,320,5793,5504,0,640,608,32,0,0,0,0,0,1,0,0,0,0,0,0],"FLAG":0,"BASE":1}
05:12:42.152 RSL: RESULT = {"Module":{"0":"TCP ZBBridge Pro"}}
05:12:42.409 RSL: RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"0":"None"},"GPIO2":{"576":"LedLink_i"},"GPIO3":{"0":"None"},"GPIO4":{"480":"Buzzer"},"GPIO5":{"0":"None"},"GPIO6":{"0":"None"},"GPIO7":{"0":"None"},"GPIO8":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO11":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"5792":"Zigbee Rst1"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"},"GPIO18":{"0":"None"},"GPIO19":{"5472":"TCP Tx"},"GPIO20":{"0":"None"},"GPIO21":{"320":"Led_i1"},"GPIO22":{"5793":"Zigbee Rst2"},"GPIO23":{"5504":"TCP Rx"},"GPIO24":{"0":"None"},"GPIO25":{"640":"I2C SDA1"},"GPIO26":{"608":"I2C SCL1"},"GPIO27":{"32":"Button1"},"GPIO32":{"0":"None"},"GPIO33":{"0":"None"},"GPIO34":{"0":"None"},"GPIO35":{"0":"None"},"GPIO36":{"0":"None"},"GPIO37":{"0":"None"},"GPIO38":{"0":"None"},"GPIO39":{"0":"None"}}

#Information button
TCP ZBBridge Pro
Tasmota
Program Version 13.4.0(zbbrdgpro)
Build Date & Time   2024-02-14T16:17:21
Core/SDK Version    2_0_14/4.4.6.240105
Uptime  0T12:04:46
Flash Write Count   16
Boot Count  6
Restart Reason  Software reset CPU
AP1 Information SSId TMO555
RSSI 100%, -43 dBm
Mode 11n
Channel 6
BSSId 75:55:44:13:CC:DD
Hostname    tasmota-2D6E2C-3628
IPv6 Local (WiFi)   fe80::a3d:55dd:fe5c:3d5f%st1
MAC Address 0C:8B:95:2D:6E:2C
IP Address (WiFi)   192.168.0.5
Gateway 192.168.0.1
Subnet Mask 255.255.255.0
DNS Server1 192.168.0.1
DNS Server2 0.0.0.0
HTTP API    Enabled
MQTT Host   
MQTT Port   1883
MQTT TLS    Disabled
MQTT User   DVES_USER
MQTT Client DVES_2D6E2C
MQTT Topic  tasmota_%06X
MQTT Group Topic 1  cmnd/tasmotas/
MQTT Full Topic cmnd/tasmota_2D6E2C/
MQTT Fallback Topic cmnd/DVES_2D6E2C_fb/
MQTT No Retain  Disabled
Emulation   None
ESP Chip Id 2977324 (ESP32-D0WD-V3 v3.0)
Flash Chip Id   0x16405E (DIO)
Flash Size  4096 KB
Program Flash Size  4096 KB
Program Size    1477 KB
Free Program Space  378 KB
Free Memory 153.6 KB (frag. 28%)
Partition safeboot  832 KB (used 93%)
Partition app0* 1856 KB (used 79%)
Partition fs    1344 KB
- [ ] Provide the output of this command: `Status 0`:
```lua
  STATUS 0 output here:

00:00:00.003 HDW: ESP32-D0WD-V3 v3.0 00:00:00.095 UFS: FlashFS mounted with 908 kB free 00:00:00.113 CFG: Loaded from File, Count 13 00:00:00.115 FRC: Some settings have been reset (2) 00:00:00.120 I2C: Bus1 using GPIO26(SCL) and GPIO25(SDA) 00:00:00.204 BRY: Berry initialized, RAM used 4019 bytes 00:00:00.251 Project tasmota - Tasmota Version 13.4.0(zbbrdgpro)-2_0_14(2024-02-14T16:17:21) 00:00:02.000 WIF: Connecting to AP1 TMO555 Channel 6 BSSId 25:55:99:24:FF:01 in mode 11n as tasmota-2D6E2C-3628... 00:00:03.587 WIF: Connected 00:00:03.895 HTP: Web server active on tasmota-2D6E2C-3628 with IP address 192.168.0.5 16:57:08.100 RSL: INFO1 = {"Info1":{"Module":"Sonoff Zigbee Pro","Version":"13.4.0(zbbrdgpro)","FallbackTopic":"cmnd/DVES_2D6E2C_fb/","GroupTopic":"cmnd/tasmotas/"}} 16:57:08.116 RSL: INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-2D6E2C-3628","IPAddress":"192.168.0.5","IP6Global":"","IP6Local":"fe80::a3d:55dd:fe5c:3d5f%st1"}} 16:57:08.130 RSL: INFO3 = {"Info3":{"RestartReason":"Software reset CPU","BootCount":5}} 16:57:08.153 RUL: SYSTEM#BOOT performs "TCPStart 8888" 16:57:08.159 RSL: RESULT = {"Command":"Unknown"} 16:57:10.907 QPC: Reset 16:57:12.906 RSL: STATE = {"Time":"2024-03-10T16:57:12","Uptime":"0T00:00:08","UptimeSec":8,"Heap":160,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"Berry":{"HeapUsed":3,"Objects":38},"Wifi":{"AP":1,"SSId":"TMO555","BSSId":"75:55:44:13:CC:DD","Channel":6,"Mode":"11n","RSSI":100,"Signal":-40,"LinkCount":1,"Downtime":"0T00:00:03"}} 16:57:18.651 ZIG: rebooting ZNP device 16:57:20.701 ZbInput discarding byte 00 16:57:20.704 RSL: RESULT = {"ZbState":{"Status":1,"Message":"CCxxxx ZNP booted","RestartReason":"Power-up","MajorRel":2,"MinorRel":7}} 16:57:20.903 RSL: RESULT = {"ZbState":{"Status":50,"MajorRel":2,"MinorRel":7,"MaintRel":19,"Revision":0}} 16:57:21.053 RSL: RESULT = {"ZbState":{"Status":2,"Message":"Resetting configuration"}} 16:57:23.601 ZbInput discarding byte 00 16:57:24.153 RSL: RESULT = {"ZbState":{"Status":99,"Message":"Abort"}} 16:57:24.157 ZIG: Abort 16:57:24.158 ZIG: Stopping (99) 16:58:15.178 TCP: Got connection from 192.168.0.9 16:58:28.954 TCP: Got connection from 192.168.0.9

TCP ZBBridge Pro TCP auto configured...

Console

00:00:00.003 HDW: ESP32-D0WD-V3 v3.0 00:00:00.071 UFS: FlashFS mounted with 908 kB free 00:00:00.085 CFG: Loaded from File, Count 15 00:00:00.087 FRC: Some settings have been reset (2) 00:00:00.093 I2C: Bus1 using GPIO26(SCL) and GPIO25(SDA) 00:00:00.160 BRY: Berry initialized, RAM used 4023 bytes 00:00:00.197 Project tasmota - Tasmota Version 13.4.0(zbbrdgpro)-2_0_14(2024-02-14T16:17:21) 00:00:02.001 WIF: Connecting to AP1 TMO555 Channel 6 BSSId 75:55:44:13:CC:DD in mode 11n as tasmota-2D6E2C-3628... 00:00:03.694 WIF: Connected 00:00:03.902 HTP: Web server active on tasmota-2D6E2C-3628 with IP address 192.168.0.5 17:01:54.155 RSL: INFO1 = {"Info1":{"Module":"TCP ZBBridge Pro","Version":"13.4.0(zbbrdgpro)","FallbackTopic":"cmnd/DVES_2D6E2C_fb/","GroupTopic":"cmnd/tasmotas/"}} 17:01:54.171 RSL: INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-2D6E2C-3628","IPAddress":"192.168.0.5","IP6Global":"","IP6Local":"fe80::a3d:55dd:fe5c:3d5f%st1"}} 17:01:54.185 RSL: INFO3 = {"Info3":{"RestartReason":"Software reset CPU","BootCount":6}} 17:01:54.207 RUL: SYSTEM#BOOT performs "TCPStart 8888" 17:01:54.210 TCP: Starting TCP server on port 8888 17:01:54.213 RSL: RESULT = {"TCPStart":"Done"} 17:01:56.911 QPC: Reset 17:01:58.910 RSL: STATE = {"Time":"2024-03-10T17:01:58","Uptime":"0T00:00:08","UptimeSec":8,"Heap":161,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"Berry":{"HeapUsed":3,"Objects":45},"Wifi":{"AP":1,"SSId":"TMO555","BSSId":"75:55:44:13:CC:DD","Channel":6,"Mode":"11n","RSSI":100,"Signal":-36,"LinkCount":1,"Downtime":"0T00:00:03"}} 17:02:43.225 TCP: Got connection from 192.168.0.9 17:02:43.988 TCP: Got connection from 192.168.0.9

Checking ZHA logs I can see.

File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 359, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 401, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 502, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 382, in async_step_form_initial_network return await self.async_step_form_new_network(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 388, in async_step_form_new_network await self._radio_mgr.async_form_network() File "/usr/src/homeassistant/homeassistant/components/zha/radio_manager.py", line 276, in async_form_network await app.form_network() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 366, in form_network await self.start_network() File "/usr/local/lib/python3.12/site-packages/zigpy_znp/zigbee/application.py", line 177, in start_network await self.load_network_info() File "/usr/local/lib/python3.12/site-packages/zigpy_znp/zigbee/application.py", line 144, in load_network_info await self._znp.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_znp/api.py", line 238, in load_network_info await self._load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_znp/api.py", line 142, in _load_network_info key_desc = await self.nvram.osal_read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy_znp/nvram.py", line 191, in osal_read raise SecurityError( zigpy_znp.exceptions.SecurityError: NV item cannot be read due to security constraints: <OsalNvIds.NWK_ACTIVE_KEY_INFO: 58>



### TO REPRODUCE
_Steps to reproduce the behavior:_
Latest version deployed in my Sonoff ZigbeePro is Tasmota 13.4.0(zbbrdgpro) by Theo Arends Installed from Web Installer
and tried to integrate with my ZHA using  https://zigbee.blakadder.com/Sonoff_ZBBridge-P.html as a reference

### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._
ZHA integrated with my Sonoff ZigbeePro is Tasmota 

### SCREENSHOTS
_If applicable, add screenshots to help explain your problem._

### ADDITIONAL CONTEXT
_Add any other context about the problem here._

**(Please, remember to close the issue when the problem has been addressed)**
s-hadinger commented 7 months ago

From what I can see, the TCP connection works. Use Weblog 4 to see the actual traffic going through TCP.

The rest should be asked in ZHA forum. In this scenario Tasmota just passes opaque bytes between ZHA and the MCU