[DEV] Knockturn Alley

Warning: This driver is useless to non-developers as it cannot actually control any smart device. Moreover, some functions are quite chatty and might upset your Zigbee mesh.

Here is a small driver I use for discovering functionalities of new Zigbee devices. I still have some ideas of what to add to it in the future, but I would love to get your take on it.

PS: Harry Potter fans might find the naming convention mildly amusing. For grownups, or otherwise sane folks out there, I apologize in advance :slight_smile:

Have fun!

8 Likes

Great job again, Dan!

I will surely learn and use the spells! :magic_wand:
:man_mage:

5 Likes

Released version 1.1.0 with the following changes:

  • Add the Imperio spell to help you update Zigbee attributes value. You can now fight back and do some real damage to your devices!
  • Scourgify has now the option to remove or keep the raw data

Have fun!

3 Likes

Released version 1.2.0 with the following changes:

  • Add Bombarda spell to execute Zigbee cluster commands
  • Legilimens spell now also discovers all commands that each cluster can receive

Have fun!

2 Likes

Here's the result of casting the Legilimens and Scourgify spells toward IKEA ASKVADER on/off switch :

ASKVADER on/off switch

I can't find a better way to copy the results other than as a screenshot.... :frowning: Is any magic available for that? :slight_smile:

1 Like

That looks nice :slight_smile: I think it contains enough info so you can start writing a driver for it!

  • You can cast Imperio (endpoint:0x01, cluster:0x0003, attribute:0x0000, type:0x21, value:000A) to write value 10 into the Identify Time attribute of the Identify Cluster. The device should react to this by blinking the LED light for 10 (000A) seconds.

  • You can cast Bombarda (endpoint:0x01, cluster:0x0006, command:0x02, no payload) to trigger the Toggle command of the On/Off Cluster.

1 Like

This is a rather standard device, I like much more tough challenges .. :stuck_out_tongue:

