I'm trying to get the device ID of whatever device triggered a rule. %device% gives the name, but is there any way to get the ID?
No -- but there might be another way to do what you are wanting to actually do if you explain what that is.
I wrote a webservice to capture and store events in SQL, as well as act upon events in certain ways that Hubitat cannot. Right now, everything is identified by name, since that's the only option I have.
I was hoping I could reference devices by ID, since that is unique, and doesn't change when the name changes.
How is your web service interacting with Rule Machine? Maybe Maker API or another app that uses device IDs as part of the calls would work better (you can also use that ID to get the name -- or do anything else the API supports).
I use Maker API, but I thought it was only inbound. Can you send stuff OUT from a Maker API app?
Here's an example rule. I use a post to send it over
Look carefully at the Maker docs (in the app itself), and find where it mentions POST. You could use that to your advantage, such that device events are transmitted to the selected URL.
OK. Thank you. I will take a look at that
Here's the docs on that feature
Take a look at @fblackburn’s node-red integration for Hubitat.
He uses both the undocumented websocket interface on HE as well as MakerAPI for ther remote system to receive events from HE.
Commands from the other side are sent via MakerAPI.
That was an adventure. I changed what I needed to and can see Maker API trying to hit my service, but stuff's not working.
I finally install a packet sniffer and see that the data is actually wrapped in it's own node. That was unexpected.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
