Device Variables in a message or Http Request

I am trying to send device data to a Http endpoint on my own website. I know we have %device% and %value% as variables, but what other options do I have?

I'd like to send an http request that contains the device ID and temperature on my smartthing multisensors, but I cannot find any documentation on this :frowning: Is it possible? If so, what other device variables do I have access to?

I know how to work with global variables, but I just need device variable information to send!

Thank you!

You can use local or global variables in your http string.

So, if you wanted to send the device ID of something, first create a local variable to hold it (of type string). Then, populate it, then include it in your http string. For device ID, you'll need to hard code that from the device as there's no way to get that through RM.

However, with this said, I think I have an idea of what you are trying to do (a dashboard or logging?) and I'd suggest using Maker API and/or event socket. Instead of having HE send out a http post, instead, have your website query HE for the data or connect on the event socket to capture events as they happen.

Thanks for the response corerootedxb. I checked out the Maker API and I might be able to use that for polling the device. So I can make a call to my endpoint to say, "hey, a device was changed during a rule event", then the endpoint could poll for that device and detect the variation. Seem clunky and maybe not worth it if I cant just send what I want to the endpoint right away. I looked at the local variable thing and it seems I have to hardcode the local variable since I cannot get the device id. Here is rule i want to run:

IF (Time between 7:45 PM CDT and 6:00 AM CDT(F) AND
Kid's Door ,Kid's Door 2 any open(T) AND
NOT Mode in Away, Day(F) [FALSE]) THEN
On: Google Hub Activation
Speak on What Did you Say: '%device% is open'
Off: Google Hub Activation --> delayed: 0:00:15
Send POST to: myurl.whatever/api/contacts -->(json) body: {
"api_token": "mysecrettokenforsimplifiedauthorization"

I'm trying to post a url encoded payload to a Google Form that is linked to a Google Sheets so I can log sensor values over time. I have seen many references to %device% and %value% but I haven't been able to find much on what that syntax references or how to get data from a specific device. I created local variables for my rule and would like to simply post those values to an endpoint. I tried what I think is the sytnax for accessing Hub Variables {variableName}, but the syntax doesn't seem to resolve to the variable value in the posted payload.

entry.427={Temp Value}&entry.698={Humidity Value}&entry.014={Lights Energy}&entry.386={Fan Energy}&entry.460={Heater Energy}&entry.489={Luminance}%

From digging around the community, I feel confident it is possible to insert the variable values into the payload, just need a bit more guidance on how to access variable data.

I'm using RM 5 to trigger a Send POST action


I think I answered my own question after digging through some additional community questions.

Would still love more detailed guidance on how to work with variables, but using the below syntax my local variables are now resolving to the expected values in the POST:

entry.427=%Temp Value%&entry.698=%Humidity Value%&entry.014=%Lights Energy%&entry.386=%Fan Energy%&entry.460=%Heater Energy%&entry.489=%Luminance%

In the hook catcher I use for testing:

Form values
entry_427 76
entry_698 56
entry_014 6
entry_386 0
entry_460 17
entry_489 1950