dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 498 forks source link

[Request Device Support ] Legrand / BTicino Netatmo device #883

Closed Smanar closed 5 years ago

Smanar commented 5 years ago

Hi, I have a new device who works strangely, All seems good, but the led on the device stay red (go off on normal full commissioning) and on deconz it go to yellow then red. It's a device from the netatmo gamme from Legrand https://www.netatmo.com/partners/legrand. Called Mosaic, Celiane, Dooxie or Valena. I m making my test with the switch without neutral (legrand 600081) , see as light and not switch (I think it's normal because it control light on/off+ dimmer)

basicattribute cluster nodeinfo

IDK if there is a special protection or not, I can send a complete sniff make with ubiqua from the power on to the final led change make with the offciel centrale. Here a sample snif

I take all propositions and ideas. BTW I have some others questions:

Smanar commented 5 years ago

I have make a second try with sniffing with conbee key, and there is a lot of missing request.

zigbeeprotocol

Missing: Request key B Transport key B Verify key B Confirm key

Mgmt permit join request is not send by the device too after the key echange.

snif2

Do I need to enable master key in option, but how (not supported in the release ?)?

manup commented 5 years ago

Looks like the communication and security is alright since there is some exchange of messages on ZDP level.

But the switch leaves the network for some reason, so I guess it waited for specific commands or configuration (binding?). Question is which :)

Smanar commented 5 years ago

Yep, but on the first "sniff" (this one with the official central) there is only classic request, so I think the specific expected command isn't an exotic command like a manufactured one. But not using the 2 keys echange can be the problem, and it seems it s not implemented in this version yet. ATM Deconz only use a light key echange protocol.

For information, if you use this device out of the box, it works without problems, but with less functionnalities, you need to update it (with the central), but after the update it stops working.

On the application options, I m seeing a "master key" option, not implemeted yet, you know what is it ?

Here a screenshoot for the first sniff with filter on the good device with the official central. Easier to compare. snifclean

manup commented 5 years ago

They key and security setup is really finished here with the transport key command, a tunnel command would only be used if there was a router in between. deCONZ firmware has only enabled NWK layer security, APS layer security isn't used in ZLL/HA applications, albeit possible I wouldn't expect the switch to require APS layer security.

The two nodes wouldn't be able to exchange the further messages like node descriptor and the like if security wasn't established.

Therefore it would be interesting which messages the original central and the switch exchange after the key exchange, any bindings or read write attributes?

Smanar commented 5 years ago

I m comparing the 2 captures and I can say

On the layer NWK, on the working mode We have link status centrale > broadcast Route request 0x270F centrale > broadcast Route request 0x270F all devices> broadcast

I will make some tries with more request with conbee and forcing some commands like ota or attribute read.

manup commented 5 years ago

-- Add group/scene -- Bind request+response (20s after the association request so I have stoped here)

These are the ones I meant :) the switch might wait for this configuration to be done. Can you please provide the sniffed details of these requests?

Smanar commented 5 years ago
[17:35:55.389280]   Groups: Add Group   61-88-84-AD-DA-86-BD-00-00-48-02-86-BD-00-00-14-62-28-2B-00-11-00-58-32-18-00-00-74-04-00-00-B3-03-43-A9-EA-9E-54-BA-25-28-02-9E-19-E6-9D-07-8F-1E-D4-36
Frame Information: (51 bytes)
    Packet ID: 219
    Protocol: ZigBee
    Date: 2018/09/26
    Timestamp: 17:35:55.389280
    Time Delta: 0.178480
    Channel: 11
    Length: 51
    RSSI: -60 dBm
    Source: COM8: NXP JN51xx / Rainforest Toucan@1000000
    Layer: ZCL
    Status: Decrypted
MAC Header: (9 bytes)
    Frame Control: 0x8861
        ···· ···· ···· ·001 = Frame Type: [0x1] Data
        ···· ···· ···· 0··· = Security Enabled: [0x0] No
        ···· ···· ···0 ···· = Frame Pending: [0x0] No
        ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
        ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
        ···· ··00 0··· ···· = Reserved: 0x0
        ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
        ··00 ···· ···· ···· = Reserved: 0x0
        10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 132
    Destination PAN ID: 0xDAAD
    Destination Address: 0xBD86
    Source Address: 0x0000
