Send POST command to Harmony API


#1

1) Give a description of the problem
I’m trying to send a POST command to the Harmony API. I’ve got the API running, but don’t understand the syntax of a POST command for: /hubs/harmony-living-room/devices/direct-tv-dvr/skip-forward?repeat=6 => {message: “ok”}

Doing some research, I see some folks mentioning port-forwarding and external IP addresses. I don’t have any experience with this.

2) What is the expected behavior?
I want my DVR to SKIP-FORWARD 6 times when called (to skip over all commercial breaks)

3) What is happening/not happening?
Nothing’s happening

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)


#2

I figured out how to carry the forward slashes in the URL as a string, but it’s telling me there’s a variable in the text


#3

That’s because you aren’t setting it up correctly. First off, if you want to get status, it would be a get message to this url:

http://192.168.1.96:8282/hubs/harmony-living-room/status

That’s it. Nothing in the body of the message. But then you have to parse the response. Do you see now what that is equaling?


#4

I think you are making it more complicated than it needs to be. If I read this right,
http://192.168.1.96:8282/hubs/harmony-living-room/devices/direct-tv-dvr/skip-forward?repeat=6
is the URL you are to use in the POST command (second picture in your first post).

Do not send any variables (same picture), and you don’t need the variable you set up (HarmonyAPI).

The =>{message: “ok”} bit means that is the response the API should send back. You don’t really even need that since you aren’t doing anything with it.

(Port forwarding will only apply if you are trying to do stuff from outside your house. If the smartthings hub and harmony hub are on the same network it is unnecessary.)