sendHttpPostRequest Format

  • Platform information:
    • Hardware: Raspberry Pi
    • OS: Openhabian
    • openHAB version: openHAB 3.3.0
  • Issue of the topic:

I’m trying to control the Rituals Genie scent diffusor and was making first steps via REST (with Postman).
In Postman, this command is working:

https://rituals.sense-company.com/api/hub/update/attr?hub=*DeviceID*&json={“attr”:{“fanc”:“0”}}

But when i try to send this via rule, it doesn’t do anything:

rule “React on TestSwitch change/update”
when
Item TestSwitch changed
then
sendHttpPostRequest(“https://rituals.sense-company.com/api/hub/update/attr?hub=*DeviceID*”, “application/json”,‘{“attr”:{“fanc”:“1”}}’)
end

I’ve also tried to send the full string from Postman, but also no success.

Any ideas on what I’m doing wrong?

Did you try it via a thing - item/button setup?

I did a similar implementation for my Samsung AC, maybe the config helps.

Thank you for the quick answer.

Do you mean adding a button to an Overview, oder creating a Thing via the HTTP Binding?

Actually the problem will be, that I cannot enter a plain link, because i’d need to hand on the “POST” Method.

I don’t have one so practically I can’t help … Googling a bit showed up this thread RESTful or not? Rituals Perfume Genie - Configuration - Home Assistant Community
I would do some trials with curl first.

I’d be a bit suspicious about quotemark handling there, you may need to escape them.