Home automation with ISY and PowerShell

Posted by Jon Bullen on 2014-10-30
Estimated Reading Time 1 Minutes
Words 202 In Total

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! [code] function Invoke-IsyRestMethod { param ( $RestPath ) $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/“ [/code] Next to make my desk lamp flash when I should go to bed ;)

If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you!