[SOLVED] Is it possible calling a rule in openhab using a http url

  • Platform information:
    • Hardware: Raspberry PI 4
    • OS: OpenHabian
    • openHAB version: 4.1.1

Is it possible to call a rule with a http link and maybe also passing a parameter?
I`m using shellys and they are working.
But if the state of a shelly is changed by a wallswitch the reported state in the item is updated by the entered polling time. So rules which are listening to this state are triggerd with a very different time.
I would like to make a rule checking the state and write it to my item.
I would like to place this link into the shelly action that is called by changing the state of the output.

Search for webhook binding under marketplace in addons store.
Apart from that I have not experienced such a behavior of Shelly devices. Better check your configuration first. Shelly devices normally send events straight away if a wall switch switches a Shelly input channel.

Oliver’s advice is solid. I would say the two options he’s suggested are:

Best option) don’t turn this into an X-Y problem and just troubleshoot your shelly configuration.

Easiest option) use the webhook binding to change the state of items which, in turn, trigger your rule

There’s one other that is the most accurate answer to your question based on out of the box openHAB:

Native option) Send a payload to the rules runnow API endpoint. This is different than the webhook option because there is no intervening additional item, you inject values directly into a rule context and cause that rule to run. It is more complicated than the webhook option because you will need to work with API authentication. The webhook provides unsecured access to the items linked to its channels and in most cases this is just fine because you are only going to use it in your own LAN behind a firewall.

1 Like

Someone else had a similar problem earlier this week. Their solution might not apply (since you’re using openHABian and they aren’t), but if you’re using Gen1 Shelly devices then you have to enable CoIoT.

1 Like

Thank`s to all.
I removed the shellys from my things. Searched them by scan an added them again.
After that the state was reported at once