Parse POST Body in local/cloud endpoint trigger

TLDR;

I am trying to easily integrate "Sleep as android" in hubitat.

I want to post events to a rule that look like this

{
"event": "variable event name I need to parse"
}

In an ideal world, I'd select local endpoint, and I'd have an additional option to define a variable name and a JSON path so $.event gets picked up. Or at least the whole payload into something like %payload%.

Wanted to avoid implementing a device/app. I know there's IFTTT... But I want to build on the webhook option so it all stays local and with the RM local endpoint it feels like it is almost there.

Any ideas out there?

Were you able to figure this out? I'm trying to avoid using Zapier to filter and would rather do it directly in Hubitat. Based on my testing it appears that webhooks are a binary trigger and you can't configure them to grab data/json from the webhook.

1 Like

If you format it correctly, you can get a value from the URL into the rule or you can set a string Hub Variable. See Rule Machine API