MAC Payload: (40 bytes)
    NWK Header: 0x62140000BD860248
        Frame Control: 0x0248
            ···· ···· ···· ··00 = Frame Type: [0x0] Data
            ···· ···· ··00 10·· = Protocol Version: [0x2] ZigBee Pro
            ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
            ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
            ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
            ···· ·0·· ···· ···· = Source Route Included: [0x0] No
            ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
            ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
            ··0· ···· ···· ···· = End Device Initiator: [0x0] No
            00·· ···· ···· ···· = Reserved: 0x0
        Destination Address: 0xBD86
        Source Address: 0x0000
        Radius: 0x14
        Sequence Number: 98
    NWK Aux Header: (14 bytes)
        Network Security Control: 0x28
            ···· ·000 = Network Security Level: [0x0] None
            ···0 1··· = Key NWK ID: [0x1] Network Key
            ··1· ···· = Extended Nonce: [0x1] Yes
            00·· ···· = Reserved: 0x0
        NWK Frame Counter: 1114155
        Source Address: 00:04:74:00:00:18:32:58
        NWK Key Sequence Number: 0
    NWK Payload: (14 bytes)
        APS Header: 0x9401010400040140
            Frame Control: 0x40
                ···· ··00 = Frame Type: [0x0] Data
                ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
                ···0 ···· = Acknowledgement Format: 0x0
                    Format: [0x0] Data Frame
                ··0· ···· = Security Enabled: [0x0] No
                ·1·· ···· = Acknowledgement Request: 0x1
                    Request: [0x1] Yes
                0··· ···· = Extended Header Present: [0x0] No
            Destination Endpoint: 0x01
            Cluster ID: [0x0004] General: Groups
            Profile ID: [0x0104] ZigBee Home Automation
            Source Endpoint: 0x01
            APS Counter: 148
        APS Payload: 0x00FFF6000711
            ZCL Header: 0x000711
                Frame Control: 0x11
                    ···· ··01 = Frame Type: [0x1] Command is Specific to a Cluster
                    ···· ·0·· = Manufacturer Specific: [0x0] Manufacturer Code Not Included in the ZCL Frame
                    ···· 0··· = Direction: [0x0] From Client to Server
                    ···1 ···· = Disable Default Response: [0x1] Yes
                    000· ···· = Reserved: 0x0
                Transaction Sequence Number: 7
                Command ID: [0x00] Add Group
            ZCL Payload: 0x00FFF6
                Group ID: 0xFFF6
                Group Name: 0x00
                    Length: [0] Empty String
    NWK MIC: 0x88A3970D
MAC Footer: 0x36D4
    Frame Check Sequence: 0x36D4
[17:35:58.683792]   Bind Request    61-88-90-AD-DA-86-BD-00-00-48-02-86-BD-00-00-14-6D-28-37-00-11-00-58-32-18-00-00-74-04-00-00-5F-76-21-97-9E-63-8E-72-D7-C7-9F-1E-F1-5C-02-2A-9D-B2-E5-64-3A-4A-6B-C8-5C-E3-CA-E3-EA-37-58-C9-36-B8-83-41
Frame Information: (67 bytes)
    Packet ID: 272
    Protocol: ZigBee
    Date: 2018/09/26
    Timestamp: 17:35:58.683792
    Time Delta: 0.690560
    Channel: 11
    Length: 67
    RSSI: -60 dBm
    Source: COM8: NXP JN51xx / Rainforest Toucan@1000000
    Layer: ZDP
    Status: Decrypted
MAC Header: (9 bytes)
    Frame Control: 0x8861
        ···· ···· ···· ·001 = Frame Type: [0x1] Data
        ···· ···· ···· 0··· = Security Enabled: [0x0] No
        ···· ···· ···0 ···· = Frame Pending: [0x0] No
        ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
        ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
        ···· ··00 0··· ···· = Reserved: 0x0
        ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
        ··00 ···· ···· ···· = Reserved: 0x0
        10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 144
    Destination PAN ID: 0xDAAD
    Destination Address: 0xBD86
    Source Address: 0x0000
