bookmark_borderIntegrating ISY into OpenHAB

I am in the process of setting up OpenHAB for the extra functionality in my house. I have the ISY unit setup as the core brains for switches and scenes. All the other magic is in OpenHAB so if OpenHAB goes down the main functions of the house work.

I wanted to get the OpenHAB system to be able to get the status from the ISY unit and also changes states. This was as not straight forward as I wanted. I still have a issue that the process is polling and not a subscriber model but I do not have time to create a ISY binding.

Anyway, here’s the basic instructions.

1. Generate a basic auth hash for your user/pass to access the ISY admin console. In PowerShell use the following command:
[code]
$user = "usernameforisy"
$pass = "passwordforusername"
[Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($("{0}:{1}" -f $user, $pass)))
[/code]

2. Edit the OpenHAB items file and add in your switch, replace 1.2.3.4 with the IP of your ISY unit and change the word HASH to the auth hash generated in step one. You use the ID of the switch not the friendly name, replace any spaces with %%20 so 11 22 33 1 becomes 11%%2022%%2033%%201

[code]
Switch NAMEOFSWITCH "Floor Lamp [%s]" (g_FF,Lights,g_FF_Study) {http="&lt;[http://<strong>1.2.3.4</strong>/rest/nodes/<strong>11%%2022%%2033%%201</strong>/{Authorization=Basic <strong>HASH</strong>}:10000:XSLT(isy_node_state.xsl)] &gt;[ON:GET:http://<strong>1.2.3.4</strong>/rest/nodes/<strong>11%%2022%%2033%%201</strong>/cmd/DFON/{Authorization=Basic <strong>HASH</strong>}] &gt;[OFF:GET:http://<strong>1.2.3.4</strong>/rest/nodes/<strong>11%%2022%%2033%%201</strong>/cmd/DFOF{Authorization=Basic <strong>HASH</strong>}]"}
[/code]

3. Save the following XSL code to the transform folder under configuration and name it isy_node_state.xsl

[code]
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  version="1.0"&gt;
&lt;xsl:output indent="yes" method="xml" encoding="UTF-8" omit-xml-declaration="yes" /&gt;
&lt;xsl:template match="/"&gt;
&lt;xsl:value-of select="translate(//nodeInfo/node/property/@formatted,’abcdefghijklmnopqrstuvwxyz’,’ABCDEFGHIJKLMNOPQRSTUVWXYZ’)" /&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
[/code]

Sytone

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.

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!

[code]
function Invoke-IsyRestMethod {
param (
$RestPath
)
$isyEndPoint = "http://192.168.0.123"
$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 😉

Sytone

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.