bookmark_borderHome automation with ISY and PowerShell

I am playing with ISY and automation in my home, looking at the universal devices page today I found the API for working with the unit. Turning to trusty PowerShell I came up with the following code to enable you to start interacting with the unit remotely. Ill look at a proper module at some point in the future but this increases the possibilities of the unit!

function Invoke-IsyRestMethod {
param (
$isyEndPoint = ""
$user = "user"
$pass = "pass"
$url = "{0}{1}" -f $isyEndPoint, $RestPath
$headers = @{
Authorization = ‘Basic ‘ + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($("{0}:{1}" -f $user, $pass)))
invoke-restmethod -Uri $url -Method Get -Headers $headers

# Get all the nodes and addresses you have in the system.
(Invoke-IsyRestMethod "/rest/nodes").nodes.node | select name, address

# get information about a specific node.
Invoke-IsyRestMethod -RestPath "/rest/nodes/28 2F 24 1"

#Turn the node on, in this case my desk lamp!
Invoke-IsyRestMethod -RestPath "/rest/nodes/28 2F 24 1/cmd/DON/"

#Turn the node off, in case my desk lamp.
Invoke-IsyRestMethod -RestPath "/rest/nodes/28 2F 24 1/cmd/DOF/"
Next to make my desk lamp flash when I should go to bed šŸ˜‰


Iā€™m a principal engineer working at Microsoft. I have run and supported services for over twenty years and worked in multiple countries. I love working with passionate people and new technology.