Send command to an Item from .sh script

Hello

Is there a way to send a command / update to an item from a .sh script ?

I only find a solution from oh to a .sh script but not form an .sh script to oh …

Thanks

You can use the REST API of OH to update items:

http://docs.openhab.org/configuration/restdocs.html

E.g. Switching My_Item OFF by issuing an http POST request:

curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "OFF" "http://ip_openHAB_host:8080/rest/items/My_Item"
2 Likes

Thank you very much ! :slight_smile: