Is it possible to add spaces in the exex binding ?
I mean “Shutdown_via_smarthome” is ok for now. But a text like “Shutdown via Openhab. Your Computer will turn off in 2 Minutes” would be better (including spaces)
Second question: is it possible to give this switch a third state like “Abort” to cancel the shutdown process?
i mean there are commands, but how can i tell OpenHAB the third state?
I’m not entirely certain what you are asking. But if you mean whether you can have spaces in an Item name, the answer is no. Spaces are not permitted in an Item name. And even if it were, remember that the Item name is basically code. Your suggested “Shutdown via Openhab…” is absolutely not better when you have to refer to the Item in the sitemap or in your rules.
However, your “better” name makes an excellent label. See the Item wiki page and the sitemap wiki page for how to assign a label to your Items. For example:
Switch Shutdown_via_smarthome "Shutdown via Openhab. Your Computer will turn off in 2 Minutes" {exec...
Sorry for the confusion. I mean if is possible to name the exec binding
parameters with spaces, to inform the user about the upcoming shutdown.
This string needs spaces. But the exec binding can’t handle spaces.
It is the ‘-C Shutdown_via_smarthome’ parameter. The output at the client
side should be ‘Shutdown via smarthome’ (without the underscores)
Thanks for your investigation.
Now i managed to start and cancel a shutdown.
I did a small change in the item config (it does not work with two exec="> definitions in the binding section )
You’d need to escape the "… which I am not sure you can or not.
As a work around, you can just create a one line shell script which executes this for you, but contains the string as you’d like it… then just execute the script with the exec binding.
Thanks for your help, I will use executecommandline instead.
I got now some issues with the wol binding, it wakes up my computer once I start openhab. Is there a setting like the ‘autoupdate=false’ which would fix this wake on Lan behavior
In looking at your multi-select statement in the sitemap, the 0 option will trigger the WOL… so this is likely what is happening upon boot.
Why not create a 0 = nothing option, and move all of your other selections out by one number? The action will only happen on a change anyway, so changing from nothing to WOL. This may solve your problem.