Google Search

Custom Search

Powered by...

Find us on Facebook

Showing posts with label mcontrol. Show all posts
Showing posts with label mcontrol. Show all posts

Thursday, 21 February 2013

mControl update iOS app to version 1.1.2559

I was very pleased to see an update today for the mControl iOS app. Seems they have fixed some things and now I am able to control Z-wave Door Sensors, Motion Sensors and a IP Camera Motion Sensor (Foscam), these are all devices in VeraLite as I am using the mControl Vera Luup Driver.
What's New in Version 1.1
Added new devices to the app
-Added Generic device support
-Added simplified chines language
-Fix Camera streaming
-Added ZigBee ON/OFF/Dimmer device support
-Added ZigBee meter Device support
-Fix thermostat bug
-Fix reconnect issues
Goto Bed, Arm House, Disarm House are all scenes within VeraLite not macros in mControl. Not sure why it says 0 next to them?
117

However I can now run these Vera scenes from the mControl iOS app.

Before this update it was not possible to run Vera scenes via the mControl iOS app, there was previously no Run button, it would just say Label and you couldn’t select anything.

118

Goto Bed VeraLite scene in the mControl iOS app.

119

Porch (Room) – The Porch Sensor is an Everspring motion sensor, you can see the mControl iOS app is correctly displaying the status of this sensor.

124

I can now Arm or Disarm (Bypass) this motion sensor using the mControl iOS app. Previously before this new update, all security sensors would just say Label next to them and you couldn’t control them.

120

Back Garden (Room) – The camera sensor you can see is the on-board motion sensor on my outdoor Foscam IP Camera, which I integrated in to VeraLite using the miOS Foscam add-in. This enables you to use the Foscam’s motion sensor as a regular motion sensor device in Vera, which you can trigger scenes off.

125

I can now Arm or Disarm the Foscam motion sensor in the updated mControl iOS app.

121

Kitchen (Room) – Patio Door sensor is an Everspring Door / Window sensor device again this device is setup in VeraLite.

123

mControl iOS app can now control this door sensor and Arm / Disarm it.

122

Living Room – Nothing new here, the three devices are all Z-wave devices setup in VeraLite, which mControl can see and control via the Vera Luup Driver. The Macros are actually macros setup in mControl and not Vera Scenes in this case.

126

Looks like the mControl mobile webpage needs updating as well, still missing buttons for some Vera devices.

127

Always nice to see updates from mControl, I just wish they were a bit quicker.

If mControl do one thing, they ought to create an XBMC add-in like their excellent Windows Media Center add-in, that would be at the top of my mControl feature wish list.

For more information about mControl and their products visit their website here.

Tuesday, 6 November 2012

Major mControl update coming soon

Products - mControl Banner

Via Embedded Automation - We are setting up to release a major revision and it includes the following: Release date is scheduled for 1st week of December.

• Major Feature added – 24/7 Surveillance system:
• Continues recording of IP cameras
• RTSP camera support • H.264 MP4 recording of all camera
• Transcoding of mpeg/mjpeg camera to h.264 MP4
• Camera streaming to clients enhanced
• Steaming playback of recordded surveillance video
• Simplified scheduler to setup recording
• URL Rewrite Authentication/Authorization
• Added persistence setting for drivers
• Added logic for notifications for Email/SMS:
• Added central location for SMTP and SMS settings
• Added support for multiple email/SMS account notification
• Added custom body and subject to email/SMS action
• Added email/SMS forwarding camera url action for quick view
• Added support for TekMar - A high efficiency HVAC system
• Added Simplified Chinese support
• Added EnOcean support – wireless lighting and sensor protocol
• Room controller
• Low voltage control
• Light sensors
• Temperature sensor
• Door/Window sensors
• Occupancy sensors
• Thermostats
• Other combination devices
• Enhancements:
• Added Zwave locks through VeraLite
• Windows and door sensors support through VeraLite
• Fix Thermostat through VeraLite

and other minor bug-fixes.

I am interested in the VeraLite additions and fixes, hopefully these will resolve the issues I reported to mControl support.


Friday, 5 October 2012

Home Automation with Windows Media Center (mControl V3) integrated with VeraLite

