2019-07-18 08:26:13.525 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/pbalogo' with an invalid status value ''.
rule "testing batch"
when
Item pbalogo_file received command
then
var execresult = executeCommandLine( "C:\\openhab2\\conf\\scripts\\PBAplay.bat C:\\DOCS\\PBALogo.mp4", 3000)
logInfo("test", "result: " + execresult)
end
Put the value ON in the habpanel button and get this response but nothing runs:
2019-07-18 08:51:25.015 [ome.event.ItemCommandEvent] - Item 'pbalogo' received command ON
2019-07-18 08:51:25.026 [nt.ItemStatePredictedEvent] - pbalogo predicted to become ON
2019-07-18 08:51:25.034 [vent.ItemStateChangedEvent] - pbalogo changed from NULL to ON
2019-07-18 08:51:25.116 [vent.ItemStateChangedEvent] - pbalogo changed from ON to OFF
Don’t know why you did that. We already know that your batch file is being run by exec.
We don’t know if your batch file likes the parameter that is given to it. The output from the rule would be really useful.
The WARN message has nothing to do with the rule or the pbalogo_file that you were using from habpanel. But now you’ve decided to do something else, so I don’t suppose the rule gets triggered.
The WARN is about you not getting your pbalogo habpanel correct to begin with.
The batch file is not run, it starts the command processor, but doesn’t start the batch. I eliminated the parms and just let it execute the windows media player. but nothing ran. It seems to try to run in background without a window.
2019-07-18 15:19:20.821 [INFO ] [.eclipse.smarthome.model.script.test] - result:
C:\openHAB2\userdata>echo off
Press any key to continue . . .
'reg' is not recognized as an internal or external command,
operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.
'reg' is not recognized as an internal or external command,
operable program or batch file.
Hello, I am finally able to get back to this problem. I got the batch file to execute but I can’t get it to open a window to run the MP4 file. Here’s what shows on the log and event files.
LOG:
2019-08-15 09:26:31.924 [INFO ] [.eclipse.smarthome.model.script.test] - result:
C:\openHAB2\userdata>echo off
The operation completed successfully.
The operation completed successfully.
EVENTS:
2019-08-15 09:26:31.701 [ome.event.ItemCommandEvent] - Item 'pbalogo_file' received command ON
2019-08-15 09:26:31.702 [nt.ItemStatePredictedEvent] - pbalogo_file predicted to become ON
BATCH:
echo off
cd "C:\Program Files\Windows Media Player\"
C:\windows\system32\reg.exe add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 1 /f
wmplayer.exe C:\Docs\PBA_LOGO_SFLx.mp4 /fullscreen
C:\windows\system32\reg.exe add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 0 /f
THINGS:
Thing exec:command:pbalogo [ command="start /D C:\\openhab2\\conf\\scripts /I /MAX /REALTIME PBAplay.bat", interval=0 , autorun=false ]
ITEMS:
Switch pbalogo {channel="exec:command:pbalogo:run"}
String pbalogo_file {channel="exec:command:pbalogo:input"}