New custom component : ZiGate


#324

Hi
Try address: c2cb01
(Need endpoint)


#325

Thanks @eLRIC for the response. It didn’t work.
Did I miss something in the documentation?
Is there any place it describe how to add the lights, etc… Or it explains the endpoint topic?
light_type: ‘dual-white’, is this mandatory?

Sorry but I am little bit lost


#326

I quickly looked at the code and I don’t get yet if light_type is used for something specific (I don’t have zigbee lights so never tested this part myself)

At first, I would try with the full configuration example stated here : https://github.com/elric91/homeassistant_zigate/wiki/Configuration-examples
If it is still not working, please open an issue on the github, so that we can have a deeper look on what’s wrong


#327

If anyone is interested, problem with sensors “restore” on 0.84+ has been corrected with latest code on github


#328

Like others before me here, I’m having some trouble getting started with the ZiGate. I’ve connected the ZiGate (without WiFi) through USB on a raspberry pi 3, running hassio.
I keep getting this error every time I run the zigate.permit_join service: Failed with event code: 128

2019-01-02 15:16:51 DEBUG (MainThread) [custom_components.zigate] ZIGATE : Starting
2019-01-02 15:16:51 DEBUG (MainThread) [custom_components.zigate] ZIGATE : Finding zigate addresses
2019-01-02 15:16:51 DEBUG (MainThread) [custom_components.zigate] ZIGATE : All known addresses added
2019-01-02 15:16:51 DEBUG (MainThread) [custom_components.zigate.zigate2hass] ZIGATE : Transport initialized : SerialTransport(<uvloop.Loop running=True closed=False debug=False>, <custom_components.zigate.zigate2hass.ZiGateProtocol object at 0x72ad4230>, Serial<id=0x72eb7fd0, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False))
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate] --------------------------------------
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate] REQUEST      : 0049 FFFC1E00
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate]   # standard : 01 00 49 00 04 50 FF FC 1E 00 03
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate]   # encoded  : b'010210490210021450fffc1e021003'
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate] (timestamp : 15:18:38)
2019-01-02 15:18:38 DEBUG (SyncWorker_4) [zigate] --------------------------------------
2019-01-02 15:18:38 DEBUG (MainThread) [zigate] --------------------------------------
2019-01-02 15:18:38 DEBUG (MainThread) [zigate] RESPONSE 8000 : Status
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   * Status              : Failed with event code: 128
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   - Sequence            : b'00'
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   - Response to command : b'0049'
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   # encoded : b'01800210021002154c800210021049021003'
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   # decoded : 0180 00 00 05 4C 80 00 00 49 0003
2019-01-02 15:18:38 DEBUG (MainThread) [zigate]   (@timestamp : 15:18:38)
2019-01-02 15:19:56 DEBUG (SyncWorker_9) [zigate] --------------------------------------

#329

Strange : it seems that pairing is not working
What device are you trying to pair ?


#330

A Philips Hue bulb. I have reset the hue bulb, and the hue bridge itself is turned off.
The failure response is instant though, it’s not like it’s timing out or anything. I did notice a led blinking on the TTL part of the zigate, not on the radio module…


#331