I recently purchased a Micasaverde VeraLite Z-wave home automation gateway device, this is a small low powered router like box that becomes the primary controller of your wireless Z-wave network. Z-wave devices are things like plug-in lamp and appliance modules, replacement wall light switches, door contact sensors and PIR motion sensors, sirens, smoke alarms, key fobs and hand held controllers and more. VeraLite can control all of these types of Z-wave home automation devices, you have unlimited options for scenes, rooms, timers, events and notifications. You can read more about Vera3 and VeraLite here.


mControl by Embedded Automation is an excellent PC based home automation software suite similar to products like HomeSeer. Embedded Automation also offer a low powered embedded device called mStation, which unfortunately I haven’t had the opportunity to try out.
I have been using the mControl software for a few years now and recently upgraded from version 2.1 to their latest version 3. mControl is more comprehensive than Vera as, it can control many more types of home automation systems and devices. Some information from the mControl product page:

mControl v3 is the next generation of Embedded Automation's award-winning Digital Home Software platform. In addition to providing all of the features and functionality of mControl v2, mControl v3's platform provides many new advancements:
  • Built-in support for Embedded Automation's mBee line of ZigBee wireless technologies
  • mControl Editor - universal browser-based configuration and administration interface
  • Advanced surveillance with N-up camera display - allowing real-time streaming of standard and hi-definition IP cameras (using popular streaming standards)
  • Native iPad/iPhone App - free download from the Apple App Store mRemote (with Module Maker) - integrated remote control interface with device editor allows integration of virtually any serial, IP or infrared (IR) device
  • Enhanced mobile user interface - optimized for smart phone browsers
  • Data Logging infrastructure - captures history of status and events for analysis and when used with Embedded Automation's mChronicle utility, allows data to be sent to cloud databases for advanced analytics and charting
  • Enhanced database allows for device and macro reuse, and nested zones
  • RESTful API provides a simplified method for building apps around the mControl engine
  • Many other core and driver enhancements ... more to come
For home owners, mControl v3 provides unrivalled value for home monitoring and control - without expensive and awkward plans. mControl v3 also provides our partners a scalable platform for advanced solutions. From making your personal home a better place or deploying an energy management solution to a range of homes, mControl v3 is the foundation for the Digital Home.
image