MAC Payload: (56 bytes)
    NWK Header: 0x6D140000BD860248
        Frame Control: 0x0248
            ···· ···· ···· ··00 = Frame Type: [0x0] Data
            ···· ···· ··00 10·· = Protocol Version: [0x2] ZigBee Pro
            ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
            ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
            ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
            ···· ·0·· ···· ···· = Source Route Included: [0x0] No
            ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
            ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
            ··0· ···· ···· ···· = End Device Initiator: [0x0] No
            00·· ···· ···· ···· = Reserved: 0x0
        Destination Address: 0xBD86
        Source Address: 0x0000
        Radius: 0x14
        Sequence Number: 109
    NWK Aux Header: (14 bytes)
        Network Security Control: 0x28
            ···· ·000 = Network Security Level: [0x0] None
            ···0 1··· = Key NWK ID: [0x1] Network Key
            ··1· ···· = Extended Nonce: [0x1] Yes
            00·· ···· = Reserved: 0x0
        NWK Frame Counter: 1114167
        Source Address: 00:04:74:00:00:18:32:58
        NWK Key Sequence Number: 0
    NWK Payload: (30 bytes)
        APS Header: 0x9800000000210000
            Frame Control: 0x00
                ···· ··00 = Frame Type: [0x0] Data
                ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
                ···0 ···· = Acknowledgement Format: 0x0
                    Format: [0x0] Data Frame
                ··0· ···· = Security Enabled: [0x0] No
                ·0·· ···· = Acknowledgement Request: 0x0
                    Request: [0x0] No
                0··· ···· = Extended Header Present: [0x0] No
            Destination Endpoint: 0x00
            Cluster ID: [0x0021] Bind Request
            Profile ID: [0x0000] ZigBee Device Profile
            Source Endpoint: 0x00
            APS Counter: 152
        APS Payload: (22 bytes)
            ZDP Transaction Sequence Number: 3
            Bind Request: (21 bytes)
                Source Address: 00:04:74:00:00:7A:26:66
                Source Endpoint: 0x01
                Cluster ID: 0x0006
                Destination Address Mode: [0x03] Direct 64-bit Addr Mode and EP
                Destination Address: 00:04:74:00:00:18:32:58
                Destination Endpoint: 0x01
    NWK MIC: 0xCC37210B
MAC Footer: 0x4183
    Frame Check Sequence: 0x4183

[17:35:58.703167]   Bind Response   61-88-91-AD-DA-00-00-86-BD-48-02-00-00-86-BD-14-FE-28-21-00-1C-00-66-26-7A-00-00-74-04-00-00-61-C7-2E-27-6B-4C-73-5C-9E-88-A7-5B-4D-18-66-B7
Frame Information: (47 bytes)
    Packet ID: 274
    Protocol: ZigBee
    Date: 2018/09/26
    Timestamp: 17:35:58.703167
    Time Delta: 0.016848
    Channel: 11
    Length: 47
    RSSI: -60 dBm
    Source: COM8: NXP JN51xx / Rainforest Toucan@1000000
    Layer: ZDP
    Status: Decrypted
MAC Header: (9 bytes)
    Frame Control: 0x8861
        ···· ···· ···· ·001 = Frame Type: [0x1] Data
        ···· ···· ···· 0··· = Security Enabled: [0x0] No
        ···· ···· ···0 ···· = Frame Pending: [0x0] No
        ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
        ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
        ···· ··00 0··· ···· = Reserved: 0x0
        ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
        ··00 ···· ···· ···· = Reserved: 0x0
        10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 145
    Destination PAN ID: 0xDAAD
    Destination Address: 0x0000
    Source Address: 0xBD86
MAC Payload: (36 bytes)
    NWK Header: 0xFE14BD8600000248
        Frame Control: 0x0248
            ···· ···· ···· ··00 = Frame Type: [0x0] Data
            ···· ···· ··00 10·· = Protocol Version: [0x2] ZigBee Pro
            ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
            ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
            ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
            ···· ·0·· ···· ···· = Source Route Included: [0x0] No
            ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
            ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
            ··0· ···· ···· ···· = End Device Initiator: [0x0] No
            00·· ···· ···· ···· = Reserved: 0x0
        Destination Address: 0x0000
        Source Address: 0xBD86
        Radius: 0x14
        Sequence Number: 254
    NWK Aux Header: (14 bytes)
        Network Security Control: 0x28
            ···· ·000 = Network Security Level: [0x0] None
            ···0 1··· = Key NWK ID: [0x1] Network Key
            ··1· ···· = Extended Nonce: [0x1] Yes
            00·· ···· = Reserved: 0x0
        NWK Frame Counter: 1835041
        Source Address: 00:04:74:00:00:7A:26:66
        NWK Key Sequence Number: 0
    NWK Payload: (10 bytes)
        APS Header: 0xD900000080210000
            Frame Control: 0x00
                ···· ··00 = Frame Type: [0x0] Data
                ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
                ···0 ···· = Acknowledgement Format: 0x0
                    Format: [0x0] Data Frame
                ··0· ···· = Security Enabled: [0x0] No
                ·0·· ···· = Acknowledgement Request: 0x0
                    Request: [0x0] No
                0··· ···· = Extended Header Present: [0x0] No
            Destination Endpoint: 0x00
            Cluster ID: [0x8021] Bind Response
            Profile ID: [0x0000] ZigBee Device Profile
            Source Endpoint: 0x00
            APS Counter: 217
        APS Payload: 0x0003
            ZDP Transaction Sequence Number: 3
            Bind Response: 0x00
                Status: [0x00] Success
    NWK MIC: 0x29D5EE27
