# \[SOLVED\] Use URL to manipulate items in OH2?

**URL:** <https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732>\
**Category:** 1.x Compatibility\
**Created:** [March 17, 2016, 5:26pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732 "2016-03-17T17:26:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farhanito](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/34f0e0/32.png) [@Farhanito](https://community.openhab.org/u/Farhanito)\
**Post date:** [March 17, 2016, 5:26pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/1 "2016-03-17T17:26:05Z")

</div>

`> http://<openhab-host>:8080/CMD?<item>=<state>`

This URL is not working on OH2. Is there something similar?

Thanks

---

<div class="post-metadata">

**Author:** ![dynostatic](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@dynostatic](https://community.openhab.org/u/dynostatic)\
**Post date:** [March 17, 2016, 5:43pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/2 "2016-03-17T17:43:45Z")

</div>

Sending commands via GET request doesn’t work in OH2. I believe that GET was intended only for updating the status of an item, but somehow also worked for commands in OH1. You will need to send commands using a POST to the rest api.

Relevant section from the wiki:

“In order to send a command to an item, you would use the item uri ([http://localhost:8080/rest/items/Temperature\_FF\_Office](http://localhost:8080/rest/items/Temperature_FF_Office)) and send an HTTP POST with the according command in the request body as text/plain.”

---

<div class="post-metadata">

**Author:** ![Farhanito](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/34f0e0/32.png) [@Farhanito](https://community.openhab.org/u/Farhanito)\
**Post date:** [March 18, 2016, 4:25am UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/3 "2016-03-18T04:25:51Z")

</div>

Bummer.  
Is it possible to send commands to multiple items at once using HTTP POST method?

I’m used to send commands like this..  
`> http://<openhab-host>:8080/CMD?<item1>=<state>&<item2>=<state>`

---

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [March 18, 2016, 7:50am UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/4 "2016-03-18T07:50:21Z")

</div>

The CMD servlet and REST API are different. The CMD servlet lets you send GET requests of the form `<itemName>=<command>` in order to send commands to items.

Under OH2, have you tried `http://host:port/classicui/CMD?itemName=command`

---

<div class="post-metadata">

**Author:** ![Farhanito](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/34f0e0/32.png) [@Farhanito](https://community.openhab.org/u/Farhanito)\
**Post date:** [March 18, 2016, 8:04am UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/5 "2016-03-18T08:04:08Z")

</div>

> [@watou](#):
>
> Under OH2, have you tried [http://host](http://host):port/classicui/CMD?itemName=command

Bingo!

thanks @watou, it works.

---

<div class="post-metadata">

**Author:** ![dynostatic](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@dynostatic](https://community.openhab.org/u/dynostatic)\
**Post date:** [March 18, 2016, 6:50pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/6 "2016-03-18T18:50:15Z")

</div>

Classicui works! Nice to know it’s still there. I couldn’t find a reference to that change anywhere.

---

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [March 18, 2016, 6:56pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/7 "2016-03-18T18:56:09Z")

</div>

> [@dynostatic](#):
>
> Classicui works! Nice to know it’s still there. I couldn’t find a reference to that change anywhere.

Yes, it looks like isn’t mentioned [here](https://github.com/openhab/openhab-distro/blob/master/docs/sources/migration.md). Could you submit a pull request on that document, or would you like me to?

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [March 18, 2016, 7:04pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/8 "2016-03-18T19:04:12Z")

</div>

Well, it mentions that “the Classic UI URL has changed from /openhab.app to /classicui/app”.

Note that the CMD servlet is an internal part of the Classic UI that is NOT meant to be used by anybody else (although it is of course possible). But as it is not an official feature, I would claim it should also not be documented.

The way to interact with external systems is clearly the REST API.

---

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [March 18, 2016, 7:06pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/9 "2016-03-18T19:06:43Z")

</div>

> [@Kai](#):
>
> But as it is not an official feature, I would claim it should also not be documented.

Makes sense.

---

<div class="post-metadata">

**Author:** ![Marty56](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@Marty56](https://community.openhab.org/u/Marty56)\
**Post date:** [March 14, 2017, 5:01pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/10 "2017-03-14T17:01:51Z")

</div>

> [@watou](#):
>
> [http://host](http://host):port/classicui/CMD?itemName=command

I am trying to use this url. Has this been removed when releasing OH2 recently.

---

<div class="post-metadata">

**Author:** ![modestoss](https://community.openhab.org/user_avatar/community.openhab.org/modestoss/32/70779_2.png) [@modestoss](https://community.openhab.org/u/modestoss)\
**Post date:** [July 17, 2017, 8:19pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/11 "2017-07-17T20:19:54Z")

</div>

It worked for me.

---

<div class="post-metadata">

**Author:** ![narf27](https://community.openhab.org/letter_avatar_proxy/v4/letter/n/8797f3/32.png) [@narf27](https://community.openhab.org/u/narf27)\
**Post date:** [August 13, 2017, 5:43pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/12 "2017-08-13T17:43:35Z")

</div>

doesn’t work for me on openHAB 2.1.0-1  
has the url changed?

---

<div class="post-metadata">

**Author:** ![Dragonfly](https://community.openhab.org/user_avatar/community.openhab.org/dragonfly/32/77023_2.png) [@Dragonfly](https://community.openhab.org/u/Dragonfly)\
**Post date:** [October 8, 2017, 4:31pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/13 "2017-10-08T16:31:28Z")

</div>

> [@Kai](#):
>
> Note that the CMD servlet is an internal part of the Classic UI that is NOT meant to be used by anybody else (although it is of course possible). But as it is not an official feature, I would claim it should also not be documented.
> 
> The way to interact with external systems is clearly the REST API.

That´s a pity - ie Grandstream phones like the GXV3240 are able to send HTTP-GET commands.  
To trigger an action in OH i need to send the request to the CCU, the CCU tells OH that someone is calling, OH is muting my Squeezebox…

I don´t know if i should use the Classic-UI for this - who knows how long it is supported!?

---

<div class="post-metadata">

**Author:** ![MatthiasUlrich](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b9bd4f/32.png) [@MatthiasUlrich](https://community.openhab.org/u/MatthiasUlrich)\
**Post date:** [December 2, 2017, 9:28am UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/14 "2017-12-02T09:28:25Z")

</div>

Hi as a GET Request it works for me. I have te Problem that the Geofency App only supports Post Requests. The Locative App suppots GET Requests but the IBeacon trigger does not work.

Any Ideas?

---

<div class="post-metadata">

**Author:** ![Schrott.Micha](https://community.openhab.org/user_avatar/community.openhab.org/schrott.micha/32/22121_2.png) [@Schrott.Micha](https://community.openhab.org/u/Schrott.Micha)\
**Post date:** [December 6, 2019, 5:54pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/15 "2019-12-06T17:54:47Z")

</div>

Hi Matthias,

I installed the [“REST API” UI](https://www.openhab.org/docs/configuration/restdocs.html) with this you can see all possible commands for the RestApi is a really pretty way.

This should show you a solution.

---

<div class="post-metadata">

**Author:** ![Piotr\_Bojko](https://community.openhab.org/user_avatar/community.openhab.org/piotr_bojko/32/50845_2.png) [@Piotr\_Bojko](https://community.openhab.org/u/Piotr_Bojko)\
**Post date:** [June 15, 2021, 7:50pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/16 "2021-06-15T19:50:30Z")

</div>

Hello,

Thought this is an old thread but I thought I can share a new approach for this case.

With this binding [[webhook] New, very simple binding for listening incomming http requests](https://community.openhab.org/t/httplistener-new-very-simple-binding-for-listening-incomming-http-requests/123597) you can create some webhooks straight in openhab for your third party tools and devices.

Regards  
Piotr

---

<div class="post-metadata">

**Author:** ![stonke](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stonke](https://community.openhab.org/u/stonke)\
**Post date:** [April 10, 2022, 2:12pm UTC](https://community.openhab.org/t/solved-use-url-to-manipulate-items-in-oh2/8732/17 "2022-04-10T14:12:19Z")

</div>

Looks like very old thread but helped me kind of 😉

It works to send commands through URL if tried with your example BUT is it somehow possible to connect with https address too (and not only http)?