Did you first “factory reset” your device ? (it apparently needs to be reset first to enable new pairing). Just a guess according to Zigate’s creator blog (http://faire-ca-soi-meme.fr/zigate/2017/11/27/maitrisez-vos-ampoules-zigbee/)


#332

I did a factory reset. But I’m thinking that the issue is not with the device I’m trying to pair, since the error occurs instantly after sending the zigate.permit_join command.
I’ve found this in some zigbee documentation:

MALFORMED_COMMAND
0x80
The command appears to contain the wrong fields, as detected either by the presence of one or more invalid field entries or by there being missing fields. Command not carried out. Implementer has discretion as to whether to return this error or INVALID_FIELD.

https://mmbnetworks.atlassian.net/wiki/spaces/SPRC2/pages/111321476/Zigbee+Specification+References

Update: it started working after I called zigate.init. And I’ve been able to discover the light bulb with zigate. Now onto the configuration :slight_smile: I have to say that it’s quite a bit of trail & error setting this thing up, hope it’s worth it :slight_smile:


#333

Glad it worked (and telling it as I was looking for a potential issue in the code …). Zigate is undoubtedly worth it if you value privacy and want a unique platform for all your zigbee devices.
Be careful with the config of the bulb as its endpoint may not be ‘01’ as many other devices (may be ‘0b’ according to zigate’s blog examples)


#334

How can you find out what devices have been paired and what their endpoints are?


#335

First, you can check if the device is paired with zigate, calling the following service (needs zigate FW >= 3.0b. Hope it works on your side as I saw an an error in the lib …)

image

in the log, you should have something like that : image


#336

I’ve been able to pair and setup a couple of devices and it all works. However, I’m now running into an issue where two Xiaomi battery powered wall switches lose connection after a little bit (an hour or so). This is what I see in the logs:

2019-01-11 06:48:12 DEBUG (SyncWorker_14) [zigate] REQUEST      : 0092 02bf0e010101
2019-01-11 06:48:12 DEBUG (SyncWorker_14) [zigate]   # standard : 01 00 92 00 06 26 02 BF 0E 01 01 01 03
2019-01-11 06:48:12 DEBUG (SyncWorker_14) [zigate]   # encoded  : b'0102109202100216260212bf021e02110211021103'
2019-01-11 06:48:12 DEBUG (SyncWorker_14) [zigate] (timestamp : 06:48:12)
2019-01-11 06:48:12 DEBUG (SyncWorker_14) [zigate] --------------------------------------
2019-01-11 06:48:12 DEBUG (MainThread) [zigate] --------------------------------------
2019-01-11 06:48:12 DEBUG (MainThread) [zigate] RESPONSE 8000 : Status
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   * Status              : Success
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Sequence            : b'11'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Response to command : b'0092'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   # encoded : b'01800210021002150216021011021092021003'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   # decoded : 0180 00 00 05 06 00 11 00 92 0003
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   (@timestamp : 06:48:12)
2019-01-11 06:48:12 DEBUG (MainThread) [zigate] --------------------------------------
2019-01-11 06:48:12 DEBUG (MainThread) [zigate] RESPONSE 8702 : APS Data Confirm Fail
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Status         : b'd4'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Src endpoint   : b'01'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Dst endpoint   : b'01'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Dst mode       : b'02'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Dst address    : b'bf0e000000000000'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   - Sequence       : b'e9'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   # encoded : b'018702120210021efbd4021102110212bf021e021002100210021002100210e9fe03'
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   # decoded : 0187 02 00 0E FB D4 01 01 02 BF 0E 00 00 00 00 00 00 E9 FE03
2019-01-11 06:48:12 DEBUG (MainThread) [zigate]   (@timestamp : 06:48:12)

After resetting and pairing the device again it works for a little while, then fails again. I don’t have this issue with another xiaomi switch.
Any ideas on what could be going on here?


#337

It seems like the problem with newly paired devices disappearing persists… I’ve added a new xiaomi motion sensor, and this time I noticed something in the log:

2019-01-16 09:13:31 DEBUG (MainThread) [custom_components.zigate] ZIGATE : Starting
2019-01-16 09:13:31 DEBUG (MainThread) [custom_components.zigate] ZIGATE : Finding zigate addresses
2019-01-16 09:13:31 DEBUG (MainThread) [custom_components.zigate] ZIGATE : All known addresses added
2019-01-16 09:13:31 DEBUG (MainThread) [custom_components.zigate.zigate2hass] ZIGATE : Transport initialized : SerialTransport(<uvloop.Loop running=True closed=False debug=False>, <custom_components.zigate.zigate2hass.ZiGateProtocol object at 0x72fca0d0>, Serial<id=0x72e56f50, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False))
2019-01-16 09:17:56 DEBUG (MainThread) [zigate] --------------------------------------
2019-01-16 09:17:56 DEBUG (MainThread) [zigate] RESPONSE 8102 : Attribute Report / Response
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] ZIGATE SIGNAL :
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Signal   : zgt_signal_update_8ab601
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Property : last seen
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Data     : 2019-01-16 09:17:56
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] ZIGATE SIGNAL :
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Signal   : zgt_signal_update_8ab601
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Property : battery
2019-01-16 09:17:56 DEBUG (MainThread) [custom_components.zigate.zigate2hass] - Data     : 3.055
2019-01-16 09:17:56 INFO (MainThread) [zigate]   * Battery info
2019-01-16 09:17:56 INFO (MainThread) [zigate]   * Value : 3.055 V
2019-01-16 09:17:56 INFO (MainThread) [zigate]   FROM ADDRESS      : b'8ab6'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Source EndPoint : b'01'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Cluster ID      : b'0000'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Attribute ID    : b'ff01'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Attribute type  : b'42'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Attribute size  : 33
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   - Attribute data  : b'0121ef0b0328150421a8130521080006240e000000000a2100006410000b210200'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   # encoded : b'0181021202102e31548ab6021102100210ff0211021042021021021121ef021b02132815021421a81302152102180210021624021e0210021002100210021a210210021064100210021b21021202107b03'
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   # decoded : 0181 02 00 2E 31 54 8A B6 01 00 00 FF 01 00 42 00 21 01 21 EF 0B 03 28 15 04 21 A8 13 05 21 08 00 06 24 0E 00 00 00 00 0A 21 00 00 64 10 00 0B 21 02 00 7B03
2019-01-16 09:17:56 DEBUG (MainThread) [zigate]   (@timestamp : 09:17:56)
2019-01-16 09:17:57 DEBUG (MainThread) [zigate] --------------------------------------
2019-01-16 09:17:57 DEBUG (MainThread) [zigate] RESPONSE 8048 : Leave indication
2019-01-16 09:17:57 DEBUG (MainThread) [zigate]   - From address   : b'00158d0002b95db8'
2019-01-16 09:17:57 DEBUG (MainThread) [zigate]   - Rejoin status  : b'01'
2019-01-16 09:17:57 DEBUG (MainThread) [zigate]   # encoded : b'0180480210021a02150210158d02100212b95db80211021003'
2019-01-16 09:17:57 DEBUG (MainThread) [zigate]   # decoded : 0180 48 00 0A 05 00 15 8D 00 02 B9 5D B8 01 0003
2019-01-16 09:17:57 DEBUG (MainThread) [zigate]   (@timestamp : 09:17:57)

After getting this ‘Leave indication’, the device stops working and it’s no longer shown in the device list…