MAC Footer: 0xB766
    Frame Check Sequence: 0xB766

Hu ! I m seing something, (the device have the adress BD86) so it's the device itself who ask for "basic read attribute" (Request n 159) to the device router, not the coordinator. And this request is make in the first trame, so perhpas the blocking request is just between the commissioning frame (Request n 96 ) and this one. In fact in normal mode the device is more active.

I have others devices ikea bulb, usb device, there is a way to force the installation to work like the original one ? In fact the central have a buildin device inside, it s 'not possible to use the original central without the router, the prb is perhaps from here.

I can send you the captured packet in ubiqua format if you have a public email ? But there is too much differences betwen the working mode with and without router.

Smanar commented 5 years ago

Yeah ^^. I have make a try with an ikea bulb as router, and It works ^^, at least the on/off, not the dimmer but on normal usage you need to enable this option with application.

I will post a sniff soon.

Smanar commented 5 years ago

workingsniff

The sniff during a working process with Deconz. I can 't explain what happen, the device try 1 time, leave , retry and it works. But on the same sniff, I have a working try and a not working. I can send the file if you have an email to send it.

Now New try with the centrale to get all the special command to enable led and dimmer.

Smanar commented 5 years ago

Now I need help, this is the missing cluster/attribute I need to control it, can you say me witch one files I can edit to make it working ? Do I need to make a full integration with the new manufacture too, or just add cluster ? It seem all is hard coded ?

Frame Information: (53 bytes)
    Packet ID: 13
    Protocol: ZigBee
    Date: 2018/10/21
    Timestamp: 15:31:03.061918
    Time Delta: 2.172160
    Channel: 11
    Length: 53
    RSSI: -90 dBm
    Source: COM9: NXP JN51xx / Rainforest Toucan@1000000
    Layer: ZCL
    Status: Decrypted
MAC Header: (9 bytes)
    Frame Control: 0x8861
        ···· ···· ···· ·001 = Frame Type: [0x1] Data
        ···· ···· ···· 0··· = Security Enabled: [0x0] No
        ···· ···· ···0 ···· = Frame Pending: [0x0] No
        ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
        ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
        ···· ··00 0··· ···· = Reserved: 0x0
        ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
        ··00 ···· ···· ···· = Reserved: 0x0
        10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 14
    Destination PAN ID: 0xDAAD
    Destination Address: 0x2EBE
    Source Address: 0x0000
MAC Payload: (42 bytes)
    NWK Header: 0x081400002EBE0248
        Frame Control: 0x0248
            ···· ···· ···· ··00 = Frame Type: [0x0] Data
            ···· ···· ··00 10·· = Protocol Version: [0x2] ZigBee Pro
            ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
            ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
            ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
            ···· ·0·· ···· ···· = Source Route Included: [0x0] No
            ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
            ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
            ··0· ···· ···· ···· = End Device Initiator: [0x0] No
            00·· ···· ···· ···· = Reserved: 0x0
        Destination Address: 0x2EBE
        Source Address: 0x0000
        Radius: 0x14
        Sequence Number: 8
    NWK Aux Header: (14 bytes)
        Network Security Control: 0x28
            ···· ·000 = Network Security Level: [0x0] None
            ···0 1··· = Key NWK ID: [0x1] Network Key
            ··1· ···· = Extended Nonce: [0x1] Yes
            00·· ···· = Reserved: 0x0
        NWK Frame Counter: 1572954
        Source Address: 00:04:74:00:00:18:32:58
        NWK Key Sequence Number: 0
    NWK Payload: (16 bytes)
        APS Header: 0x03010104FC010100
            Frame Control: 0x00
                ···· ··00 = Frame Type: [0x0] Data
                ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
                ···0 ···· = Acknowledgement Format: 0x0
                    Format: [0x0] Data Frame
                ··0· ···· = Security Enabled: [0x0] No
                ·0·· ···· = Acknowledgement Request: 0x0
                    Request: [0x0] No
                0··· ···· = Extended Header Present: [0x0] No
            Destination Endpoint: 0x01
            Cluster ID: [0xFC01] Private Cluster
            Profile ID: [0x0104] ZigBee Home Automation
            Source Endpoint: 0x01
            APS Counter: 3
        APS Payload: 0x0101090000021910
            ZCL Header: 0x021910
                Frame Control: 0x10
                    ···· ··00 = Frame Type: [0x0] Command Acts Across the Entire Profile
                    ···· ·0·· = Manufacturer Specific: [0x0] Manufacturer Code Not Included in the ZCL Frame
                    ···· 0··· = Direction: [0x0] From Client to Server
                    ···1 ···· = Disable Default Response: [0x1] Yes
                    000· ···· = Reserved: 0x0
                Transaction Sequence Number: 25
                General Command Frame: [0x02] Write Attributes
            ZCL Payload: 0x0101090000
                Attribute 0: 0x0101090000
                    Attribute ID: [0x0000] Reserved
                    Data Type: [0x09] 16-bit Data
                    Unknown Data Type: 0x0101
    NWK MIC: 0x09834125
