Replacement for physicalgraph.device.HubAction command on ST

That particular call should work if you just change physicalgraph to hubitat. There are more things you can do, possibly differently than on ST, but I believe that code should work otherwise (assuming that you have method, path, and headers defined somewhere, as must have also been the case with that snippet).

That being said, Hubitat has HTTP methods you can use without using HubAction at all, e.g., httpGet(). The "regular"/synchronous varieties of these should be about equivalent to the HubAction on either platform. Hubitat also has a vareity of asynchttp...() methods that I would strongly encourage you to use instead unless you really need the synchronous behavior (most notably: the async methods won't hold your code up while it waits for a response but instead wake your app/driver back up with the callback method when needed). These are all documented-ish here:

https://docs.hubitat.com/index.php?title=Common_Methods_Object

However, for the async calls, this post (by a former staff member, likely the one who wrote the hub code that actually implements these methods) probably has better information:

Good luck!

2 Likes