I am still searching for a way to obtain the VINDSTYRKA Air Quality tVOC 'tendency', as may be eventually reported by the sensor itself (it's shown with an arrow on the LCD display - increasing/no change/ decreasing).

Will need the manufacturer's code [mfgCode: 0x117c] added to the Accio, Imperio, and Bombarda spells ... Can you add this optional ingredient (mfgCode) to the spells?

1 Like

No idea how to use it (not a Dev) but can tell by @kkossev's reaction that it is very cool. Congrats on the great work.

4 Likes

I will look into this. Thank you for the feedback!

2 Likes

Wow, this is way above my skill level, but dam this should make creating drivers so much easier. I know just enough to cause some damage. I'll load this on my dev hub and see if I can learn some stuff.

Thank You Dan, it's incredibly smart people like yourself that make Hubitat so much better.

3 Likes

Released version 1.3.0 with the following changes:

  • Add option to specify manufacturer code when handling Zigbee attributes and when executing Zigbee commands
  • Change / shuffle some spell names

Happy hacking!

4 Likes

Released version 1.4.0 with the following changes:

  • Legilimens spell now also gathers data from "Node Descriptor" and "Node Power Descriptor"
  • Translate attribute hex values to friendly representations for some known attributes (e.g. Power On Behavior, Temperature, Relative Humidity, etc.)
Screenshot for IKEA Tradfri Control Outlet (E1603)

Happy hacking!

2 Likes

Released version 1.5.0 with the following changes:

  • Legilimens spell now also gathers data from Neighbors Table (LQI), Routing Table and Bindings Table
Screenshot for IKEA Askvader On/Off Switch (E1836)

Happy hacking!

1 Like

Released version 1.6.0 with the following change:

  • Add Oppugno spell to configure attribute reporting

For example, this Oppugno invocation is instructing the device (e.g. a smart plug) to report its On/Off status at least once every hour:

ka_1.6.0

Happy hacking!

1 Like

Released version 2.0.0 with the following change:

  • The generated report is now text only (no pretty HTML anymore). The good part is that you can now share it using copy/paste.
New report example
================================================================================================
Node Descriptor
================================================================================================
▸ Logical Type                              = Zigbee Router
▸ Complex Descriptor Available              = No
▸ User Descriptor Available                 = No
▸ Frequency Band                            = 2400 - 2483.5 MHz
▸ Alternate PAN Coordinator                 = No
▸ Device Type                               = Full Function Device (FFD)
▸ Mains Power Source                        = Yes
▸ Receiver On When Idle                     = Yes (always on)
▸ Security Capability                       = No
▸ Allocate Address                          = Yes
▸ Manufacturer Code                         = 0x117C = IKEA
▸ Maximum Buffer Size                       = 82 bytes
▸ Maximum Incoming Transfer Size            = 82 bytes
▸ Primary Trust Center                      = No
▸ Backup Trust Center                       = No
▸ Primary Binding Table Cache               = Yes
▸ Backup Binding Table Cache                = No
▸ Primary Discovery Cache                   = Yes
▸ Backup Discovery Cache                    = Yes
▸ Network Manager                           = Yes
▸ Maximum Outgoing Transfer Size            = 82 bytes
▸ Extended Active Endpoint List Available   = No
▸ Extended Simple Descriptor List Available = No
================================================================================================
Power Descriptor
================================================================================================
▸ Current Power Mode         = Same as "Receiver On When Idle" from "Node Descriptor" section above
▸ Available Power Sources    = [Constant (mains) power]
▸ Current Power Sources      = [Constant (mains) power]
▸ Current Power Source Level = 100%
================================================================================================
Endpoint 0x01 | Out Clusters: 0x0019 (OTA Upgrade Cluster)
================================================================================================
Endpoint 0x01 | In Cluster: 0x0000 (Basic Cluster)
================================================================================================
▸ 0x0000 | ZCL Version          | req | r-- | uint8  | 03                        | --
▸ 0x0001 | Application Version  | opt | r-- | uint8  | 10                        | --
▸ 0x0002 | Stack Version        | opt | r-- | uint8  | 67                        | --
▸ 0x0003 | HW Version           | opt | r-- | uint8  | 01                        | --
▸ 0x0004 | Manufacturer Name    | opt | r-- | string | IKEA of Sweden            | --
▸ 0x0005 | Model Identifier     | opt | r-- | string | ASKVADER on/off switch    | --
▸ 0x0006 | Date Code            | req | r-- | string | 20200807                  | --
▸ 0x0007 | Power Source         | opt | r-- | enum8  | 01 = Mains (single phase) | --
▸ 0x0008 | Generic Device Class | opt | r-- | enum8  | 00                        | --
▸ 0x0009 | Generic Device Type  | opt | r-- | enum8  | 05 = LED Bulb             | --
▸ 0x000A | Product Code         | opt | r-- | octstr | 4531383336 = E1836        | --
▸ 0x000B | Product URL          | opt | r-- | string | www.ikea.com              | --
▸ 0x4000 | SW Build ID          | opt | r-- | string | 1.0.002                   | --
▸ 0xFFFD | Cluster Revision     | req | r-- | uint16 | 0002                      | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Reset to Factory Defaults | opt
================================================================================================
Endpoint 0x01 | In Cluster: 0x0003 (Identify Cluster)
================================================================================================
▸ 0x0000 | Identify Time    | req | rw- | uint16 | 0000 = 0 seconds | --
▸ 0xFFFD | Cluster Revision | req | r-- | uint16 | 0001             | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Identify       | req
▸ 0x01 | Identify Query | req
▸ 0x40 | Trigger Effect | opt
================================================================================================
Endpoint 0x01 | In Cluster: 0x0004 (Groups Cluster)
================================================================================================
▸ 0x0000 | Name Support     | req | r-- | map8   | 00   | --
▸ 0xFFFD | Cluster Revision | req | r-- | uint16 | 0002 | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Add Group                | req
▸ 0x01 | View Group               | req
▸ 0x02 | Get Group Membership     | req
▸ 0x03 | Remove Group             | req
▸ 0x04 | Remove All Groups        | req
▸ 0x05 | Add Group If Identifying | req
▸ 0x41 | --                       | -- 
▸ 0x42 | --                       | -- 
================================================================================================
Endpoint 0x01 | In Cluster: 0x0005 (Scenes Cluster)
================================================================================================
▸ 0x0000 | Scene Count      | req | r-- | uint8  | 00         | --
▸ 0x0001 | Current Scene    | req | r-- | uint8  | 00         | --
▸ 0x0002 | Current Group    | req | r-- | uint16 | 0000       | --
▸ 0x0003 | Scene Valid      | req | r-- | bool   | 00 = False | --
▸ 0x0004 | Name Support     | req | r-- | map8   | 00         | --
▸ 0xFFFD | Cluster Revision | req | r-- | uint16 | 0002       | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Add Scene            | req
▸ 0x01 | View Scene           | req
▸ 0x02 | Remove Scene         | req
▸ 0x03 | Remove All Scenes    | req
▸ 0x04 | Store Scene          | req
▸ 0x05 | Recall Scene         | req
▸ 0x06 | Get Scene Membership | req
▸ 0x40 | Enhanced Add Scene   | opt
▸ 0x41 | Enhanced View Scene  | opt
▸ 0x42 | Copy Scene           | opt
================================================================================================
Endpoint 0x01 | In Cluster: 0x0006 (On/Off Cluster)
================================================================================================
▸ 0x0000 | On Off               | req | r-p | bool   | 00 = Off                    | --
▸ 0x4000 | Global Scene Control | opt | r-- | bool   | 01 = True                   | --
▸ 0x4001 | On Time              | opt | rw- | uint16 | 0000 = 0 seconds            | --
▸ 0x4002 | Off Wait Time        | opt | rw- | uint16 | 0000 = 0 seconds            | --
▸ 0x4003 | Power On Behavior    | opt | rw- | enum8  | FF = Restore previous state | --
▸ 0xFFFD | Cluster Revision     | req | r-- | uint16 | 0002                        | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Off                         | req
▸ 0x01 | On                          | req
▸ 0x02 | Toggle                      | req
▸ 0x40 | Off With Effect             | opt
▸ 0x41 | On With Recall Global Scene | opt
▸ 0x42 | On With Timed Off           | opt
================================================================================================
Endpoint 0x01 | In Cluster: 0x0008 (Level Control Cluster)
================================================================================================
▸ 0x0000 | Current Level          | req | r-p | uint8  | FE = 100%        | --
▸ 0x0001 | Remaining Time         | opt | r-- | uint16 | 0000 = 0 seconds | --
▸ 0x000F | --                     | --  | --  | map8   | 00               | --
▸ 0x0010 | On Off Transition Time | opt | rw- | uint16 | 0000 = 0 seconds | --
▸ 0x0011 | On Level               | opt | rw- | uint8  | FE = 100%        | --
▸ 0x4000 | StartUp Current Level  | opt | rw- | uint8  | FF               | --
▸ 0xFFFD | Cluster Revision       | req | r-- | uint16 | 0002             | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Move To Level             | req
▸ 0x01 | Move                      | req
▸ 0x02 | Step                      | req
▸ 0x03 | Stop                      | req
▸ 0x04 | Move To Level With On/Off | req
▸ 0x05 | Move With On/Off          | req
▸ 0x06 | Step With On/Off          | req
▸ 0x07 | Stop                      | req
================================================================================================
Endpoint 0x01 | In Cluster: 0x1000 (ZLL/Touchlink Commissioning Cluster)
================================================================================================
▸ 0xFFFD | Cluster Revision | req | r-- | uint16 | 0002 | --
------------------------------------------------------------------------------------------------
▸ 0x41 | Get Group Identifiers | opt
▸ 0x42 | Get Endpoint List     | opt
================================================================================================
Endpoint 0x01 | In Cluster: 0xFC57 (Unknown Cluster)
================================================================================================
▸ No attributes found
------------------------------------------------------------------------------------------------
▸ No commands found
================================================================================================
Endpoint 0xF2 | Out Clusters: 0x0021 (Green Power Cluster)
================================================================================================
Endpoint 0xF2 | In Cluster: 0x0021 (Green Power Cluster)
================================================================================================
▸ No attributes found
------------------------------------------------------------------------------------------------
▸ No commands found
================================================================================================
Neighbors Table
================================================================================================
▸ Addr:0000 | Type:Zigbee Coordinator | RxOnWhenIdle:Yes | Rel:Sibling | Depth:0  | LQI:209
▸ Addr:164A | Type:Zigbee Router      | RxOnWhenIdle:Yes | Rel:Parent  | Depth:15 | LQI:230
▸ Addr:1764 | Type:Zigbee Router      | RxOnWhenIdle:Yes | Rel:Sibling | Depth:15 | LQI:100
================================================================================================
Routing Table
================================================================================================
▸ Destination:0000 | Next Hop:0000 | Route Status:Active  
▸ Destination:47C9 | Next Hop:B31F | Route Status:Active  
▸ Destination:164A | Next Hop:164A | Route Status:Active  
▸ Destination:2CFB | Next Hop:164A | Route Status:Active  
▸ Destination:EEED | Next Hop:164A | Route Status:Active  
▸ Destination:28F7 | Next Hop:164A | Route Status:Active  
▸ Destination:9831 | Next Hop:164A | Route Status:Active  
▸ Destination:1E58 | Next Hop:B31F | Route Status:Active  
▸ Destination:B84F | Next Hop:B84F | Route Status:Active  
▸ Destination:1764 | Next Hop:1764 | Route Status:Active  
▸ Destination:B470 | Next Hop:164A | Route Status:Active  
▸ Destination:56AD | Next Hop:56AD | Route Status:Active  
▸ Destination:0000 | Next Hop:0000 | Route Status:Inactive
▸ Destination:0000 | Next Hop:0000 | Route Status:Inactive
▸ Destination:0000 | Next Hop:0000 | Route Status:Inactive
================================================================================================
Bindings Table
================================================================================================
▸ Src:680AE2FFFE68E036 | Endpoint:0x01 | Cluster:0x0006 | Dest:000D6F0010D6F00 | Endpoint:0x01

Happy hacking!

1 Like

Released version 2.1.0 with the following changes:

  • Legilimens spell now also discovers attributes and commands for a specific manufacturer
  • Add Revelio spell to retrieve data from Neighbors Table (LQI), Routing Table and Bindings Table
  • Add Unbreakable Vow spell to add/remove entries to/from the Bindings Table
Manufacturer specific attributes and commands for PhilipsWall Switch Module (RDM001)
================================================================================================
Node Descriptor
================================================================================================
▸ Logical Type                              = Zigbee End Device (ZED)
▸ Complex Descriptor Available              = No
▸ User Descriptor Available                 = No
▸ Frequency Band                            = 2400 - 2483.5 MHz
▸ Alternate PAN Coordinator                 = No
▸ Device Type                               = Reduced Function Device (RFD)
▸ Mains Power Source                        = No
▸ Receiver On When Idle                     = No (conserve power during idle periods)
▸ Security Capability                       = No
▸ Allocate Address                          = Yes
▸ Manufacturer Code                         = 0x100B = PHILIPS
▸ Maximum Buffer Size                       = 82 bytes
▸ Maximum Incoming Transfer Size            = 82 bytes
▸ Primary Trust Center                      = No
▸ Backup Trust Center                       = No
▸ Primary Binding Table Cache               = Yes
▸ Backup Binding Table Cache                = No
▸ Primary Discovery Cache                   = Yes
▸ Backup Discovery Cache                    = Yes
▸ Network Manager                           = Yes
▸ Maximum Outgoing Transfer Size            = 82 bytes
▸ Extended Active Endpoint List Available   = No
▸ Extended Simple Descriptor List Available = No
================================================================================================
Power Descriptor
================================================================================================
▸ Current Power Mode         = Same as "Receiver On When Idle" from "Node Descriptor" section above
▸ Available Power Sources    = [Constant (mains) power]
▸ Current Power Sources      = [Constant (mains) power]
▸ Current Power Source Level = 100%
================================================================================================
Endpoint 0x01 | Out Clusters: 0x0003 (Identify Cluster), 0x0004 (Groups Cluster), 0x0006 (On/Off Cluster), 0x0008 (Level Control Cluster), 0x0019 (OTA Upgrade Cluster)
================================================================================================
Endpoint 0x01 | In Cluster: 0x0000 (Basic Cluster)
================================================================================================
▸ 0x0000 | ZCL Version          | req | r-- | uint8  | 02                                               | --
▸ 0x0001 | Application Version  | opt | r-- | uint8  | 09                                               | --
▸ 0x0002 | Stack Version        | opt | r-- | uint8  | 02                                               | --
▸ 0x0003 | HW Version           | opt | r-- | uint8  | 03                                               | --
▸ 0x0004 | Manufacturer Name    | opt | r-- | string | Signify Netherlands B.V.                         | --
▸ 0x0005 | Model Identifier     | opt | r-- | string | RDM001                                           | --
▸ 0x0006 | Date Code            | req | r-- | string | 20210504                                         | --
▸ 0x0007 | Power Source         | opt | r-- | enum8  | 03 = Battery                                     | --
▸ 0x0008 | Generic Device Class | opt | r-- | enum8  | FF                                               | --
▸ 0x0009 | Generic Device Type  | opt | r-- | enum8  | E1 = Wall Switch                                 | --
▸ 0x000A | Product Code         | opt | r-- | octstr | 52444D3030312D44534D4E43437631 = RDM001-DSMNCCv1 | --
▸ 0x000B | Product URL          | opt | r-- | string | https://www.philips-hue.com                      | --
▸ 0x0011 | Physical Environment | opt | rw- | enum8  | 00                                               | --
▸ 0_0020 | --                   | --  | r-- | string | 5: SW:RBT                                        | --
▸ 0_0021 | --                   | --  | r-- | uint32 | 0000F2A3                                         | --
▸ 0_0030 | --                   | --  | r-- | enum8  | 01                                               | --
▸ 0_0031 | --                   | --  | rw- | map16  | 0000                                             | --
▸ 0_0034 | --                   | --  | rw- | enum8  | 02                                               | --
▸ 0x4000 | SW Build ID          | opt | r-- | string | 1.0.5                                            | --
▸ 0xFFFD | Cluster Revision     | req | r-- | uint16 | 0001                                             | --
------------------------------------------------------------------------------------------------
▸ No commands found
================================================================================================
Endpoint 0x01 | In Cluster: 0x0001 (Power Configuration Cluster)
================================================================================================
▸ 0x0020 | Battery Voltage              | opt | r-- | uint8  | 19 = 2500mV        | --      
▸ 0x0021 | Battery Percentage Remaining | opt | r-p | uint8  | 50 = 40% remaining | 0..43200
▸ 0xFFFD | Cluster Revision             | req | r-- | uint16 | 0001               | --      
------------------------------------------------------------------------------------------------
▸ No commands found
================================================================================================
Endpoint 0x01 | In Cluster: 0x0003 (Identify Cluster)
================================================================================================
▸ 0x0000 | Identify Time    | req | rw- | uint16 | 0000 = 0 seconds | --
▸ 0xFFFD | Cluster Revision | req | r-- | uint16 | 0001             | --
------------------------------------------------------------------------------------------------
▸ 0x00 | Identify       | req
▸ 0x01 | Identify Query | req
================================================================================================
Endpoint 0x01 | In Cluster: 0xFC00 (Unknown Cluster)
================================================================================================
▸ 0_0400 | --               | --  | r-- | uint8  | 01   | --
▸ 0_FFFD | Cluster Revision | req | r-- | uint16 | 0001 | --
------------------------------------------------------------------------------------------------
▸ 0_82 | -- | --
================================================================================================
Neighbors Table
================================================================================================
▸ Addr:728B | Type:Zigbee Router | RxOnWhenIdle:Yes | Rel:Parent | Depth:15 | LQI:226
================================================================================================
Routing Table
================================================================================================
▸ Could not retrieve data
================================================================================================
Bindings Table
================================================================================================
▸ Src:001788010CC46041 | Endpoint:0x01 | Cluster:0xFC00 | Dest:000D6F00000D6F0 | Endpoint:0x01
▸ Src:001788010CC46041 | Endpoint:0x01 | Cluster:0x0001 | Dest:000D6F00000D6F0 | Endpoint:0x01

Tip: Look for attributes and commands that start with 0_.

@kkossev This might help you discover more things about your IKEA VINDSTYRKA.

Happy hacking!

2 Likes

Released version 2.2.0 with the following small change:

  • Add Bombarda spell to execute raw Zigbee commands
Example for toggling On/Off switch status using Bombarda

bombarda

Happy hacking!

2 Likes

Any possibility of an English version for us non-Potter(ites)?

There’s pretty extensive documentation in the dev’s GitHub repo, linked in the OP.

2 Likes

Ssseya seethaaa ssss ssssehhh haa ehhh aayaa hass ssaah ayaeeh ssss ssssaytha seyythaa 'ssseya hatheeey ayaeeh hasseey ayaahath aayaa seyythaa ssss seyythaa ehhh hathehh aayaa ssssaytha seethaaa !
:snake:

3 Likes