I am migrating my OpenHAB installation from 2.4.0 where the legacy exec1 binding is used to 3.0.1.
I use the EXEC binding to restart and reboot my Windows 10 computer on which OpenHAB is running.
The exec1 binding was easy to use:
OH2.4 .items
Switch IP_HS5150_Exec_R "IP_HS5150_Exec [%s]" {exec="ON:shutdown /r /t 10"}
Switch IP_HS5150_Exec_S "IP_HS5150_Exec [%s]" {exec="ON:shutdown /s /t 10"}
OH2.4 .rules
sendCommand(IP_HS5150_Exec_R, ON)
Thread::sleep(5000)
sendCommand(IP_HS5150_Exec_R, OFF)
and
sendCommand(IP_HS5150_Exec_S, ON)
Thread::sleep(5000)
sendCommand(IP_HS5150_Exec_S, OFF)
Now for OpenHAB3. Using Belkin Wemo - Bindings | openHAB for a reference, I have:
OH3 .things (OH3 says it has parsing errors)
Thing exec:command: ExecRestart [command="ON:shutdown /r /t 10", interval=15, timeout=5, autorun=false]
Thing exec:command: ExecShutdown [command="ON:shutdown /s /t 10", interval=15, timeout=5, autorun=false]
-
1 - I get a
Things
parsing error. My syntax must be wrong but comparing the documentation and google threads I don’t see the problem. -
2 - I’m new to `things’. I have wemo running for the 1st time and those channels do not require “Thing” at the beginning of each line. Is it needed here?
OH3 .items
Switch IP_HS5150_Exec_R "IP_HS5150_Exec [%s]" {channel="exec:"ExecRestart", autoupdate="false"}
Switch IP_HS5150_Exec_S "IP_HS5150_Exec [%s]" {channel="exec:"ExecShutdown", autoupdate="false"}
- I think this is correct. Do you agree?
OH3 .rules
IP_HS5150_Exec_R.sendCommand(ON)
Thread::sleep(5000)
IP_HS5150_Exec_R.sendCommand(OFF)
and
IP_HS5150_Exec_S.sendCommand(ON)
Thread::sleep(5000)
IP_HS5150_Exec_S.sendCommand(OFF)
- I think this is correct. Do you agree?
OH3 .whitelist (I’m totally guessing at the syntax here because I can’t find any reference documentation for OH3)
"shutdown /r /t 10"
"shutdown /s /t 10"
- The whitelist file is named “exec.whitelist”. I assume that to be correct in that it does not follow the naming convention for
.items .things .sitemaps .rules
etc. Again, I have no clue for correct syntax
Thanks in advance for your help.