Change Status of Item remotely with Win Desktop Shortcut

  • Platform information:
    • Raspberry Pi4 and Windows 10 PC for RemoteAccess
    • OS: _OH 2.5.0 Stable Openhabian with NodeRed for Rules

Hello Openhabhab Community,

I was searching the forum but couldnt find an answer. Hope someone can help.

Is there a way to have some kind of file or Shortcut for execute on a Windows Desktop to change remotely a status of an item (for example Switch Off to On) on my Openhab Raspberry (also with NodeRed).

For explanation. I have a NodeRed-Flow for Turning On and Off my Windows Computer Setup ( Smartplugs getting triggered at different delays and remote command for Shutdown )

It would be nice to be able to trigger this flow directly from Deskop too.

Thanks :slight_smile:

Using BasicUI with a sitemap showing (just) that switch would work on any device with a browser!

1 Like

Investigate REST API - this gives one pretty universal way to remotely update or command an Item with an HTTP url.

I’m not sure how you could embed an HTTP POST request in a Windows shortcut, but that is not an openHAB question. Maybe a little batch file.

1 Like

Thank you very much for the tip to bring me in the right direction with that. Didnt expected it to be so easy.

Just for others who have the same usecase:

I created a Textfile “PC OFF.txt” on the Desktop:

Inside i have this text:

curl -X POST --header “Content-Type: text/plain” --header “Accept: application/json” -d “OFF” “http://“myIP”:8080/rest/items/PC-Item”

Then I renamed it with the ending .bat

Now i can execute this .bat File and it will Change my Item Status to OFF.