MAC Footer: 0x5B3A
    Frame Check Sequence: 0x5B3A

Data 0101 > Enable dimmer Data 0100 > Disable dimmer

Frame Information: (52 bytes)
    Packet ID: 97
    Protocol: ZigBee
    Date: 2018/10/21
    Timestamp: 15:37:11.730350
    Time Delta: 0.522464
    Channel: 11
    Length: 52
    RSSI: -83 dBm
    Source: COM9: NXP JN51xx / Rainforest Toucan@1000000
    Layer: ZCL
    Status: Decrypted
MAC Header: (9 bytes)
    Frame Control: 0x8861
        ···· ···· ···· ·001 = Frame Type: [0x1] Data
        ···· ···· ···· 0··· = Security Enabled: [0x0] No
        ···· ···· ···0 ···· = Frame Pending: [0x0] No
        ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
        ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
        ···· ··00 0··· ···· = Reserved: 0x0
        ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
        ··00 ···· ···· ···· = Reserved: 0x0
        10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 70
    Destination PAN ID: 0xDAAD
    Destination Address: 0x2EBE
    Source Address: 0x0000
MAC Payload: (41 bytes)
    NWK Header: 0x401400002EBE0248
        Frame Control: 0x0248
            ···· ···· ···· ··00 = Frame Type: [0x0] Data
            ···· ···· ··00 10·· = Protocol Version: [0x2] ZigBee Pro
            ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
            ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
            ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
            ···· ·0·· ···· ···· = Source Route Included: [0x0] No
            ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
            ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
            ··0· ···· ···· ···· = End Device Initiator: [0x0] No
            00·· ···· ···· ···· = Reserved: 0x0
        Destination Address: 0x2EBE
        Source Address: 0x0000
        Radius: 0x14
        Sequence Number: 64
    NWK Aux Header: (14 bytes)
        Network Security Control: 0x28
            ···· ·000 = Network Security Level: [0x0] None
            ···0 1··· = Key NWK ID: [0x1] Network Key
            ··1· ···· = Extended Nonce: [0x1] Yes
            00·· ···· = Reserved: 0x0
        NWK Frame Counter: 1573010
        Source Address: 00:04:74:00:00:18:32:58
        NWK Key Sequence Number: 0
    NWK Payload: (15 bytes)
        APS Header: 0x17010104FC010100
            Frame Control: 0x00
                ···· ··00 = Frame Type: [0x0] Data
                ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
                ···0 ···· = Acknowledgement Format: 0x0
                    Format: [0x0] Data Frame
                ··0· ···· = Security Enabled: [0x0] No
                ·0·· ···· = Acknowledgement Request: 0x0
                    Request: [0x0] No
                0··· ···· = Extended Header Present: [0x0] No
            Destination Endpoint: 0x01
            Cluster ID: [0xFC01] Private Cluster
            Profile ID: [0x0104] ZigBee Home Automation
            Source Endpoint: 0x01
            APS Counter: 23
        APS Payload: 0x01100001022F10
            ZCL Header: 0x022F10
                Frame Control: 0x10
                    ···· ··00 = Frame Type: [0x0] Command Acts Across the Entire Profile
                    ···· ·0·· = Manufacturer Specific: [0x0] Manufacturer Code Not Included in the ZCL Frame
                    ···· 0··· = Direction: [0x0] From Client to Server
                    ···1 ···· = Disable Default Response: [0x1] Yes
                    000· ···· = Reserved: 0x0
                Transaction Sequence Number: 47
                General Command Frame: [0x02] Write Attributes
            ZCL Payload: 0x01100001
                Attribute 0: 0x01100001
                    Attribute ID: [0x0001] Reserved
                    Data Type: [0x10] Boolean
                    Unknown Data Type: 0x01
    NWK MIC: 0xEBD68619
MAC Footer: 0xB231
    Frame Check Sequence: 0xB231

Data 01 > enable led in dark Data 00 > disable led in dark