The reason why I got in to using mControl is because of their brilliant Windows Media Center MCML add-in. This allows you to control your home from all the TV screens in the house. When I changed my primary Z-wave controller to VeraLite I was keen not to lose this functionality, I did try to integrate my existing mControl V2.1 installation with Vera but I came across some issues that I was unable to resolve, Embedded Automation support recommended I should upgrade to V3 and now everything is working. I have to say the guys at the Embedded Automation are very good and always answer my questions, which is more than I can say for the support at Micasaverde which seems to be lacking and I did not always receive a response from them and when I did it wasn’t that helpful. The upside is that the Vera user forums are much more active than the mControl ones and the expert users on the Vera forum are great and really helped me out with setting up my Vera installation.
    First we will take a look at the mControl Media Center add-in that I see on my TV screens and then I will discuss how I integrated VeraLite with mControl.
    It is possible to run scenes that have been configured in Vera from the mControl user interfaces, this screen shot shows some of the Vera scenes I have added in to mControl for example Goto Bed, Arm Doors and Disarm doors, when I click Run on one of these, mControl sends a HTTP command to the Vera box for it to run the scene.

    image

    I am also able to control Z-wave PIR sensors via the mControl interface, remember all these Z-wave devices are associated with the VeraLite box as the primary Z-wave controller, yet using the mControl Vera Luup Driver we can still use the mControl interface and have it send HTTP commands to the Vera box to control these devices and scenes. On this screen shot you can see I can Arm and Disarm my porch PIR sensor and the current status of that sensor is displayed. I can also turn on and off the Porch light which connected to a Z-wave wall switch module.

    image

    This is the Living Room zone, the lamps are connected to Z-wave plug-in dimmer modules and the electric fireplace is connected to a plug-in appliance module. The scenes you can see in this screen shot (Lounge On, Dim Lounge 75, Dim Lounge 50, Dim Lounge 25) are actually scenes I have created in mControl Editor rather than scenes that are in VeraLite, but most of my scenes are now configured and setup in VeraLite rather than in mControl.

    image

    Kitchen zone, in here I have a Z-wave dimmable wall switch connected to the main ceiling lights, I also have a plug-in Z-wave appliance module connected to my LED lighting that is in the kitchen. See my previous LED Lighting project posts for more about that! You can also see a Patio Door sensor, this is a Z-wave door contact sensor that can be armed and disarmed, if the door is opened whilst the door sensor is armed a Z-wave siren in the house will sound off at 90DB. Also if it’s night time when the armed door is opened, all the lights inside and outside the house will automatically turn on, I also receive email notifications for events such as these. Again you can see more mControl created scenes (Kitchen On, Dim Kitchen 75, Dim Kitchen 50).

    image

    One new development since using VeraLite is that using a Foscam add-in for Vera I am now able to use the motion detector on the outdoor Foscam IP camera and trigger scenes in Vera upon motion. This means I have a new Camera Sensor device showing, I was unable to do this with mControl. On this screen shot you can see an appliance module for the LED lighting in the garden, the Security Camera which the live feed can be viewed on the TV screen, and the new Camera Sensor device which can be armed / disarmed.

    image

    Master bedroom, not much going on in here, just a plug-in dimmable lamp module.

    image

    Likewise in the Kids Bedroom.

    image

    Activities – These scenes or macro’s as they are called in mControl are all scenes created using the mControl Editor rather than in VeraLite.

    image

    Here’s a few screen shots of the new mControl V3 mobile webpage:

    There does seem to be some limitation with the mControl Vera Luup Driver here, as you can see below there are no buttons to Arm or Bypass security sensors, but I can do this in mControl for Windows Media Center no problem. Hopefully Embedded Automation can resolved this.

    image

    image

    image

    Embedded Automation as of mControl V3 now have native iOS applications for iPhone, iPod Touch and iPad.



    One thing to note if you are an existing mControl V2.1 user with mPanels, mControl V3 does not support mPanels and my desktop software mPanel has stopped working.

    mControl V3 – VeraLite integration

    I previously had installed mControl V2.1 on to my WHS V1 server, that version of mControl had a proper WHS add-in for the console. Version 3 of mControl no longer supports WHS console and therefore I have lost the WHS Console add-in for mControl. This is not a big deal however. The new mControl V3 applications are based on SilverLight so they open in the browser now.

    image

    mControl Editor

    The mControl Editor is used to setup and configure mControl, this is where you can created your zones (rooms), configure mRemote which is a software remote control, IP Cameras, Devices, Macros (scenes) and more.

    image

    mControl Service Manager

    The service manager is where you setup and configure drivers. You can see from the screen shot below mControl and control allot of different systems, like Rako, Lutron, Somfy, ELK alarms panels, Insteon and more.

    Before I got my VeraLite unit, mControl was being used as the primary Z-wave controller using the Z-wave Controller driver and an Aeon Labs Z-stick 2 USB dongle. Since VeraLite is now my primary Z-wave controller I have no need to use the Z-wave Controller driver in mControl and I have sold my Aeon Labs Z-stick.

    image

    What I am using now in the mControl Services Manager is the Vera (Luup) Driver and I will take a look at this now and how you set this up. You can see the Vera Luup Driver is using HTTP to send requests to the primary Z-wave controller aka the VeraLite box. I am also using the WMC (Windows Media Center) Controller, this allows me to automatically dim and brighten lights when I play / pause video content in Media Center but that’s another blog post I think.

    image

    If you click to Configure the Vera Luup Controller you will see this dialogue. All you need to do in here is specify the internal IP address of your Vera box and then save and restart the mControl Server service.

    image

    We can now start adding devices and scenes in to mControl, but first we need to get a list of these devices and scenes that are already setup in the Vera. To do this enter this URL in to your browser, where the IP address is the IP of your Vera / VeraLite box.

    http://IP-Address/port_3480/data_request?id=lu_sdata&output_format=xml

    You will then see a page with XML code, from this page you can find the ID numbers of the devices and scenes in Vera, so for example I am going to add a device in to mControl for my Lamp (Left) in the living room. If I find that device from the XML code, I can see its device ID number is “3”

    <device name="Lamp (Left)" altid="2" id="3" category="2" subcategory="0" room="1" parent="1" status="0" level="0" state="-1" comment=""/>

    Adding a device

    Armed with this information I can now add a new device in to mControl for this lamp. Go to the mControl Editor and click the Devices tab and click the New button, you will then see this dialogue:

    image

    From the Adapter drop down menu select Vera Luup Controller

    image

    Under the Module drop down menu you can select the type of Z-wave device that you are configuring, you can also select scene from here to run a Vera scene. As we are setting up a dimmable lamp module in this example, select Dimmable Light.

    image

    One thing I really don’t like about Vera is the lack of the ability for users to pick and change device icons which is highly frustrating. However you don’t have that problem in mControl, select the desired icon for your Z-wave device, I picked the lamp icon.

    image

    Enter a name for the new device and enter the devices ID number in Vera, as we already established the ID number for this particular lamp module in Vera is 3. You can also adjust the Dim/Bright by % the default is 20%. Click OK to create your first Vera device in mControl.

    image

    The new device is then added to the list of devices. If you select the Zones Associated tab you can then associate this new device to a zone or room. This lamp is in the Living Room so right click the Living Room zone from the pane on the right and select Add Device Shortcut.

    You should be able to test your device from this screen, click the On / Off / Bright / Dim buttons etc does the lamp respond correctly?

    image

    Adding a scene

    To add a new device into mControl that can run a Vera scene, you would do the following:
    First you need to find out what the scene ID number is in Vera? I have an existing scene in Vera called “Lounge On” I now want to create a new device in mControl that can run this scene.
    Use that URL I gave earlier to load that page with the XML code on it, then find the scene from the list. As you can see my “Lounge On’ scene is ID number “1”

    <scene active="0" name="Lounge On" id="1" room="1"/>

    Now from the Devices tab in the mControl Editor select the New button again.
    Again name the device, select Vera Luup Driver, this time under module select Scene, choose an icon and specify the scene number – in this example its “1” Click OK

    image

    The new device to run the Vera scene is then listed under the device tab, again we can associate this device to a zone as before. Test the device by clicking the Apply button to run the Vera scene. The Vera scene should then be executed.

    image

    If I open the mControl Windows Media Center add-in you can see the two new (Test) devices I have just created are now visible in Media Center.

    image

    Summary

    As you can see for Windows Media Center users mControl is a great product, even for none Windows Media Center users mControl is still a powerful PC home automation system. I am very happy with mControl V3 and glad I upgraded from mControl V2.1 now that the Vera Luup Driver is working properly and this has enabled me to integrate my VeraLite Z-wave network with the mControl user interfaces. I just hope Embedded Automation have plans for an XBMC add-in?

    If you are interested in purchasing a MicasaVerde Vera Z-wave system or any Z-wave home automation devices, or are looking for a consultant to help you with your own project, you can contact me as I am an authorised dealer and can supply to you these products at slightly cheaper prices than the main UK Z-wave online stores.
    www.phaze1digital.com

    Thursday, 16 August 2012

    mControl & VeraLite integration nightmare!

    largeVERA-LITE
    Most of you who read my blog will know I am a mControl Home Automation user and I’ve done several posts about mControl in the past. I decided to sign up for a dealership with Micasaverde and purchase a VeraLite unit for testing. My plan was always to keep mControl as its integrated in to Windows Media Center on every TV in the house!
    I was told by a friend of mine that he had successfully integrated mControl & Vera using the mControl Vera Luup Driver. With my original setup with mControl I was using an Aeon Labs Z-stick as the primary Z-wave controller, this was connected to the back of the WHSV1 server where mControl is installed. The plan when VeraLite box arrived was to use the VeraLite as the primary Z-wave controller and then use the mControl Vera Luup Driver which sends HTTP requests to Vera to control your lights and other devices, thus making the Z-stick totally redundant and no longer required. This all sounded great however now I have got the VeraLite box up and running the integration between the two systems has not gone as smoothly as I would have liked and there are two big problems that are making this integration a no go.
    I have done a YouTube video explaining what these two problems are and until I get them resolved my mControl installation is now basically broken!
    The problems in short are:
    1. Device status not being correctly updated in mControl UI - Turn lamp on via mControl UI and mControl does not update the status of the device and shows it as still OFF when actually the lamp has turned on OK. Also the dim level stays at 0% when should be 100% (Vera Luup Device Type = Dimable Light).
    2. ON button not working properly for appliance modules - The off button in mControl UI does work and the ON button also turns off the appliance. ON button does not turn on the appliance module.
    (Vera Luup Device Type = Binary Light)
    Watch the Youtube video to see what I mean, this is a call out to any other mControl and Vera or VeraLite users that have got this setup and working for any advise or possible solutions.
    There is a 3 page thread I started on the Micasaverde forum about these issues, also one here and one here on the mControl forums. I don’t know who originally wrote the mControl Vera Luup driver? I have contacted mControl support but no reply as yet. I may now contact Micasaverde support as well see if they know anything? Although I have contacted them a few days ago about another question of how to make the Z-stick a secondary to VeraLite being primary controller as I see this as a plan B if I can’t get the mControl Vera Luup driver working, but I’ve not heard from their support either yet! Not sure how long is a normal wait time?
    I am really liking Vera however in the few days I have been using it, I bought it mainly so I could have timers for lights coming on and off that will work when the mControl WHS server is in sleep mode. But Vera is showing to be a very powerful and cheap Z-wave Home Automation gateway solution. I will probably do some blog posts about Vera when I have got it all setup and know how stuff works more.

    Tuesday, 30 August 2011

    How to use command line with mControl and Amulet / Harmony remotes

    Background:

    I am currently using mControl version 2.1.3818 installed on my WHS V1 server for use with my Z-WAVE lights. I have a few Z-Wave plug-in lamp modules and use the Aeon Labs Z-Stick USB dongle which is plugged in to the WHS box. mControl have an nice MCML add-in for Windows Media Center and there are also mControl HTML webpages including a mobile version which I use on my iPod touch device. The other user interface which I tend to use on my laptop is the mPanel software that was ported to work on regular Windows PCs and not just their mPanel embedded Windows CE device which is now discontinued anyways. All this means I can control my lights from various user interfaces on different devices.

    mControl version 3 beta has a native iOS app for the iPhone but currently installing mControl beta 3 on WHS V1 or WHS 2011 is not supported which is why I haven’t upgraded as yet.

    mControl User Interfaces:

    mControl in Windows Media Center 7

    mControl – mPanel software

    mControl HTML webpage in Internet Explorer

    mControl mobile.aspx webpage

    The idea:

    My idea started when I was thinking about my Amulet MCE voice remote control, I knew it was possible to create your own custom voice commands to run external programs. My idea was simple wouldn’t it be kinda cool if I could pick up the Amulet voice remote and say “Lights On” and for the side lamps in my living room to turn on!

    Being able to send commands from my Windows 7 x64 HTPC to the mControl Web Service on my WHS has also enabled me to turn a regular IR Logitech Harmony remote control in to a remote that can also turn on and off my Z-Wave lamps, not only that I can now create buttons on my Harmony remote to run any mControl automation macros or send on/off commands to devices. So if you haven’t got an Amulet remote but do have a Harmony remote and your an mControl user, you might want to read on…

    Obviously being able to control anything via command line opens up a whole wealth of possible things you can do and automate.

    The discovery:

    So I started digging around a little in the mControl documentation and I found a possible solution, I found this link http://myWHS/mcontrol/mServer.asmx which when you open it on your mControl install it will bring up a page called mControl Web Service and looks like the screen shot below: (Change myWHS to the hostname of your mControl server).

    Scrolling down the list I saw two items of interest to me which were:

    RunMacro
    Send a macro run request to mServer

    SendCommand
    Sends automation command to a device

    Clicking on to these two items revealed some sample code for SOAP, now I am no programmer but I knew I was on the right lines and this might just be possible. I then raised the subject with Eddy Carroll at Amulet Devices and asked him what he thought about it and if it might be possible to have Amulet send these commands to mControl. Eddy who is a programmer unlike myself was able to assist me and as a result we have come up with a working solution which I will demonstrate.

    Below are the samples from the mControl Web Service webpage:

    RunMacro

    Send a macro run request to mServer

    SOAP 1.1

    The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

    POST /mcontrol/mServer.asmx HTTP/1.1
    
    Host: whs01
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://embeddedautomation.com/webservices/mControl/RunMacro"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <RunMacro xmlns="http://embeddedautomation.com/webservices/mControl">
    <macroId>int</macroId>
    </RunMacro>
    </soap:Body>
    </soap:Envelope>




    HTTP/1.1 200 OK
    
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <RunMacroResponse xmlns="http://embeddedautomation.com/webservices/mControl">
    <RunMacroResult>boolean</RunMacroResult>
    </RunMacroResponse>
    </soap:Body>
    </soap:Envelope>



    SOAP 1.2

    The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.


    HTTP/1.1 200 OK
    
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <RunMacroResponse xmlns="http://embeddedautomation.com/webservices/mControl">
    <RunMacroResult>boolean</RunMacroResult>
    </RunMacroResponse>
    </soap:Body>
    </soap:Envelope>


    HTTP/1.1 200 OK
    
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <RunMacroResponse xmlns="http://embeddedautomation.com/webservices/mControl">
    <RunMacroResult>boolean</RunMacroResult>
    </RunMacroResponse>
    </soap12:Body>
    </soap12:Envelope>


    SendCommand


    Sends automation command to a device

    SOAP 1.1

    The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.


    POST /mcontrol/mServer.asmx HTTP/1.1
    
    Host: whs01
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://embeddedautomation.com/webservices/mControl/SendCommand"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <SendCommand xmlns="http://embeddedautomation.com/webservices/mControl">
    <devId>int</devId>
    <command>string</command>
    </SendCommand>
    </soap:Body>
    </soap:Envelope>


    HTTP/1.1 200 OK
    
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <SendCommandResponse xmlns="http://embeddedautomation.com/webservices/mControl" />
    </soap:Body>
    </soap:Envelope>


    SOAP 1.2

    The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.


    POST /mcontrol/mServer.asmx HTTP/1.1
    
    Host: whs01
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <SendCommand xmlns="http://embeddedautomation.com/webservices/mControl">
    <devId>int</devId>
    <command>string</command>
    </SendCommand>
    </soap12:Body>
    </soap12:Envelope>


    HTTP/1.1 200 OK
    
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <SendCommandResponse xmlns="http://embeddedautomation.com/webservices/mControl" />
    </soap12:Body>
    </soap12:Envelope>

    The plan:
    Eddy suggested we might be able to use wGet using the --post-file=filename option, to send the SOAP commands in xml files to the mControl Web Service. 
    Getting started:
    wGet
    I installed wGet on to my Windows 7 HTPC, I also had to add the path of where wget.exe is located which on my x64 PC was C:\Program Files (x86)\GnuWin32\bin in to the Windows Environment Variables PATH. To do this right click Computer from the start menu and select properties, then select Advanced System Settings and the Environment Variables button, under system variables scroll down to PATH click Edit and add in the path to wget.exe be sure to separate with ;
    Creating mControl .cmd and .xml files
    Send ON Command to Device
    Next we need to create our first .cmd and .xml file, in this first example we will be creating a Send ON Command to a device.
    I created a new folder on my Windows Media Center PC called C:\Lights
    I then created a .cmd file called Lounge-On-Left.cmd, to do this just use notepad and create a new file change the .txt extension with .cmd
    I have two Z-Wave enabled lamps in my living room left and right. 
    Below is the contents of the C:\Lights\Lounge-On-Left.cmd file - note you need to change whs01 to the hostname of your own WHS or PC running mControl server. Also you can see the file that wGet is going to post to the mControl Web Service in this case the file is called Lounge-On-Left.xml

    wget -Onul --post-file="C:\Lights\Lounge-On-Left.xml" --header="Content-Type: text/xml; charset=utf-8" --header="SOAPAction: http://embeddedautomation.com/webservices/mControl/SendCommand" http://whs01/mcontrol/mServer.asmx

    Next we need to create the Lounge-On-Left.xml file, again use notepad to create a file and change the .txt extension to .xml below is the contents of the Lounge-On-Left.xml file.

    <?xml version="1.0" encoding="utf-8"?>
    
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <SendCommand xmlns="http://embeddedautomation.com/webservices/mControl">
    <devId>3</devId>
    <command>on</command>
    </SendCommand>
    </soap12:Body>
    </soap12:Envelope>

    Two things you need to look at in this xml file <devId> and <command> as we are creating a device ON xml file the command is on. <devId> is the device id of your device in mControl. To find out which of my Z-Wave modules had which devId? I simply opened mControl in Internet Explorer using the address http://whs01/mcontrol/ change the hostname obviously to your own. I then right clicked the page and selected View Source and scrolled down until I saw the device I was looking for in this case Lamp (Left) you can see I have circled the DevId which for this particular device is 3. So I used 3 in the <devID>3</devId> section of the xml file above.


    OK so you have now created your first set of files one .cmd and one .xml to test simply double click on the .cmd file you will see the command window pop up and your ON command should be sent to your device in mControl.


    Send OFF Command to Device


    Next you would want to create two more files for an OFF command, so I created a file called Lounge-Off-Left.cmd and Lounge-Off-Left.xml in to my C:\Lights folder


    Lounge-Off-Left.cmd contents:


    wget -Onul --post-file="C:\Lights\Lounge-Off-Left.xml" --header="Content-Type: text/xml; charset=utf-8" --header="SOAPAction: http://embeddedautomation.com/webservices/mControl/SendCommand" http://whs01/mcontrol/mServer.asmx


    Lounge-Off-Left.xml contents:


    <?xml version="1.0" encoding="utf-8"?>
    
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <SendCommand xmlns="http://embeddedautomation.com/webservices/mControl">
    <devId>3</devId>
    <command>off</command>
    </SendCommand>
    </soap12:Body>
    </soap12:Envelope>


    To test double click the Lounge-Off-Left.cmd file and your device should now be turned off.


    I repeated this process and created two more .cmd files and two more .xml files to turn my right lamp on and off. At this point I was able to manually run the .cmd files to turn on and off both lamps individually.


    Run Macro Command


    Next I wanted to create some Run Macro commands to turn both lamps on or off at the same time, I previously already created Macros in mControl to turn on or off both living room lamps together. On the below screen shot you can see these existing macros Lounge On and Lounge Off. I just needed to know what the MacroID was for each?



    Again I simply opened the mControl webpage in Internet Explorer and Viewed the Source code. Scrolled down and found my marcos called Lounge On and Lounge Off you can see I have circled the MacroID’s.




    With this information I was ready to create my first Run Macro .cmd file called Lounge-On.cmd


    Lounge-On.cmd Contents:


    wget -Onul --post-file=C:\Lights\Lounge-On.xml --header="Content-Type: text/xml; charset=utf-8" --header="SOAPAction: http://embeddedautomation.com/webservices/mControl/RunMacro" http://whs01/mcontrol/mServer.asmx
    


    I then need to create an associated .xml file with the SOAP command in it called Lounge-On.xml


    Lounge-On.xml Contents:


    <?xml version="1.0" encoding="utf-8"?>
    
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <RunMacro xmlns="http://embeddedautomation.com/webservices/mControl">
    <macroId>8</macroId>
    </RunMacro>
    </soap12:Body>
    </soap12:Envelope>


    I created another .cmd and another .xml called Lounge-Off.cmd and Lounge-Off.xml to be able to turn off the lamps, so now using these new Run Macro commands I could run either the Lounge On or Lounge Off macros in mControl to turn both lamps on and off.


    The next problem I had to solve was I did not want to see the command prompt windows flashing up on the screen over the top of Media Center, whenever they where run via the Amulet voice remote or the Harmony remote. I wasn’t sure about this so I posted a thread on the Green Button and Richard1980 came to my aid with a suggestion to use a .vbs file to call the .cmd files.

    The upshot of this is you can create a file in the C:\Lights folder called Run-CMD.vbs edit the .vbs file in notepad and paste into it the single line of code below, more about this later.


    CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


    So now what?


    Ok so now we have created a set of .cmd files and associated .xml files to send SOAP requests to the mControl Web Service, but you don’t want to be manually double clicking the .cmd files to make things happen, so we need to get these .cmd files working with our remote control(s).


    Custom Commands with Amulet voice remote control


    First up is the Amulet MCE Voice remote control, it is pretty easy to add your own custom voice commands in to Amulet and then have it run a .cmd file or any external program for that matter. First you need to locate a file in the C:\ProgramData\Amulet Devices folder called CustomCommands.txt edit this file.


    I simply added the following to the end of the file:

    Command=Lights On
    Response=Turning On Lounge Lights
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On.cmd

    Command=Lights Off
    Response=Turning Off Lounge Lights
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-Off.cmd


    Command=Left Lamp On
    Response=Turning On Left Lamp
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On-Left.cmd

    Command=Left Lamp Off
    Response=Turning Off Left Lamp
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-Off-Left.cmd

    Command=Right Lamp On
    Response=Turning On Right Lamp
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On-Right.cmd

    Command=Right Lamp Off
    Response=Turning Off Right Lamp
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-Off-Right.cmd

    Let me explain a little:


    Command=Lights On (You say “Lights On”)
    Response=Turning On Lounge Lights (Amulet then says back to you “Turning On Lounge Lights”)
    Action=Run C:\Windows\System32\WScript.exe C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On.cmd (Here you specify the .cmd file Amulet should run)


    Save the Custom Commands.txt file restart Media Center - that’s it, its as easy as that to get Amulet working with your new mControl commands.


    Logitech Harmony remote control


    Getting your new mControl .cmd files working with your Harmony remote is more tricky. I imagine there are various ways you can do this, I am using AutoHotKey so that is what I will be recommending. Go to this page and download the Installer for AutoHotkey_L Install AutoHotKey on to your Media Center PC and when you launch it for the first time it asks you if you want to create a sample script file in the Documents folder say yes. I would also recommend you add a shortcut to AutoHotKey in your Windows Startup folder so it starts at every boot.


    AutoHotKey will sit in the system tray and is a green icon with a H on it. If you right click this you can select Edit This Script and it will open in notepad.


    Below you can see my AutoHotKey script:


    Note: I am using a .vbs file called Run-CMD.vbs which calls the .cmd files as an argument and thus suppresses and totally hides the command windows from being visible on screen see here for more details.



    Now I am not an AutoHotKey expert but what we want to do here is assign a keyboard shortcut such as Ctrl+Alt+A and when that keyboard shortcut is used we want it to run one of our mControl .cmd files. Don’t ask me why but ^ = Ctrl and ! = Alt so ^!A = Ctrl+Alt+A


    Save and close your AutoHotKey script right click the H icon again in the system tray and select Reload This Script - To test press Ctrl+Alt+A using a keyboard connected to your Media Center PC this should run the mControl .cmd file and the device turn on or off or what ever the .cmd file is set to do.


    Now I used my MCE IR Keyboard like this one to teach my harmony remote the keyboard shortcuts i.e. Ctrl+Alt+A Ctrl+Alt+B and I then assigned those commands to a custom buttons on my Harmony’s LCD screen.


    If your using the Windows Media Center SE device in the Harmony software you could probably use some of the existing keyboard shortcuts like Alt+1 Alt+2 etc so then you wouldn’t need the IR MCE keyboard.


    On the below screen shot from the Logitech Harmony software you can see four keyboard shortcut commands I taught the remote



    Here you can see against my Media Center PC device and I also did this on some of my Activities I assigned custom buttons.



    Conclusion


    I think if you are an mControl user you will see the potential of being able to send SOAP commands using wGet to the mControl Web Service. This enables us to use .cmd files with associated xml files to run macros that are in mControl or control devices within your home automation system, I’m sure the possibilities are endless with this and it could be used in a variety of ways.


    For me personally I am now able to use my Amulet MCE voice remote and use custom voice commands to turn Z-Wave lamp devices on and off and also to run mControl macros. And yes it is pretty cool picking up the Amulet remote and saying “LIGHTS ON” and having the lamps in the room turn on! Would be even better with the Amulet software for XBOX Kinect you would just have to say the command out loud then.


    As an added bonus my regular IR Logitech Harmony remote control can now also be used to send commands to the mControl Web Service via AutoHotKey.


    Well I think I covered everything I did to set this all up, I wrote this so I wouldn’t forget how I did it later but hopefully someone else may find it of use, as always please leave your questions comments and feedback.


    You can download a copy of my sample mControl .cmd and .xml files plus an example of an Autohotkey script and a sample Amulet CustomCommands.txt file from here



    www.phaze1digital.com