Very simple: Send a value into OH to be assigned to an item .... but how?

Using the rest API of openHAB2 and a HTTP post command in your script would be the easiest.

You can also use a PUT command, but you’ll have to load the classicui for it to work.