InControlCMD2 – Command Line control of InControl HA Devices

incontrol_icon

InControlCMD is over a year old now and while it was good at the time I decided to rewrite it from scratch to incorporate some features I have always wanted it to do.

So may I present InControlCMD2 – an new and improved version of the original InControlCMD.

Download InControlCMD2

The new version sports the following features:

– Toggle: The ability to toggle a device from its current state. If it’s on then turn it off and vice versa.
– Turn a device on or off (or set a specific power level) by device name as well as device guid.
– Multiple device support: turn a bunch of devices on or off at once by device name or guid.
– Query: run a query of a device’s power level and return it as %ERRRORLEVEL% for batch processing.

Setup:

1. Extract the zip to it’s own folder
2. Update the settings.xml with your InControl’s Hostname, Port, Username and Password. Typically 1178 is the listening port for InControl’s web services.
3. Run from command line as per the usage instructions below.

Usage:

InControlCMD2.exe --build

First things first let’s query InControl and build a database of devices in InControl. If you add a new device or change a device’s name you will need to re-run this command to rebuild the list of devices available to InControlCMD2.

InControlCMD2.exe --power 99 --name "Bedroom Lamp","Lounge Lamp"

Turn device(s) on by name. Multiple devices can be separated by commas. Set a device to a power level of zero (0) to turn it off.

InControlCMD2.exe --query --name "Bedroom Lamp"

Get the power level of the device and return it as the %ERRRORLEVEL% return code. Useful for batch operations.

InControlCMD2.exe --toggle --name "Bedroom Lamp"

My new favourite. Toggle a device from off to on depending on its current state. Really useful if you want to automate some on/off commands through EventGhost for remotes etc.

--verbose

Appending the verbose switch to any of the commands above will output what’s happening to the console. Useful for testing.

--help

Show all commands and associated help text.

Enjoy the utility – it is especially handy if you have some legacy systems you would like to be able to control your ZWave devices via InControl.
I use this tool pretty much everyday in automation tasks at home and I hope that other people will find it useful.

Couple this plugin with my Wemo InControl Plugin or InComputerControl (coming very soon!) Plugin and you start to have a very powerful system that can also control your Wemo devices or even turn on and off your PC’s via InControl.

Hit me in the comments if you need help and happy automating!
TheNinja.

InControlCMD2 – Command Line control of InControl HA Devices was last modified: January 28th, 2015 by admin
  • smwein

    I can’t seem to get this to work with Incontrols Wemo Plugin. Thx

    • adamcaz

      I’m unsure of if Incontrol’s Wemo Plugin is different to mine but this utility should work with any device that is visible in your InControl Device List.

      The switch -sv (superverbose) is really helpful to show you the full web call that is occurring which may help.

  • ron

    in windows xp i get a message that the .exe is not a valid win32 application.

    • adamcaz

      Hi Ron, sorry I don’t have an XP machine so I can’t really test this for you unfortunately. It will work however from Windows 7 and above though. :)

  • EH

    Hi, I tried running a –help query and got an unhandled exception. I have .net versions up till 4.5 installed. The event log shows faulting module kernelbase.dll
    Do you have any pointers as to what I should try next?

    • adamcaz

      Hi EH, my apologies – as a side project it doesn’t have a a lot in the way of error trapping and therefor the error messages are very generic.

      Please make sure that your settings.xml file has the appropriate information for your Incontrol Server including the correct port, ip address and password. It will more than likely crash if this info isn’t accurate. :)

      • EH

        Does it work with InControl 4?
        I verified the settings.

  • Galen Shotkey

    have you considered publishing the source code? I would like to debug it, as it is crashing on me. A download would suffice, as a repo is not necessary. I will post my changes here.