Menu

PHP interface

Help
robandrox
2007-12-23
2012-12-14
  • robandrox

    robandrox - 2007-12-23

    Hello,

    I wanto to design a php interface to configure Linknx.In other words,an user interface that allows to do hour programations,conditions,etc
    However I don't know how to do it because I don't understand the linknx operation,I only know that when I execute linknx it listen at port 1028.
    Could you give me any help??

    Thanks

     
    • jef2000

      jef2000 - 2007-12-23

      Hi,

      Via the XML interface on port 1028, you can send rules with a syntax similar to the ones in config file. For example, if you send:
      <write><config><rules><rule id="test">
      <condition type="object" id="light1" value="on"/>
      <actionslist><action type="set-value" id="light2" value="off"/></actionslist>
      </rule></rules></config></write>

      It will configure a rule that switch off light2 if light1 is switched on.

      You can find more information in the wiki:
      http://linknx.wiki.sourceforge.net/Interacting+with+Linknx

      Kind regards,

      Jean-François

       
    • jef2000

      jef2000 - 2007-12-23

      Oups,

      I forgot to add trigger="true" to the condition in my example above.

       
    • robandrox

      robandrox - 2007-12-25

      but is there an XML configuration file by default or do I have to create it?

       
    • jef2000

      jef2000 - 2007-12-26

      There is a default config, but it's mostly empty. Before version 0.0.1.21, this default config was useless because it was not starting the XML interface on port 1028. Since 0.0.1.21, it's possible to start it without config and configure it afterward by connecting on port 1028.
      An example configuration file can be found here:
      http://linknx.cvs.sourceforge.net/linknx/linknx/linknx/conf/linknx.xml?view=markup

      If you want to make a php interface to configure it, you can start it with a config file like this:
      <?xml version="1.0" ?>
      <config>
          <objects>
          </objects>
          <rules>
          </rules>
          <services>
              <knxconnection url="ip:192.168.0.55" />
              <xmlserver type="inet" port="1028"/>
          </services>
      </config>

      That's more or less what would be in the default, plus the parameters of connection to eibd.
      If your group addresses are known in advance, you can put them also in the config file, but you'll be able to add/update/delete them afterwards using the XML interface.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.