PsShutdown and Openremote

General discussion about Open Source Automation
Post Reply
Message
Author
krish
Posts: 31
Joined: Sat Jun 30, 2012 3:50 pm

PsShutdown and Openremote

#1 Post by krish » Mon Dec 30, 2013 3:36 pm

Hi,
I'm trying to figure out how to trigger a powershell script to run from openremote, i.e. using just the REST api.

I've created my script and set the trigger to be an object event of my PC turning off. From openremote I then execute the off method for my PC, but as this doesn't trigger an event the script is never run. I'm also running the network monitor plugin so the state of my network devices are all updated on OSA, but I have a feeling this is the problem.

How else can I go about this?

Thanks

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: PsShutdown and Openremote

#2 Post by Automate » Mon Dec 30, 2013 6:55 pm

I don't have a clear picture of your setup. How many PCs and/or network devices are part of the setup? Are Openremote and OSA running on the same PC? If there are more than PC/device, which one is getting shutdown? Is the PS script supposed to shut it down or something else?

krish
Posts: 31
Joined: Sat Jun 30, 2012 3:50 pm

Re: PsShutdown and Openremote

#3 Post by krish » Tue Dec 31, 2013 3:26 am

Sorry should have been more clear.

OSA and openremote are both running on the same server. I've created a switch in openremote to turn on and off a different PC on the network. Currently openremote uses WOL to turn it on, and uses REST to send the off method for that PC.

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: PsShutdown and Openremote

#4 Post by Automate » Tue Dec 31, 2013 7:34 am

Have you tested that your script properly shuts down the PC?

You could use the REST api/namedscript/MyPatternMatch to trigger the script. This will require setting up a pattern associated with your shutdown script and then a pattern match associated to this pattern.

Post Reply