]> git.basschouten.com Git - openhab-addons.git/commitdiff
[harmonyhub] Updated README to get buttonPress values with the new REST API implement...
authorJerry Gallo <23113287+2wyck3d@users.noreply.github.com>
Tue, 13 Jul 2021 06:16:33 +0000 (23:16 -0700)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 06:16:33 +0000 (08:16 +0200)
* fixed typo in example
* Updated the instructions on how to find buttonPress values

openHAB 3.X put the REST API behind authorization and the old URL no longer works in the browser due to an authentication error. These new instructions allow for a trivial way to find the commands.

Signed-off-by: Jerry Gallo <2wyck3d@gmail.com>
bundles/org.openhab.binding.harmonyhub/README.md

index 7bcf39fb09315679e6b49e9ab1bdddd8d86db344..e1891cfc5bfb4e4dfe41b8f6cdf1a53bcc5e32e0 100644 (file)
@@ -148,5 +148,44 @@ Example subset of values for the current activity "buttonPress" channels
 Mute,VolumeDown,VolumeUp,DirectionDown,DirectionLeft,DirectionRight,DirectionUp,Select,Stop,Play,Rewind,Pause,FastForward,SkipBackward,SkipForward,Menu,Back,Home,SelectGame,PageDown,PageUp,Aspect,Display,Search,Cross,Circle,Square,Triangle,PS,Info,NumberEnter,Hyphen,Number0,Number1,Number2,Number3,Number4,Number5,Number6,Number7,Number8,Number9,PrevChannel,ChannelDown,ChannelUp,Record,FrameAdvance,C,B,D,A,Live,ThumbsDown,ThumbsUp,TiVo,WiiA,WiiB,Guide,Clear,Green,Red,Blue,Yellow,Dot,Return,Favorite,Exit,Sleep
 ```
 
-A complete list of names for device buttons values can be determined via the REST API for channel-types, <http://YourServer:8080/rest/channel-types>.
-Search the JSON for "harmonyhub:device".
+A complete list of names for device buttons values can be determined via the REST API for channel-types. The easiest way to do this is through the API explorer:
+
+1. Go to the main UI page for your installation
+    * This is usually at <http://your-openhab-ip:8080> or, in the case of openhabian, <http://openhabian:8080>
+2. Login if you are not already logged in
+3. Using the left panel (or three bars on the upper left corner) go to Developer Tools -> API Explorer -> channel-types
+4. Click `GET` next to `/channel-types`
+5. Click `Try it out`
+6. Click `Execute`
+7. Search the `Response Body` "harmonyhub:device" and find your device in the JSON output
+
+The valid commands (read: values) will be listed with the device. For example, the response body might show that for `harmonyhub:device:HarmonyHub:lasko_fan` the valid commands are `PowerToggle, Speed, Timer`
+
+     {
+        "parameters": [],
+        "parameterGroups": [],
+        "description": "Send a button press to device Harmony Device",
+        "label": "Send Button Press",
+        "itemType": "String",
+        "kind": "STATE",
+        "stateDescription": {
+          "readOnly": false,
+          "options": [
+            {
+              "value": "PowerToggle",
+              "label": "Power Toggle"
+            },
+            {
+              "value": "Speed",
+              "label": "Speed"
+            },
+            {
+              "value": "Timer",
+              "label": "Timer"
+            }
+          ]
+        },
+        "tags": [],
+        "UID": "harmonyhub:device:GreatRoom:lasko_fan:buttonPress",
+        "advanced": false
+      }