Integrating 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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.