<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5791089135491824627</id><updated>2026-04-12T04:33:26.550+10:00</updated><category term="Automation"/><category term="C-Bus"/><category term="Clipsal"/><category term="Clipsal cbus"/><category term="Home Automation"/><category term="HomeAssistant"/><category term="Mosquitto"/><category term="cbus"/><category term="debian"/><category term="mqtt"/><title type='text'>Solving problems one at a time</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.jamescowan.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.jamescowan.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>James Cowan</name><uri>http://www.blogger.com/profile/06283978237375528673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5791089135491824627.post-5514591556906959994</id><published>2017-04-11T08:05:00.000+10:00</published><updated>2019-07-10T22:32:24.532+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C-Bus"/><category scheme="http://www.blogger.com/atom/ns#" term="cbus"/><category scheme="http://www.blogger.com/atom/ns#" term="Clipsal"/><category scheme="http://www.blogger.com/atom/ns#" term="Clipsal cbus"/><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="Home Automation"/><category scheme="http://www.blogger.com/atom/ns#" term="HomeAssistant"/><category scheme="http://www.blogger.com/atom/ns#" term="Mosquitto"/><category scheme="http://www.blogger.com/atom/ns#" term="mqtt"/><title type='text'>Home Automation - HomeAssistant and Clipsal C-Bus</title><content type='html'>This was an interesting one, I wanted to control C-Bus lights / Devices in the home with HomeAssistant, it took a bit to get going, but worth it..&lt;br /&gt;
&lt;br /&gt;
This isn&#39;t a complete guide on HomeAssistant, MQTT, Mosquitto, C-Gate, Debian or anything else, but with the help of Google and luck, it should get you going..&lt;br /&gt;
&lt;br /&gt;
Components used for the interface:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Debian Linux ( &lt;a href=&quot;https://www.debian.org/&quot;&gt;https://www.debian.org/&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;C-Gate for Linux (&amp;nbsp;&lt;a href=&quot;http://www2.clipsal.com/cis/technical/downloads/c-gate&quot;&gt;http://www2.clipsal.com/cis/technical/downloads/c-gate&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;Mosquitto MQTT broker ( &lt;a href=&quot;https://mosquitto.org/&quot;&gt;https://mosquitto.org/&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;C-Gate / MQTT Source Code from (&amp;nbsp;&lt;a href=&quot;https://github.com/the1laz/cgateweb&quot;&gt;https://github.com/the1laz/cgateweb&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;MQTT Node.js Stuff (&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/mqtt&quot;&gt;https://www.npmjs.com/package/mqtt&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;Forever for Node.js (&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/forever&quot;&gt;https://www.npmjs.com/package/forever&lt;/a&gt; )&lt;/li&gt;
&lt;/ul&gt;
Lots of reading the C-Gate programming guide and other places:&lt;br /&gt;
&lt;a href=&quot;http://www3.clipsal.com/cis/downloads/Toolkit/CGateServerGuide_1_0.pdf&quot;&gt;www3.clipsal.com/cis/downloads/Toolkit/CGateServerGuide_1_0.pdf&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&quot;&gt;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Setting up Debian:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Install other packages openjdk-7-jdk nodejs npm&amp;nbsp;mosquitto&amp;nbsp;mosquitto-clients&lt;br /&gt;
&lt;br /&gt;
Setting up Node.js&lt;br /&gt;
&lt;span style=&quot;color: #4d4d4d; font-family: &amp;quot;courier new&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #f0f0f0; white-space: pre;&quot;&gt;npm install mqtt --save&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;C-Bus / C-Gate setup..&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXDFtcje18o7P9RPRL87kIPx4LDKRoFiSgoQxp6Ay-Nrg3KcK1eocwhEnwIfcA5V-Bi11YFd6-4o1kUPIxmz2X1Ef3KjcMlcIFIGgeZiPFhxoxHvi325EN1Ju0elO95DzIMZEKwDZxpTR/s1600/remote_cgate.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXDFtcje18o7P9RPRL87kIPx4LDKRoFiSgoQxp6Ay-Nrg3KcK1eocwhEnwIfcA5V-Bi11YFd6-4o1kUPIxmz2X1Ef3KjcMlcIFIGgeZiPFhxoxHvi325EN1Ju0elO95DzIMZEKwDZxpTR/s1600/remote_cgate.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Install C-Gate on linux and connect to this remote C-Gate with the C-Bus toolkit, get everything working with this configuration BEFORE continuing.. &amp;nbsp;The rest won&#39;t really work until you have networks / projects etc set up. &amp;nbsp;The configuration is stored on the linux server with the C-Gate install.&lt;br /&gt;
&lt;br /&gt;
I used this post as a guide to install:&lt;br /&gt;
&lt;a href=&quot;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&quot;&gt;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Modifications to the code required..&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I assume the excellent C-Gate / MQTT code from the1las&amp;nbsp;@ github was written for an older version of C-Gate than the one I&#39;m using (2.10.6) so I had to make some modifications to get it to work for me.. &amp;nbsp;Without this code as a base, this would have taken so much longer!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;modified index.js&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;var mqtt = require(&#39;mqtt&#39;), url = require(&#39;url&#39;);
var net = require(&#39;net&#39;);
var events = require(&#39;events&#39;);
var settings = require(&#39;./settings.js&#39;);

var buffer = &quot;&quot;;
var eventEmitter = new events.EventEmitter();

// MQTT URL
var mqtt_url = url.parse(&#39;mqtt://&#39;+settings.mqtt);

// Username and password
var OPTIONS = {};
if(settings.mqttusername &amp;amp;&amp;amp; settings.mqttpassword) {
  OPTIONS.username = settings.mqttusername;
  OPTIONS.password = settings.mqttpassword;
}

// Create an MQTT client connection
var client = mqtt.createClient(mqtt_url.port, mqtt_url.hostname,OPTIONS);

var HOST = settings.cbusip;
var COMPORT = 20023;
var EVENTPORT = 20025;

var logging = settings.logging;

// Connect to cgate via telnet
var command = new net.Socket();
command.connect(COMPORT, HOST, function() {

  console.log(&#39;CONNECTED TO C-GATE COMMAND PORT: &#39; + HOST + &#39;:&#39; + COMPORT);
  command.write(&#39;EVENT ON\n&#39;);

});


// Connect to cgate event port via telnet
var event = new net.Socket();
event.connect(EVENTPORT, HOST, function() {
  command.write(&#39;PROJECT LOAD &#39;+settings.cbusname+&#39;\n&#39;);
  command.write(&#39;PROJECT USE &#39;+settings.cbusname+&#39;\n&#39;);
  command.write(&#39;NET OPEN &#39;+settings.cbusnetwork+&#39;\n&#39;);
  command.write(&#39;PROJECT START&#39;+&#39;\n&#39;);

  console.log(&#39;CONNECTED TO C-GATE EVENT PORT: &#39; + HOST + &#39;:&#39; + EVENTPORT);

});


client.on(&#39;connect&#39;, function() { // When connected
  console.log(&#39;CONNECTED TO MQTT: &#39; + settings.mqtt);

  // Subscribe to MQTT
  client.subscribe(&#39;cbus/write/#&#39;, function() {

    // when a message arrives, do something with it
    client.on(&#39;message&#39;, function(topic, message, packet) {
      if (logging == true) {console.log(&#39;Message received on &#39; + topic + &#39; : &#39; + message);}

      parts = topic.split(&quot;/&quot;);
      if (parts.length &amp;gt; 5)

      switch(parts[5].toLowerCase()) {

        // Get updates from all groups
        case &quot;getall&quot;:
          command.write(&#39;GET /&#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/* level\n&#39;);
          break;

        // On/Off control
        case &quot;switch&quot;:

          if(message == &quot;ON&quot;) {command.write(&#39;ON &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39;\n&#39;)};
          if(message == &quot;OFF&quot;) {command.write(&#39;OFF &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39;\n&#39;)};
          break;

        // Ramp, increase/decrease, on/off control
        case &quot;ramp&quot;:
          switch(message.toUpperCase()) {
            case &quot;INCREASE&quot;:
              eventEmitter.on(&#39;level&#39;,function increaseLevel(address,level) {
                if (address == parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]) {
                  command.write(&#39;RAMP &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; &#39;+Math.min((level+26),255)+&#39; &#39;+&#39;\n&#39;);
                  eventEmitter.removeListener(&#39;level&#39;,increaseLevel);
                }
              });
              command.write(&#39;GET &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; level\n&#39;);

              break;

            case &quot;DECREASE&quot;:
              eventEmitter.on(&#39;level&#39;,function decreaseLevel(address,level) {
                if (address == parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]) {
                  command.write(&#39;RAMP &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; &#39;+Math.max((level-26),0)+&#39; &#39;+&#39;\n&#39;);
                  eventEmitter.removeListener(&#39;level&#39;,decreaseLevel);
                }
              });
              command.write(&#39;GET &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; level\n&#39;);

              break;

            case &quot;ON&quot;:
              command.write(&#39;ON &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39;\n&#39;);
              break;
            case &quot;OFF&quot;:
              command.write(&#39;OFF &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39;\n&#39;);
              break;
            default:
              var ramp = message.split(&quot;,&quot;);
              var num = Math.round(parseInt(ramp[0])*255/100)
              if (!isNaN(num) &amp;amp;&amp;amp; num &amp;lt; 256) {

                if (ramp.length &amp;gt; 1) {
                  command.write(&#39;RAMP &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; &#39;+num+&#39; &#39;+ramp[1]+&#39;\n&#39;);
                } else {
                  command.write(&#39;RAMP &#39;+parts[2]+&#39;/&#39;+parts[3]+&#39;/&#39;+parts[4]+&#39; &#39;+num+&#39;\n&#39;);
                }
              }
          }
          break;
        default:
      }
    });
  });

  // publish a message to a topic
  client.publish(&#39;hello/world&#39;, &#39;CBUS ON&#39;, function() {
  });
});



&lt;lines .length-1=&quot;&quot; i=&quot;&quot; if=&quot;&quot; parts1.length=&quot;&quot; parts1=&quot;lines[i].toString().split(&quot; var=&quot;&quot;&gt;&lt;pre class=&quot;brush: csharp&quot;&gt;command.on(&#39;data&#39;,function(data) {
  var lines = (buffer+data.toString()).split(&quot;\n&quot;);
  buffer = lines[lines.length-1];
  if (lines.length &amp;gt; 1) {
    for (i = 0;i&lt;lines .length-1=&quot;&quot; i=&quot;&quot; if=&quot;&quot; parts1.length=&quot;&quot; parts1=&quot;lines[i].toString().split(&quot; var=&quot;&quot;&gt; 1 &amp;amp;&amp;amp; parts1[0] == &quot;300&quot;) {
        var parts2 = parts1[1].toString().split(&quot; &quot;);

        address = (parts2[0].substring(0,parts2[0].length-1)).split(&quot;/&quot;);
        var level = parts2[1].split(&quot;=&quot;);
        if (parseInt(level[1]) == 0) {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; OFF&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; 0%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;OFF&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , &#39;0&#39; );
          eventEmitter.emit(&#39;level&#39;,address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5],0);
        } else {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; ON&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; &#39;+Math.round(parseInt(level[1])*100/255).toString()+&#39;%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;ON&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , Math.round(parseInt(level[1])*100/255).toString() );
          eventEmitter.emit(&#39;level&#39;,address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5],Math.round(parseInt(level[1])));

        }
      } else {
        var parts2 = parts1[0].toString().split(&quot; &quot;);
        if (parts2[0] == &quot;300&quot;) {
        address = (parts2[1].substring(0,parts2[1].length-1)).split(&quot;/&quot;);
        var level = parts2[2].split(&quot;=&quot;);
        if (parseInt(level[1]) == 0) {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; OFF&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; 0%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;OFF&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , &#39;0&#39; );
          eventEmitter.emit(&#39;level&#39;,address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5],0);
        } else {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; ON&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; &#39;+Math.round(parseInt(level[1])*100/255).toString()+&#39;%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;ON&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , Math.round(parseInt(level[1])*100/255).toString() );
          eventEmitter.emit(&#39;level&#39;,address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5],Math.round(parseInt(level[1])));

        }

        }
      }
    }
  }
});&lt;/lines&gt;&lt;/pre&gt;
// Add a &#39;data&#39; event handler for the client socket
// data is what the server sent to this socket
event.on(&#39;data&#39;, function(data) {

    var parts = data.toString().split(&quot; &quot;);
    if(parts[0] == &quot;lighting&quot;) {
      address = parts[2].split(&quot;/&quot;);
      switch(parts[1]) {
        case &quot;on&quot;:
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; ON&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; 100%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;ON&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , &#39;100&#39; );
          break;
        case &quot;off&quot;:
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; OFF&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; 0%&#39;);}
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/state&#39; , &#39;OFF&#39; );
          client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , &#39;0&#39; );
          break;
        case &quot;ramp&quot;:
          if(parseInt(parts[3]) &amp;gt; 0) {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; ON&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; &#39;+Math.round(parseInt(parts[3])*100/255).toString()+&#39;%&#39;);}
            client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/status&#39; , &#39;ON&#39;, function() {});
            client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , Math.round(parseInt(parts[3])*100/255).toString(), function() {});
          } else {
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; OFF&#39;);}
          if (logging == true) {console.log(&#39;C-Bus status received: &#39;+address[3] +&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39; 0%&#39;);}
            client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/status&#39; , &#39;OFF&#39; );
            client.publish(&#39;cbus/read/&#39;+address[3]+&#39;/&#39;+address[4]+&#39;/&#39;+address[5]+&#39;/level&#39; , &#39;0&#39; );
          }
          break;
        default:
      }
    }

});
&lt;/lines&gt;&lt;/pre&gt;
&lt;br /&gt;
The modifications are based on the reading of the C-Gate docs.&lt;br /&gt;
Basically I added some stuff on connect to C-Gate.. &amp;nbsp;e.g. the lines:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;PROJECT LOAD&lt;/li&gt;
&lt;li&gt;PROJECT USE&lt;/li&gt;
&lt;li&gt;NET OPEN&lt;/li&gt;
&lt;li&gt;PROJECT START&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
The remainder of the modifications were around device control, Basically you now send&lt;br /&gt;
ON &lt;i&gt;Network/Application/Group&lt;/i&gt;&lt;br /&gt;
or&lt;br /&gt;
OFF &lt;i&gt;Network/Application/Group&lt;/i&gt;&lt;br /&gt;
to the C-Gate and it turns on the appropriate C-Bus Group. &amp;nbsp;The original code prefixed each command with the cbusname.. I also removed some of the parameters on the mqtt client.publish statements as they caused inconsistencies in my setup.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;modified settings.js
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;//cbus ip address
exports.cbusip = &#39;127.0.0.1&#39;;


//cbus project name
exports.cbusname = &quot;HOME&quot;;
exports.cbusnetwork = &quot;254&quot;;

//mqtt server ip:port
exports.mqtt = &#39;127.0.0.1:1883&#39;;

//username and password (unncomment to use)
//exports.mqttusername = &#39;user1&#39;;
//exports.mqttpassword = &#39;password1&#39;;


//logging
exports.logging = true;

&lt;/pre&gt;
The only difference here was adding the cbus network variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next was adding the MQTT config in HomeAssistant (configuration.yaml). &amp;nbsp;This points at the IP address where you installed Mosquitto..&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;mqtt:
  broker: 192.168.X.X
  port: 1883
  client_id: home-assistant-1
  keepalive: 60
  protocol: 3.1
&lt;/pre&gt;
&lt;br /&gt;
This just allows MQTT to be used, it doesn&#39;t define anything to switch on / off...&lt;br /&gt;
&lt;br /&gt;
I control some lights as follows (existing HUE lughts, then the C-Bus Lights):&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;light:
  - platform: hue
    host: 192.168.X.X
  - platform: mqtt
    name: Entrance (CBUS)
    state_topic: &quot;cbus/read/254/56/2/state&quot;
    command_topic: &quot;cbus/write/254/56/2/switch&quot;      
  - platform: mqtt
    name: Outside Front (CBUS)
    state_topic: &quot;cbus/read/254/56/3/state&quot;
    command_topic: &quot;cbus/write/254/56/3/switch&quot;  
  - platform: mqtt
    name: Lounge (CBUS)
    state_topic: &quot;cbus/read/254/56/4/state&quot;
    command_topic: &quot;cbus/write/254/56/4/switch&quot;
&lt;/pre&gt;
&lt;br /&gt;
The command_topic / state topic contain the C-Bus &lt;i&gt;Network/Application/Group&lt;/i&gt; being controlled&lt;br /&gt;
&lt;br /&gt;
You can also add &quot;Switches&quot; rather than lights&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;switch:
  - platform: mqtt
    name: Mozzie Zapper (CBUS)
    state_topic: &quot;cbus/read/254/56/11/state&quot;
    command_topic: &quot;cbus/write/254/56/11/switch&quot;  
&lt;/pre&gt;
&lt;br /&gt;
The control on these is 2-way, so if i turn on a C-Bus light with the wall switch, the change is reflected in HomeAssistant.&lt;br /&gt;
&lt;br /&gt;
To get the&amp;nbsp;&lt;i&gt;Network/Application/Group&lt;/i&gt;&amp;nbsp;list for my C-Bus setup:&lt;br /&gt;
Look in the C-Bus Toolkit..&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR2yPybcn1_DzJPoA5ER14xwMZhHJZm4aI37b-XJxItfxmMuUBk5-2Ir_d7eI5w7avkZuQrGbNc_4BzPVBkqA4D0leiOm2bELfM-q_dmBJlMjk9M6sNP2_CsrTIxRu2DUFelZxzIL1wwsg/s1600/cgate_application.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;289&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR2yPybcn1_DzJPoA5ER14xwMZhHJZm4aI37b-XJxItfxmMuUBk5-2Ir_d7eI5w7avkZuQrGbNc_4BzPVBkqA4D0leiOm2bELfM-q_dmBJlMjk9M6sNP2_CsrTIxRu2DUFelZxzIL1wwsg/s640/cgate_application.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The &lt;i&gt;Network &lt;/i&gt;number is displayed at the top. &amp;nbsp;The &lt;i&gt;Application &lt;/i&gt;number is displayed on the Application properties.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUY0hocBynorMlgdIcOB0nDi0i80glcSxzl19Tu-s1K3IP9msaochu7sIg1KsdYmCZve1rzg0y_KfdRHO7upc_y4IBU0d_tM1dfkDx1ReAI8iIh5zg8zg3P5pMs2b1Lh_jJHcTzaqQknvr/s1600/cgate_address.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;430&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUY0hocBynorMlgdIcOB0nDi0i80glcSxzl19Tu-s1K3IP9msaochu7sIg1KsdYmCZve1rzg0y_KfdRHO7upc_y4IBU0d_tM1dfkDx1ReAI8iIh5zg8zg3P5pMs2b1Lh_jJHcTzaqQknvr/s640/cgate_address.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The &lt;i&gt;Group &lt;/i&gt;Address is displayed on the Group to be controlled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Starting all at boot:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
C-Gate started as per this post&lt;br /&gt;
&lt;a href=&quot;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&quot;&gt;http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The node.js code is loaded at boot on the debian box (jessie) by the forever module..&lt;br /&gt;
after doing an &quot;npm install -g&quot; to load the forever stuff for node.js, i had to create a symlink&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/nodejs /usr/bin/node&lt;br /&gt;
&lt;br /&gt;
or forever doesn&#39;t work (it looks for node, not nodejs).&lt;br /&gt;
&lt;br /&gt;
Startup script /etc/init.d/nodeup&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;#!/bin/sh
#/etc/init.d/nodeup

export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules

case &quot;$1&quot; in
  start)
  exec forever start --sourceDir=/usr/local/bin/nodejs -p /root/.forever/ index.js
  ;;
stop)
  exec forever stop --sourceDir=/usr/local/bin/nodejs index.js
  ;;
*)
  echo &quot;Usage: /etc/init.d/nodeup {start|stop}&quot;
  exit 1
  ;;
esac

exit 0
&lt;/pre&gt;
&lt;br /&gt;
Nothing special, just start the init script at boot as per usual..



&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The future...&lt;br /&gt;
Oneday I might modify the node.js code to discover all C-Bus applications and devices, but for now I can control my lights from anywhere and life is good!</content><link rel='replies' type='application/atom+xml' href='http://blog.jamescowan.com/feeds/5514591556906959994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.jamescowan.com/2017/04/home-automation-homeassistant-and.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/5514591556906959994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/5514591556906959994'/><link rel='alternate' type='text/html' href='http://blog.jamescowan.com/2017/04/home-automation-homeassistant-and.html' title='Home Automation - HomeAssistant and Clipsal C-Bus'/><author><name>James Cowan</name><uri>http://www.blogger.com/profile/06283978237375528673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXDFtcje18o7P9RPRL87kIPx4LDKRoFiSgoQxp6Ay-Nrg3KcK1eocwhEnwIfcA5V-Bi11YFd6-4o1kUPIxmz2X1Ef3KjcMlcIFIGgeZiPFhxoxHvi325EN1Ju0elO95DzIMZEKwDZxpTR/s72-c/remote_cgate.JPG" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5791089135491824627.post-4877168363544737385</id><published>2012-03-24T16:04:00.002+11:00</published><updated>2012-03-24T16:20:14.976+11:00</updated><title type='text'>LDAP (slapd) and GOsa on Debian Squeeze</title><content type='html'>&lt;h2&gt;




First &quot;Solve&quot; for the blog.&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
How to install Open LDAP (slapd) and GOsa on Debian Squeeze. &amp;nbsp;Sometime in recent history, the previous configuration file setup for LDAP (slapd.conf) was deprecated and a new config structure was put in place. &amp;nbsp;As as today (24/03/2012) the instructions for configuring LDAP on the debian pages still say that their instructions need updating.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
So as with all debian installs, I started with the following:&lt;/div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
apt-get install slapd gosa gosa-schema&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhERRypR_v95skBksQse9CPHkIeonJdcGYh-AYJ3-BUTG_WAsRfdGLt3dFsUlZ1iNNBLeMbyGv1Enhy1LbKOG7MoAEyU09g5pTMIkliwmDxWDy8XK5wVv6qQOo8tYIQ6wTrNolSbQ-873LW/s1600/001.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhERRypR_v95skBksQse9CPHkIeonJdcGYh-AYJ3-BUTG_WAsRfdGLt3dFsUlZ1iNNBLeMbyGv1Enhy1LbKOG7MoAEyU09g5pTMIkliwmDxWDy8XK5wVv6qQOo8tYIQ6wTrNolSbQ-873LW/s640/001.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Use your domain name, or local / internal domain name for the slapd install.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Enter whatever you like for the organisation name, or just press enter to accept the default.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqSDROfyPnCjp2JHTq0_MLJW3gePqs4rgt0F1VVjfzbfieJ84AvkQw63_SU5AAJcwAppjrPTNliQti2X6Tfm9rKvrMuObxluZ-SZcFbqmZsHYzzR_2Z6pehAdwCLX8yFqGDY0qYs6lYlrI/s1600/003.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;402&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqSDROfyPnCjp2JHTq0_MLJW3gePqs4rgt0F1VVjfzbfieJ84AvkQw63_SU5AAJcwAppjrPTNliQti2X6Tfm9rKvrMuObxluZ-SZcFbqmZsHYzzR_2Z6pehAdwCLX8yFqGDY0qYs6lYlrI/s640/003.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Enter an admin password. &amp;nbsp;Probably good (as with all passwords) not to make it easily guessable, and not the same as other passwords on the same machine.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAtlp3CG1WsVTikiY1jJjj4O5KTaJhYIoJVoHGP5Au5KqehWfmUVQXYQk8xkAWdH47MN2ebDkI0kpm7kB2zl6eN7W8Xz9x537pI57L55c6nOeHRG6SCNJvMLKzMJz9epLpXH-rlFOp453D/s1600/004.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;402&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAtlp3CG1WsVTikiY1jJjj4O5KTaJhYIoJVoHGP5Au5KqehWfmUVQXYQk8xkAWdH47MN2ebDkI0kpm7kB2zl6eN7W8Xz9x537pI57L55c6nOeHRG6SCNJvMLKzMJz9epLpXH-rlFOp453D/s640/004.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Pick either type for the database backend. I chose HDB after a bit of searching about the differences.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
See&amp;nbsp;&lt;a href=&quot;http://lmgtfy.com/?q=HDB+or+BDB&quot;&gt;http://lmgtfy.com/?q=HDB+or+BDB&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Next step is the bit that really got me stumped, there wasn&#39;t a lot of help on&amp;nbsp;Google&amp;nbsp;for how to do this.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
First create a file called /etc/ldap/convert.conf with the following contents:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#Exisiting ldap schemas&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/core.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/cosine.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/nis.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/inetorgperson.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#GOSA ldap schemas, order is important.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/samba3.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/gofon.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/gosystem.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/goto.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/gosa-samba3.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/gofax.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/goserver.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/goto-mime.schema&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;include /etc/ldap/schema/gosa/trust.schema&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Then make an output directory&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;root@ldap:/etc/ldap# mkdir /tmp/convert_out&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Then run the convert tool as follows:&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;root@ldap:/etc/ldap# slaptest -f convert.conf -F /tmp/convert_out&lt;br /&gt; config file testing succeeded&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This will have created some files in /tmp/convert_out. &amp;nbsp;We only want the schema files from this output, and we want them to end up in the directories for the new configuration files for slapd. &amp;nbsp;We also need to change the owner / group on these files so the slapd process can read them.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;cp -p /tmp/convert_out/cn\=config/cn\=schema* /etc/ldap/slapd.d/cn\=config/&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;chown -R openldap.openldap /etc/ldap/slapd.d/&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
At this point, I restarted slapd, but&amp;nbsp;I&#39;m&amp;nbsp;fairly certain this isn&#39;t required (your choice).&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;




Next we get into the GOsa configuration...&lt;/h4&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Assuming Apache etc installed correctly on the machine, you should be able to go to&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
http://yourip/gosa/ or http://yourhostname/gosa&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
and see the GOsa administration pages.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kV2TQ-Exobt_lFNPlsiSxekpJ1ivqaVVbecxGfCMUddCwN7EAy1ThRw51lMTzfRQ01TgB-ssEyD9tTAe5dFMqDUj-wHvROnthkdIgDApJg-13FIEHk_JOQ8OLM4HTelShxEglQJf4DBx/s1600/005.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kV2TQ-Exobt_lFNPlsiSxekpJ1ivqaVVbecxGfCMUddCwN7EAy1ThRw51lMTzfRQ01TgB-ssEyD9tTAe5dFMqDUj-wHvROnthkdIgDApJg-13FIEHk_JOQ8OLM4HTelShxEglQJf4DBx/s640/005.jpg&quot; width=&quot;636&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
At the bottom of the page, there&#39;s an &quot;echo&quot; command that you need to cut and paste into a terminal window. &amp;nbsp;It won&#39;t go past this step until you do.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNpKC6ssze08eDG-EYIvx9UlovBRLS_saAJQHSZPyWYYCtu8U_bbdZd6Ohe-jGP6uA3Ymn9LaQEgWmCaQpnbpwKW5mQbImfsoqmqKahLE3puNeXa4vSfOm0xidEWgpACivhAYt-LkmTo7t/s1600/006.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNpKC6ssze08eDG-EYIvx9UlovBRLS_saAJQHSZPyWYYCtu8U_bbdZd6Ohe-jGP6uA3Ymn9LaQEgWmCaQpnbpwKW5mQbImfsoqmqKahLE3puNeXa4vSfOm0xidEWgpACivhAYt-LkmTo7t/s640/006.jpg&quot; width=&quot;636&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Pick A Language&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbVxgECXj-S5w1soLCAXymOlFq3BjAfl-C3bLZniANxNN0xRIMdMNtGAhBoQRS5N3SCaKufymeP0TxrY-Fhx9VNNm9L5QTXagIm-pd0brYegul9hYOoxxOhO-REYRY075eArO3x7gTf3Yd/s1600/007.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbVxgECXj-S5w1soLCAXymOlFq3BjAfl-C3bLZniANxNN0xRIMdMNtGAhBoQRS5N3SCaKufymeP0TxrY-Fhx9VNNm9L5QTXagIm-pd0brYegul9hYOoxxOhO-REYRY075eArO3x7gTf3Yd/s640/007.jpg&quot; width=&quot;592&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Hopefully you&#39;re all green here. &amp;nbsp;Mine was a fresh install on a clean debian install, so it looks like it should work out of the box.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjb440i1tXAHsV9LZMuaVdyK5GR1-2kXz7OQ2igMBc_hRKPugM_RWzz5Y1Mx8ZKHbhUCPUOZPjmtDwr8fexnxBg2MgKLeEXcqSOs1yvGeMGjYtTesIl1OzMnJ8eotMwWF-ARj4pIL_NDL/s1600/009.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjb440i1tXAHsV9LZMuaVdyK5GR1-2kXz7OQ2igMBc_hRKPugM_RWzz5Y1Mx8ZKHbhUCPUOZPjmtDwr8fexnxBg2MgKLeEXcqSOs1yvGeMGjYtTesIl1OzMnJ8eotMwWF-ARj4pIL_NDL/s640/009.jpg&quot; width=&quot;592&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
On this screen you should see the &quot;succeeded&quot; text at the bottom, If not, something else is wrong, try re-starting slapd.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyPALQmZ8tdySIAMGJY5OB-dmiBh6D51RhCGGXTWtrW5VyiNjAR2WH5dCFcbwfYeOANC12uGQ9AhR568dhBp4rptL3gSZChXYb93rS8jrpWGuSpXORVKpdOsbgQAdZwF6G_Wo8JkEPWWOP/s1600/010.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;564&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyPALQmZ8tdySIAMGJY5OB-dmiBh6D51RhCGGXTWtrW5VyiNjAR2WH5dCFcbwfYeOANC12uGQ9AhR568dhBp4rptL3gSZChXYb93rS8jrpWGuSpXORVKpdOsbgQAdZwF6G_Wo8JkEPWWOP/s640/010.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
On this screen, enter &quot;cn=admin&quot; in the Admin DN field, and type the Admin password that you used during the LDAP install. &amp;nbsp;Then tick the auto append checkbox and click next.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwFS7FswglhohbTtmSX9FG8ZGd6tRDOIlL3tx6yb1s0dCdK_6Jo6-UIxwoyh34zgoNzwdl5k0YL2B7xf7RdYd0YYBpBbdhSde310gvDwi1VQBviFRkhrgqascc-xkm_QXyDBuqWbP9UE3T/s1600/011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;564&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwFS7FswglhohbTtmSX9FG8ZGd6tRDOIlL3tx6yb1s0dCdK_6Jo6-UIxwoyh34zgoNzwdl5k0YL2B7xf7RdYd0YYBpBbdhSde310gvDwi1VQBviFRkhrgqascc-xkm_QXyDBuqWbP9UE3T/s640/011.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Assuming you&#39;ve done&amp;nbsp;everything&amp;nbsp;right, you should see this screen...&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
And that&#39;s where i&#39;ll end this post, after this the documentation all around is pretty good for GOsa and LDAP.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Enjoy. &amp;nbsp; As always feedback / suggestions are welcome.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.jamescowan.com/feeds/4877168363544737385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.jamescowan.com/2012/03/ldap-slapd-and-gosa-on-debian-squeeze.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/4877168363544737385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/4877168363544737385'/><link rel='alternate' type='text/html' href='http://blog.jamescowan.com/2012/03/ldap-slapd-and-gosa-on-debian-squeeze.html' title='LDAP (slapd) and GOsa on Debian Squeeze'/><author><name>James Cowan</name><uri>http://www.blogger.com/profile/06283978237375528673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhERRypR_v95skBksQse9CPHkIeonJdcGYh-AYJ3-BUTG_WAsRfdGLt3dFsUlZ1iNNBLeMbyGv1Enhy1LbKOG7MoAEyU09g5pTMIkliwmDxWDy8XK5wVv6qQOo8tYIQ6wTrNolSbQ-873LW/s72-c/001.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5791089135491824627.post-5751632857180679850</id><published>2012-03-24T14:18:00.000+11:00</published><updated>2012-03-24T14:18:22.928+11:00</updated><title type='text'>Why?</title><content type='html'>My most recent &quot;solve&quot; was last week, and it wasn&#39;t until I figured it out that I thought I should probably start writing about this kind of thing.&lt;br /&gt;
&lt;br /&gt;
So this blog will be my place to dump instructions, solutions,&amp;nbsp;screen shots&amp;nbsp;and links for the&amp;nbsp;crazy&amp;nbsp;list of things&amp;nbsp;I&amp;nbsp;solve after finding no (or little) help searching the web.</content><link rel='replies' type='application/atom+xml' href='http://blog.jamescowan.com/feeds/5751632857180679850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.jamescowan.com/2012/03/why.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/5751632857180679850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5791089135491824627/posts/default/5751632857180679850'/><link rel='alternate' type='text/html' href='http://blog.jamescowan.com/2012/03/why.html' title='Why?'/><author><name>James Cowan</name><uri>http://www.blogger.com/profile/06283978237375528673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>