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:*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”
Item TestSwitch changed
sendHttpPostRequest(“*DeviceID*”, “application/json”,‘{“attr”:{“fanc”:“1”}}’)

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.