{"action":"created","comment":{"url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/comments/46774740","id":46774740,"diff_hunk":"@@ -0,0 +1,352 @@\n+.. _zigbee_ref:\n+\n+ZigBee Reference\n+================\n+\n+The ZigBee library contains many shorthands and conveniences for developing ZigBee device type handlers.\n+\n+ZigBee devices have fingerprints that define what the device is when it joins a ZigBee network.\n+Currently you define the expected fingerprint for a device in the device type handler metadata block as part of the definition. An example would look like this:\n+\n+.. code-block:: groovy\n+\n+    metadata {\n+        // Automatically generated. Make future change here.\n+        definition (name: \"SmartPower Outlet\", namespace: \"smartthings\", author: \"SmartThings\") {\n+            capability \"Actuator\"\n+            capability \"Switch\"\n+            capability \"Power Meter\"\n+            capability \"Configuration\"\n+            capability \"Refresh\"\n+            capability \"Sensor\"\n+\n+        // indicates that device keeps track of heartbeat (in state.heartbeat)\n+        attribute \"heartbeat\", \"string\"\n+\n+        fingerprint profileId: \"0104\", inClusters: \"0000,0003,0004,0005,0006,0B04,0B05\", outClusters: \"0019\", manufacturer: \"CentraLite\",  model: \"3200\", deviceJoinName: \"Outlet\"\n+        fingerprint profileId: \"0104\", inClusters: \"0000,0003,0004,0005,0006,0B04,0B05\", outClusters: \"0019\", manufacturer: \"CentraLite\",  model: \"3200-Sgb\", deviceJoinName: \"Outlet\"\n+        fingerprint profileId: \"0104\", inClusters: \"0000,0003,0004,0005,0006,0B04,0B05\", outClusters: \"0019\", manufacturer: \"CentraLite\",  model: \"4257050-RZHAC\", deviceJoinName: \"Outlet\"\n+        fingerprint profileId: \"0104\", inClusters: \"0000,0003,0004,0005,0006,0B04,0B05\", outClusters: \"0019\"\n+    }\n+\n+If the fingerprint declaration contains a value for both the ``manufacturer`` and ``model`` attributes, you have the option to add the ``deviceJoinName`` attribute.\n+\n+===================== =========== ==========\n+Fingerprint Attribute Type        Value\n+===================== =========== ==========\n+deviceJoinName        ``String``  Overrides the device type name when pairing. This allows the developer to customize the device name while joining a ZigBee device.\n+===================== =========== ==========\n+\n+----\n+\n+Parse Methods\n+-------------\n+\n+zigbee.getEvent()\n+~~~~~~~~~~~~~~~~~\n+\n+The ``getEvent()`` method will try to parse ZigBee clusters into a map whose key/value pairs can be directly handled by the ``sendEvent()`` method.\n+\n+**Signature:**\n+    .. code-block:: groovy\n+\n+        Map(String:String) zigbee.getEvent(String description)\n+\n+**Parameters:**\n+    - **description**: The description value passed to the parse method from the device.\n+\n+**Return Values**:\n+    *Map(String key, String value)*\n+        - Key: The name of the event\n+        - Value: The value of the event\n+\n+**Example**\n+\n+.. code-block:: groovy\n+\n+    def parse(String description) {\n+        def result = zigbee.getEvent(description)\n+\n+        if(result) {\n+            sendEvent(result)\n+        } else {\n+            // zigbee.getEvent was unable to parse description. Description must be parsed manually.\n+        }\n+    }\n+\n+The ``zigbee.getEvent()`` method can parse the following event types with work being done to for additional event types:\n+\n+================== =================\n+Event Type         Cluster value\n+================== =================\n+switch             0x0006\n+level              0x0008\n+power              0x0702 and 0x0B04\n+colorTemperature   0x0300\n+================== =================\n+\n+.. note::\n+    Only color temperature can be parsed. Full color control is in the works.\n+\n+.. note::\n+    For the power event type, the value can be reported in mW, W, or kW. This means that it is up to the developer to make adjustments to the value before calling sendEvent so it will be displayed correctly.\n+\n+Low Level Commands\n+------------------\n+\n+zigbee.command()\n+~~~~~~~~~~~~~~~~~~~~\n+\n+Send a cluster specific command.\n+\n+**Signature:**\n+    .. code-block:: groovy\n+\n+        zigbee.command(Integer cluster, Integer command, [String... payload])\n+\n+**Parameters:**\n+    - **cluster**: The cluster ID\n+    - **command**: The command ID\n+    - **payload** (optional): Zero or more arguments required by the command. Each argument should be passed as an ASCII hex string in little endian format of the appropriate width for the data type. For example, to pass the value 5 for a UINT24 (24-bit unsigned integer) you would pass “050000”.\n+\n+**Examples:**\n+    - Send *Move To Level* command to *Level Control* cluster.\n+        .. code-block:: groovy\n+\n+            zigbee.command(0x0008, 0x04, \"FE\", \"0500\")\n+\n+        Where *Level* equals ``0xFE`` (full on) and *Transition Time* equals ``0x0005`` (5 seconds)\n+\n+    - Send 'Off' command to *On/Off* cluster.\n+        .. code-block:: groovy\n+\n+            zigbee.command(0x0006, 0x00)\n+\n+----\n+\n+zigbee.readAttribute()\n+~~~~~~~~~~~~~~~~~~~~~~\n+\n+Read the current attribute value of the specified cluster.\n+\n+**Signature:**\n+    .. code-block:: groovy\n+\n+        zigbee.readAttribute(Integer cluster, Integer attributeId)\n+\n+**Parameters:**\n+    - **cluster**: The cluster ID to read from\n+    - **attributeId**: The ID of the attribute to read\n+\n+**Example:**\n+    - Read *CurrentLevel* attribute of the *Level Control* cluster.\n+        .. code-block:: groovy\n+\n+            zigbee.readAttribute(0x0008, 0x0000)\n+\n+----\n+\n+zigbee.writeAttribute()\n+~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Write the attribute value of the specified cluster.\n+\n+**Signature:**\n+    .. code-block:: groovy\n+\n+        zigbee.writeAttribute(Integer cluster, Integer attributeId, Integer dataType, value)\n+\n+**Parameters:**\n+    - **cluster**: The cluster ID to write\n+    - **attributeId**: The Id of the attribute to write","path":"ref-docs/zigbee-ref.rst","position":161,"original_position":161,"commit_id":"6faf43284ab7058bf4df838669da56b26068465f","original_commit_id":"6faf43284ab7058bf4df838669da56b26068465f","user":{"login":"tpmanley","id":144884,"avatar_url":"https://avatars.githubusercontent.com/u/144884?v=3","gravatar_id":"","url":"https://api.github.com/users/tpmanley","html_url":"https://github.com/tpmanley","followers_url":"https://api.github.com/users/tpmanley/followers","following_url":"https://api.github.com/users/tpmanley/following{/other_user}","gists_url":"https://api.github.com/users/tpmanley/gists{/gist_id}","starred_url":"https://api.github.com/users/tpmanley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpmanley/subscriptions","organizations_url":"https://api.github.com/users/tpmanley/orgs","repos_url":"https://api.github.com/users/tpmanley/repos","events_url":"https://api.github.com/users/tpmanley/events{/privacy}","received_events_url":"https://api.github.com/users/tpmanley/received_events","type":"User","site_admin":false},"body":"In other places this is described as \"attribute ID\" instead of \"Id\" so I think this could be rewritten to just `The attribute ID to write`","created_at":"2015-12-06T19:39:37Z","updated_at":"2015-12-06T19:39:37Z","html_url":"https://github.com/SmartThingsCommunity/Documentation/pull/215#discussion_r46774740","pull_request_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215","_links":{"self":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/comments/46774740"},"html":{"href":"https://github.com/SmartThingsCommunity/Documentation/pull/215#discussion_r46774740"},"pull_request":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215","id":52305580,"html_url":"https://github.com/SmartThingsCommunity/Documentation/pull/215","diff_url":"https://github.com/SmartThingsCommunity/Documentation/pull/215.diff","patch_url":"https://github.com/SmartThingsCommunity/Documentation/pull/215.patch","issue_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/215","number":215,"state":"open","locked":false,"title":"Initial Documentation commit of new zigbee utility class","user":{"login":"unixbeast","id":3129335,"avatar_url":"https://avatars.githubusercontent.com/u/3129335?v=3","gravatar_id":"","url":"https://api.github.com/users/unixbeast","html_url":"https://github.com/unixbeast","followers_url":"https://api.github.com/users/unixbeast/followers","following_url":"https://api.github.com/users/unixbeast/following{/other_user}","gists_url":"https://api.github.com/users/unixbeast/gists{/gist_id}","starred_url":"https://api.github.com/users/unixbeast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unixbeast/subscriptions","organizations_url":"https://api.github.com/users/unixbeast/orgs","repos_url":"https://api.github.com/users/unixbeast/repos","events_url":"https://api.github.com/users/unixbeast/events{/privacy}","received_events_url":"https://api.github.com/users/unixbeast/received_events","type":"User","site_admin":false},"body":"@workingmonk @tpmanley @jimmyjames \r\n\r\nPlease review and let me know whether or not you would like me to make changes to this starting point for the zigbee utility stuff.","created_at":"2015-12-01T19:45:00Z","updated_at":"2015-12-06T19:39:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50e581986bc5ae3f92db19cc45577c3db36a7fcf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215/commits","review_comments_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215/comments","review_comment_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/215/comments","statuses_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/statuses/6faf43284ab7058bf4df838669da56b26068465f","head":{"label":"unixbeast:master","ref":"master","sha":"6faf43284ab7058bf4df838669da56b26068465f","user":{"login":"unixbeast","id":3129335,"avatar_url":"https://avatars.githubusercontent.com/u/3129335?v=3","gravatar_id":"","url":"https://api.github.com/users/unixbeast","html_url":"https://github.com/unixbeast","followers_url":"https://api.github.com/users/unixbeast/followers","following_url":"https://api.github.com/users/unixbeast/following{/other_user}","gists_url":"https://api.github.com/users/unixbeast/gists{/gist_id}","starred_url":"https://api.github.com/users/unixbeast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unixbeast/subscriptions","organizations_url":"https://api.github.com/users/unixbeast/orgs","repos_url":"https://api.github.com/users/unixbeast/repos","events_url":"https://api.github.com/users/unixbeast/events{/privacy}","received_events_url":"https://api.github.com/users/unixbeast/received_events","type":"User","site_admin":false},"repo":{"id":45515193,"name":"Documentation","full_name":"unixbeast/Documentation","owner":{"login":"unixbeast","id":3129335,"avatar_url":"https://avatars.githubusercontent.com/u/3129335?v=3","gravatar_id":"","url":"https://api.github.com/users/unixbeast","html_url":"https://github.com/unixbeast","followers_url":"https://api.github.com/users/unixbeast/followers","following_url":"https://api.github.com/users/unixbeast/following{/other_user}","gists_url":"https://api.github.com/users/unixbeast/gists{/gist_id}","starred_url":"https://api.github.com/users/unixbeast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unixbeast/subscriptions","organizations_url":"https://api.github.com/users/unixbeast/orgs","repos_url":"https://api.github.com/users/unixbeast/repos","events_url":"https://api.github.com/users/unixbeast/events{/privacy}","received_events_url":"https://api.github.com/users/unixbeast/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/unixbeast/Documentation","description":"SmartThings Documentation","fork":true,"url":"https://api.github.com/repos/unixbeast/Documentation","forks_url":"https://api.github.com/repos/unixbeast/Documentation/forks","keys_url":"https://api.github.com/repos/unixbeast/Documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unixbeast/Documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unixbeast/Documentation/teams","hooks_url":"https://api.github.com/repos/unixbeast/Documentation/hooks","issue_events_url":"https://api.github.com/repos/unixbeast/Documentation/issues/events{/number}","events_url":"https://api.github.com/repos/unixbeast/Documentation/events","assignees_url":"https://api.github.com/repos/unixbeast/Documentation/assignees{/user}","branches_url":"https://api.github.com/repos/unixbeast/Documentation/branches{/branch}","tags_url":"https://api.github.com/repos/unixbeast/Documentation/tags","blobs_url":"https://api.github.com/repos/unixbeast/Documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unixbeast/Documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unixbeast/Documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/unixbeast/Documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unixbeast/Documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/unixbeast/Documentation/languages","stargazers_url":"https://api.github.com/repos/unixbeast/Documentation/stargazers","contributors_url":"https://api.github.com/repos/unixbeast/Documentation/contributors","subscribers_url":"https://api.github.com/repos/unixbeast/Documentation/subscribers","subscription_url":"https://api.github.com/repos/unixbeast/Documentation/subscription","commits_url":"https://api.github.com/repos/unixbeast/Documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/unixbeast/Documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/unixbeast/Documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/unixbeast/Documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/unixbeast/Documentation/contents/{+path}","compare_url":"https://api.github.com/repos/unixbeast/Documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unixbeast/Documentation/merges","archive_url":"https://api.github.com/repos/unixbeast/Documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unixbeast/Documentation/downloads","issues_url":"https://api.github.com/repos/unixbeast/Documentation/issues{/number}","pulls_url":"https://api.github.com/repos/unixbeast/Documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/unixbeast/Documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/unixbeast/Documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unixbeast/Documentation/labels{/name}","releases_url":"https://api.github.com/repos/unixbeast/Documentation/releases{/id}","created_at":"2015-11-04T04:27:39Z","updated_at":"2015-11-04T04:27:40Z","pushed_at":"2015-12-03T22:39:42Z","git_url":"git://github.com/unixbeast/Documentation.git","ssh_url":"git@github.com:unixbeast/Documentation.git","clone_url":"https://github.com/unixbeast/Documentation.git","svn_url":"https://github.com/unixbeast/Documentation","homepage":null,"size":17408,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SmartThingsCommunity:master","ref":"master","sha":"6c2068985dae0a6425c29c7208514a97de98d8a7","user":{"login":"SmartThingsCommunity","id":7317431,"avatar_url":"https://avatars.githubusercontent.com/u/7317431?v=3","gravatar_id":"","url":"https://api.github.com/users/SmartThingsCommunity","html_url":"https://github.com/SmartThingsCommunity","followers_url":"https://api.github.com/users/SmartThingsCommunity/followers","following_url":"https://api.github.com/users/SmartThingsCommunity/following{/other_user}","gists_url":"https://api.github.com/users/SmartThingsCommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/SmartThingsCommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmartThingsCommunity/subscriptions","organizations_url":"https://api.github.com/users/SmartThingsCommunity/orgs","repos_url":"https://api.github.com/users/SmartThingsCommunity/repos","events_url":"https://api.github.com/users/SmartThingsCommunity/events{/privacy}","received_events_url":"https://api.github.com/users/SmartThingsCommunity/received_events","type":"Organization","site_admin":false},"repo":{"id":19958585,"name":"Documentation","full_name":"SmartThingsCommunity/Documentation","owner":{"login":"SmartThingsCommunity","id":7317431,"avatar_url":"https://avatars.githubusercontent.com/u/7317431?v=3","gravatar_id":"","url":"https://api.github.com/users/SmartThingsCommunity","html_url":"https://github.com/SmartThingsCommunity","followers_url":"https://api.github.com/users/SmartThingsCommunity/followers","following_url":"https://api.github.com/users/SmartThingsCommunity/following{/other_user}","gists_url":"https://api.github.com/users/SmartThingsCommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/SmartThingsCommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmartThingsCommunity/subscriptions","organizations_url":"https://api.github.com/users/SmartThingsCommunity/orgs","repos_url":"https://api.github.com/users/SmartThingsCommunity/repos","events_url":"https://api.github.com/users/SmartThingsCommunity/events{/privacy}","received_events_url":"https://api.github.com/users/SmartThingsCommunity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SmartThingsCommunity/Documentation","description":"SmartThings Documentation","fork":false,"url":"https://api.github.com/repos/SmartThingsCommunity/Documentation","forks_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/forks","keys_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/teams","hooks_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/hooks","issue_events_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/events{/number}","events_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/events","assignees_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/assignees{/user}","branches_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/branches{/branch}","tags_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/tags","blobs_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/languages","stargazers_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/stargazers","contributors_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/contributors","subscribers_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/subscribers","subscription_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/subscription","commits_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/contents/{+path}","compare_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/merges","archive_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/downloads","issues_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues{/number}","pulls_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/labels{/name}","releases_url":"https://api.github.com/repos/SmartThingsCommunity/Documentation/releases{/id}","created_at":"2014-05-19T21:34:35Z","updated_at":"2015-11-28T11:05:24Z","pushed_at":"2015-12-04T16:13:05Z","git_url":"git://github.com/SmartThingsCommunity/Documentation.git","ssh_url":"git@github.com:SmartThingsCommunity/Documentation.git","clone_url":"https://github.com/SmartThingsCommunity/Documentation.git","svn_url":"https://github.com/SmartThingsCommunity/Documentation","homepage":null,"size":17686,"stargazers_count":55,"watchers_count":55,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":9,"forks":61,"open_issues":9,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215"},"html":{"href":"https://github.com/SmartThingsCommunity/Documentation/pull/215"},"issue":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/215"},"comments":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/SmartThingsCommunity/Documentation/statuses/6faf43284ab7058bf4df838669da56b26068465f"}}}}