Hi!
I want to send a value from a bash into openhab to assign to value into a variable. I do not want to pull the value via a repeated poll of the variable.
I thought MQTT might be a possible way - or is there a more easy / simple way ???
Maybe I misunderstood your questionâŠ
So you would like to run something within a bash âscriptâ I assumeâŠ
and the result of it you would like to set some item to certain status?
I would suspect this could be done using a local (scripted) ssh connection to OH console.
In the way of:
I can use the restapi to switch - but when I send a value, I see in the log file:
âŠItem âwetter_esp1_humidâ received command 20.0
âŠwetter_esp1_humid predicted to become 38.34
So the value arrives - is interpreted as an command - and not used ??
As this seems to be more of a âsensorâ type value, humidity? it might make more sense to use REST API to send it as a state update.
That would have it act more like conventional bindings to real devices.
Itâs up to you to choose how to use REST API
That comes from the autoupdate feature. It listens for commands to an Item, guesses the effect on the state.
It is enabled/disabled per Item, and is active by default.
Note it does not act (is not needed) when you update rather than command.
If your Item happens to have UoM specified, you may also need to specify units in your command/update, or automatic scaling could kick in.
Donât you mean GET? You can command or update an Item using HTTP GET with classicui installed. With the REST API, POST results in a command to the Item and PUT results in an update to the Item.