Sytone's Ramblings

The occasional posts of a guy who plays with technology.

Integrating ISY into OpenHAB

2015-01-01 2 min read Home Automation

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:

    $user = "usernameforisy"
    $pass = "passwordforusername"
    [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($("{0}:{1}" -f $user, $pass)))
    
  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

    Switch NAMEOFSWITCH "Floor Lamp [%s]" (g\_FF,Lights,g\_FF\_Study) {http="<[http://1.2.3.4/rest/nodes/11%2022%2033%201/{Authorization=Basic HASH}:10000:XSLT(isy\_node\_state.xsl)] >[ON:GET:http://1.2.3.4/rest/nodes/11%2022%2033%201/cmd/DFON/{Authorization=Basic HASH}] >[OFF:GET:http://1.2.3.4/rest/nodes/11%2022%2033%201/cmd/DFOF{Authorization=Basic HASH}]"}
    
  3. Save the following XSL code to the transform folder under configuration and name it isy_node_state.xsl

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