Smanar commented 5 years ago

Ok so It seem it's not hardcoded. I have make this part in general.xml

    <cluster id="fc01" name="Legrand - Specific clusters">
        <description>Legrand Specific clusters.
        </description>
        <server>
            <attribute id="0x0000" name="Dimmer" type="dat16" default="0" access="rw" required="m">
                <value name="Disable dimmer" value="0x0100"></value>
                <value name="Enable Dimmer" value="0x0101"></value>
            </attribute>
            <attribute id="0x0001" type="bool" name="LED" required="m" access="rw" default="0"></attribute>
        </server>
        <client>
        </client>
    <!-- TODO -->
    </cluster>

It seem working, at least for LED, but I can't display the 2 options for dimmer with dat16 type, I can display values with other type (for exemple u16), but I have an error when I try to read/write, no error with dat16, but I can only read the value and I can see it nowhere.

I have tried with enum16, I can set the value, not possible to read it, but after close/open the dialog sa issue, read come possible but nothing to see, except the message "reading done"

setting1 Invisible value ???? And how to set it.

Edit1: <attribute id="0x0000" name="Dimmer Enable/Disable" type="dat16" default="0x0100" access="rw" required="m" showas="hex"></attribute> Display "0x" ^^. I rly need explaination how it work !

manup commented 5 years ago

I've checked the code, this datatype is not yet supported in the deCONZ GUI, I'll add it in the next version.

Smanar commented 5 years ago

Lol, I have spend 1 hour trying all datatypes. I think this device can work "out of the box" with somes littles hacks (and all other from this gamme). I will wait for next version to continue my tests.

BTW thx a lot for answers :)

Smanar commented 5 years ago

Just for information I m seing on "about deCONZ" option, I m using this one from the website, it s the V2_05_20 And from https://www.dresden-elektronik.de/deconz/win/ I m seing there is more in date version. Do you want I make tries with this version or better to wait for version > V2_05_42

Edit: Ok, found the new version, making tries.

Smanar commented 5 years ago

Hi, I m making tries with the version 2.05.44, it's better but when I try to write some data (datatype = dat16, other are working), it's always "0x0000" on sniff (or 0x0100, the last read value). Do I need to wait for a future version, or it's another problem ?

Smanar commented 5 years ago

So, waiting for the correction in the GUI, I have used the deconz-cli-plugin with the command zclattr 0x0eF4 1 0xFC01 020000090101

And now all is perfect, on/off/dimmer/group/led, integration in phoscon is perfect, no bug yet.

The code I have changed in the xml file in <domain name="Manufacturer Specific" useZcl="true" part

        <!-- Legrand -->
        <cluster id="0xfc01" name="Legrand - Specific clusters" mfcode="1021">
            <description>Legrand Specific clusters.</description>
            <server>
                <attribute id="0x0000" name="Dimmer" type="dat16" default="0x0101" access="rw" required="m" showas="hex">
                    <description>0100 = Dimmer Off, 0101 = Dimmer On</description>
                </attribute>
                <attribute id="0x0001" type="bool" name="LED" required="m" access="rw" default="0">
                    <description>Enable LED in dark</description>
                </attribute>
            </server>
            <client>
            </client>
        </cluster>

Tell me if you want more information for integration.

manup commented 5 years ago

Cool, can you please submit a PR for the general.xml addition?

Hi, I m making tries with the version 2.05.44, it's better but when I try to write some data (datatype = dat16, other are working), it's always "0x0000" on sniff (or 0x0100, the last read value).

Do you mean the write attribute isn't filled with the data provided in Cluster Info Panel?

Smanar commented 5 years ago

Exactly, I can put any values in the editbox, if I press write, I have the message "sucessfull", but the ConBee always send the same value at the device, and if I press the "read button" it come back to the old value again. The problem is not from the device, because I have "snif" the request and it rly send the same value whatever is the value in the editbox.

Sure I will make the PR, but I m waiting for the GUI is working again, because without this correction, impossible to enable dimmer without deconz-cli-plugin, so my addition can't work.

Smanar commented 5 years ago

Just tested 2.05.47, bug still here, GUI don't support DAT16. And I haven't checked but it seem there is exactly the same prb for int24 cf https://github.com/dresden-elektronik/deconz-rest-plugin/issues/812

manup commented 5 years ago

Yes sorry hasn't made it yet, looking forward to fix it in the next release around Friday.

Smanar commented 5 years ago

No problems, I will make tries on futures versions. But this github is for only the rest plugin or all the deCONZ application ? Because it's a bug in the GUI, nothing to see with the plugin.

