bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

Execute bat files #616

Closed herbiems89 closed 7 years ago

herbiems89 commented 7 years ago

Im trying to run a bat file via the HABridge but even after reading trough https://github.com/bwssytems/ha-bridge/issues/197 i still cant get it to work :/

I tried it like this:

image

and i get this error:

image

I also tried it like this:

image

And i actually got a success confirmation:

image

However it doesnt actually work. If i run the bat manually it works. Im running HABridge on Windows Server 2012R2. Any advice? :)

tuicemen commented 7 years ago

Try just typing in the path _C:\pstools\shutdowndesktop.bat

herbiems89 commented 7 years ago

Doesnt help either :( It shows the same success confirmation as my try with cmd.exe in front of it, but it doesnt do anything either. I´d like to have a look in the logs, can you tell me where i can find them under windows?

tuicemen commented 7 years ago

bridge logs are under logs scroll down to logging configuration to set the views you wish. Have you set the device type (informational) to Execute Script/program ?

herbiems89 commented 7 years ago

Yes i have, this is what the whole page looks like.

image

tuicemen commented 7 years ago

Have you set your windows firewall inbound rules to allow java? I run a very simular batch fie to turn on/off my PC display. When you say it works manually, is that clicking on the bat file or running the command from CMD?

herbiems89 commented 7 years ago

Sorry for not responding sooner. I figured it out. It seems that if you call a bat via HA-Bridge the bat doesnt start in the folder where you saved it, like it normally does. Instead you have to navigate to said folder via the cd command, then it works.

But thanks for your help anyway :)