Powershell Module - Controll your Vera with Windows.

Hello
I have just rewritten the whole PowerShell module I earlier wrote and posted on github. The new version is much quicker and is able to merge all information into one object. If you?re not in to windows, don?t bother to read this post. But if you have an windows 7 or newer this module will provide quick access to your Vera on the same network.

It?s written about the old module here: Powershell modul för Hemautomation | Tips för ett smartare hem

The installation is now much simpler now, all that?s needed is Windows with management framework 5 (it includes PowerShell V5).

Then start powershell and run one of those commands to download and install it from Microsofts official Powershell Gallery.

To inspect it: Save-Module -Name AutomatiserarSE -Path
To install it: Install-Module -Name AutomatiserarSE

Currently supported commands (still converting the old module, more functions will be available soon)

Send-MJSpeak
Read-MJImageRGBPixel
Get-MjVeraMode
Get-MJVeraBackup
Get-MJVeraStatus
Set-MJVeraMode

Exampels

This will tell you what mode your Vera currently are in.

Send-MJSpeak -Message “Welcome, you are in mode $((Get-MjVeraMode -VeraIP vera ).mode)”

This will save an backup of your Vera to an compressed archive

Get-MJVeraBackup -VeraIP vera -DestinationPath C:\temp\

This will change mode on your vera to Vacation (unless it?s already in that mode)

Set-MjVeramode -VeraIP vera -NewVeraMode Vacation

This will provide you with all information vera has to offer as an single object.

Get-MJVeraStatus -VeraIP vera

// Ispep

Interesting. if I can run this version of PS on my WHS2011 server that would open up all kinds of possibilities…

I don?t know if management framework 5 is available on Windows Home server 2011, but if it?s available you will be able to run it. I think it should work on PowerShell V3 to) but then you need to download the module manually.

The main reason I writing this module is to use a lamina 7? tablet with windows 10 as a sub controller.

I will try to add more support into the module until I have all the basic tools.
My roadmap is to allow this module to control devices. List issues and do an health check on different settings in Vera :slight_smile:

IIRC WHS 2011 is Server 2008 R2 so if it works for Windows 7 it should work fine, they are basically the same underneath except what roles are available to install

I’m also confused on the Send-MJSpeak command, does this do something besides print to screen? I’m trying to figure out why I would use that vs just using Write-Host. Definitely great work though, i’m probably going to use this in my own setup too :slight_smile:

Yup, WHS2011 is a neutered version of Server2008. Pity MS abandoned it as it’s actually a pretty stable home server solution. Guess I’ll be updating PS on it this weekend. :slight_smile:

Send-mjSpeak reads information and use a voise to tell that information with your speakers (it?s using the Assembly System.speech :slight_smile:

[quote=“zolakk, post:4, topic:192614”]IIRC WHS 2011 is Server 2008 R2 so if it works for Windows 7 it should work fine, they are basically the same underneath except what roles are available to install

I’m also confused on the Send-MJSpeak command, does this do something besides print to screen? I’m trying to figure out why I would use that vs just using Write-Host. Definitely great work though, i’m probably going to use this in my own setup too :)[/quote]

Neat! Thanks for the clarification :slight_smile:

No problem :slight_smile:

Currently working on migrating my function for downloading web camera images, I will try to make it possible to use the DeviceVerbose class that provides IP, URL and username and password
to cameras. Will try to make a function that uses some thing like this:
$Result.DeviceVerbose | Where-Object {$_.device_file -match “D_DigitalSecurityCamera”} | foreach-object { the new function im writing now}

If you have any good id?e for a function that?s not available today, write what you would like and I will see if it?s possible to make it into the module :slight_smile:


**** 2016-06-08 - 23:30 ****


New version uploaded, version 1.7

Added support to download images from individual webcams with the following command:

Get-MJWebCamImage -WebcamIP 10.20.30.40 -Destination C:\Temp -SnapshotURL “image/jpeg.cgi”
Get-MJWebCamImage -WebcamIP 10.20.30.40 -Destination C:\Temp -SnapshotURL “image/jpeg.cgi” -RequireLogin -CamCredential (Get-Credential)

To download images from all cameras in Vera and save them to a local path use:

Save-MJVeraWebCamImages -VeraIP Vera -DestinationPath C:\temp\ # without username and password

Save-MJVeraWebCamImages -VeraIP vera -DestinationPath C:\temp\ -RequireLogin -VeraCredential (Get-Credential) # if you require username and password

Microsoft Powershell Gallery: PowerShell Gallery | AutomatiserarSE 1.7

Added support to turn binarylight devices on / off with both validation check on schema and status.

This command will connect to the controller named “Vera” and turn off device 80

   Set-MJVeraDevice -VeraIP vera -DeviceID 80 -Action OFF

Added support to turn devices on / off with validation check on schema and status. This command allows an array of ID to. This can be used to turn multiple devices off with one command line

   Set-MJVeraDevice -VeraIP vera -DeviceID 10,11,12,33,50 -Action OFF

   Set-MJVeraDevice -VeraIP vera -DeviceID 10,11,12,33,50 -Action ON

Added support to both download all images and add information on the picture from devices in the same room as cameras in vera.

Run this command in Powershell (V5) as administrator or (Install-Module -Name automatiserarse -Scope CurrentUser ) - To run as current user only

Install-Module -Name automatiserarse

Save-MJVeraImageWithInfo -VeraIP vera -Destinationpath C:\temp\ -Infotransparency 200

This command will install the module, Download all images from your Vera ( change “VERA” to the ip or name on your vera) to C:\temp, tagg the image with device info like, door, light, temperature, motion.

// Ispep