Smanar commented 5 years ago

It works, thx again for your app and support :).

So to resume, It s a switch with wire, but without neutral (zero line) with on/off AND dimmer.

After that, the device is see as bulb (not a switch) so easier for integration, it works without problem in phoscon too. The return state works too, use the bind fonction for that.

Smanar commented 5 years ago

Ok so just for information the values I m using for attribute report, after somes tests.

For on/off : I have set 1 - 300 For level control : I have set 1 - 600 - 0

WhistleMaster commented 5 years ago

So are all the Legrand connected switch series are now supported with this change ?

Why is it seen as a light instead of a switch ?

EDIT: is this product supported: https://www.legrand.fr/catalogue/interrupteur/interrupteur-micromodule-declairage-onoff-pour-rendre-votre-eclairage-connecte-installation-with-netatmo

Smanar commented 5 years ago

Only the wired one, the batteries ones not.

Yes, it's a light, not a switch, switch send command, light receive command, this one receive command to enable/disable power.

I haven't tried the micro module, but it's the only one, that work out of the box (and without firmware update) on other solution, so I think it will works too, but I haven't confirmation yet, if someone can confirm to me ?

But Take care :


YOU NEED THE GATEWAY TO UPDATE DEVICE FIRMWARE TO ENABLE DIMMER. After than you can put it back in its box. Else you will have only on/off.


I haven't tried to add the manual part in the API code to make it automatic, because I have realy few return for this device, in fact you are the first one on this github ^^.

WhistleMaster commented 5 years ago

Thanks for your insight on that !

I haven't tried to add the manual part in the API code to make it automatic, because I have realy few return for this device.

I'm not sure to understand. What do you mean by adding the manual part in the API ?

Smanar commented 5 years ago

2 things: 1 - the binding, with it you will have state return on every manual action on the switch (else you need pooling) 2 - Set the attribute report, else the gateway will spam the switch for attribute, like for philips bulbs.

These 2 actions can be include in the API code, to make them automatic during pairing.

WhistleMaster commented 5 years ago

I see. How do you set those two manually then ?

Smanar commented 5 years ago

For bind:

For attribute setting

ATM I m using this config For on/off : I have set 1 - 300 For level control : I have set 1 - 600 - 0

For information, the Legrand plug are working, but without consumption return, and this is not possible without changing code (need whitelist), so I m waiting for that to change the switch code in same time. if I m right , I will have less than 10 lines to change, but: 1 - No one have ask for it, and I don't like spend time for nothing. 2 - I need someone with the deconz GUI and the device to make test (I haven't plug)

WhistleMaster commented 5 years ago

Thanks for the clarification !

1 - No one have ask for it, and I don't like spend time for nothing.

Well, I'm interested to have the Legrand switches fully integrated with Deconz !

Smanar commented 5 years ago

Lol, I was speaking for the plug, for the switch you can do that manually, only 1 time, and it's not an obligation, the switch can work without it. You are the first one who ask me something about this manufacture after more than 10 months and I m on other deconz projects too.

WhistleMaster commented 5 years ago

I got you ! I thought you were asking for the switches.

I'm using Home Assistant (HA) with Deconz, so without doing the binding and the attribute setting, would the switch work correctly with HA (states reporting, etc.) ?

I'm interested by this brand because of the price tag and also because it's a well known brand.

Smanar commented 5 years ago

Depend of home automation application for bind, attribute is just a bonus, like I have said Phiips hue are spamming too.

Yeah it's a well know brand, with realy serious hardware and support (for quality it's another story), it's the world n 1 in switch and plug with 20% of the world market, but no-one ask for this kind of device ^^. Perhpas because of price (and because you need the gateway too for update the device firmware).

You already have the device or not ? Have you tried to make the binding yourself ?

I will take a look on the code tomorrow, give me some time to see, if I can make something fast.

tocks53 commented 5 years ago

Hello,

I wish to install dooxies in my house. I would like to know if the following modules will be compatible with deconz.

600087.600085.600081, 600698

For 600087 will there be the opening in percentage of the shutters?

Thank you for the work done in the integration of Legrand products.

Smanar commented 5 years ago

Was not so hard, all was working naturally, the harder part was sniffing the packet to find the special attribute to enable the dimmer and understand how legrand bridle its features. And like I have said before, the integration is not full yet, there is some part that need to be manually.

6 000 81 : yes it's the one I have (but remember,you need the gateway to enable dimmer) 6 006 98 : Yes, but I don't think you have consumption report, I haven't the device to make tries but for that I think you need to gateway to update the firwmare (like for the dimmer) and put this plug in whitelist in the API code. 6 000 87 : This one can't works alone, you need to the wired one ( 6 000 86)

For other not, I have never see a poject with netatmo battery device, the wired shutter switch can work, but the battery one, I think not, but I haven't tried it.

If you wana try the dimmer switch or the plug, I can make modification on the code in "blind mode" with your help for tests, I have already take a look on the code, will not be hard, but I can't test it on my side. But for batteries devices, I can not guarantee anything, and I m not optimistic.

And no, there isn't percentage of the shutters, it's just up/down/stop.

Xylomid commented 5 years ago

Hey man, just letting you know that we appreciate your work and you're not the only one interested in having Legrand hardware integrated in Deconz.

Do you know if i can, with only a wireless legrand dimmer switch (no gateway), trigger a deconz_event in home assistant ? Thanks

Smanar commented 5 years ago

wireless legrand dimmer switch ? There is a wireless dimmer ? Wireless switch are just for on/off ?

Xylomid commented 5 years ago

My bad, wireless are only on/off. That's the one i'm talking about

Smanar commented 5 years ago

Ha, so I think no.

No-one have already tried on deconz, but on other zigbee project, nobody has ever succeeded to include a netatmo battery device. I haven't tried on my side too, always for the same reason, price ^^.

BTW, for information, if someone want to help me for better Netatmo integration (for tests, like consumption for plug), I will be on holiday in some days and will leave my country. So I will be back in 15 days.

Smanar commented 5 years ago

So still no-one ? Ok, so if someone want a better integration, I need someone with the hardware (and the centrale for the plug, I don't think it's usefull for the wired shutters switches).

xmillies commented 5 years ago

Hi @Smanar,

I have buy :

I have also the centrale with the plug :-) https://www.legrand.fr/sites/default/files/styles/160x160/public/ecat/cp06-01-prisecontrol.png?itok=cKMQVT2M

I 'd like make tests for you.

I have buy Legrand items because I have already Celiane plug and switch. I 'm able to reuse cover / trim (expensive part).

Xavier

Smanar commented 5 years ago

Ha nice ^^. Have you already tried the plug to see if the power consumption is working ? I think not because he is not in white list. I start the modification on code tonight, I think I need nothing, I already have the cluster from my last "sniff" with the central. Perhaps a screenshoot with the basic cluster attribute, but I think I can find them too on other site.

PS: The switch haven't power consumption, the app just add 50W (by switch) when the switch is ON.

xmillies commented 5 years ago

For the moment, I have tried only the preinstalled SD-card image on Raspberry Pi :

Raspbian Buster Desktop "Stabiles Image mit Desktop basierend auf Debian Buster." deCONZ 2.05.69 Version 9-2019 released 08/09/2019

If I remember I see the plug (not with last firmware). I will check as soon as possible.

Smanar commented 5 years ago

Ok, on my side I have a starting code > https://github.com/Smanar/deconz-rest-plugin Do you know how to compile it ? I can send you my compiled file but it s perhaps plateform dependant (and I m still on Strech).

So on this version, the plug will be on whitelist, so the values will not be good, but you will see values on websocket return (I hope, never do that) I don't know wich one value the plug return, and I assume the model id is "plug.Celiane.Legrand", I think it will be good for you but not for dooxie users.

To compare (and have more info), you can use this issue > https://github.com/dresden-elektronik/deconz-rest-plugin/issues/812

The code will do the binding itself, but you can test params manually too if my modification doesn't work.

For information, on the code I have used if (lightNode->manufacturerCode() == VENDOR_LEGRAND) > I m sure this one will be good, If i m right your plug MAC start with 000474..... sensor->modelId() == QLatin1String("plug.Celiane.Legrand") > for this one I m not sure at 100%, it's just deduction.

xmillies commented 5 years ago

You are on RPI debian strech ? I 'll try on the preinstalled SD-card image on Raspberry Pi (=Buster).

Smanar commented 5 years ago

Yep, and I have compiled the file, I can send it if you can't compile it yourself, but compilation are platform dependant so not sure my version will work on your system (logicaly yes, compilation on older system works on newer). Just tell me if you need the file ?

xmillies commented 5 years ago

I'll try with Buster.

Smanar commented 5 years ago

It's not a problem, just tell me if you can compile the file yourself or if you need I send you a compiled one to try.

xmillies commented 5 years ago

The compilation has worked. I have switch the plugin. I 'll try to do test this week-end.

Smanar commented 5 years ago

Nice, if I m right you will receive data (even with bad value) on websocket event. If not, I can be wrong at