Ankündigung

Einklappen
Keine Ankündigung bisher.

Knx => php

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Knx => php

    Hi all, is there a library that lets me communicate via php tunneling with KNX?

    What are the disadvantages of such a system?​

    #2
    As fas as I understand php tunneling the prerequisite is a server - KNX is a distributes system without server. Thus there is no hardware to run your requested library.
    In other words: the disadvantage of KNX is the lack of a server.

    Kommentar


      #3
      Any PC could run that. The only requirement would be a Knx IP interface.

      There are several libraries allowing knx IP tunneling communication. Unfortunately I have not seen a library in PHP yet. Afaik there is something in C#, C++, C, Python, Java, JS, TS, Go, Elixir, Ruby. Maybe you can use one of these with some glue-code from your PHP App.

      Kommentar


        #4
        Bye and thanks for the answers..

        I'm not an installer and my experience with knx dates back to a few months ago and also with bench tests..

        When I chose KNX for the home system and I hadn't started playing yet, I had high expectations which then fell asleep when I started doing the tests. The biggest shortcoming is the management of the logics and of overcoming the limits of functionality of some devices that I took for granted (probably my mistake in the choice).

        As interface I chose a weinzierl baos, as I had already informed myself about communication via LAMP and a guy in a forum recommended BAOS.

        Ok, when I start testing I realize BAOS communication is via (slow) http calls, and to myself I think, I'm not going anywhere here..

        So I started studying the tunneling frame and I managed to interface with KNX via socket.

        So I created a main server that communicates via tunneling to which clients can be connected for data exchange .. in this way even if my interface supports 10 connections I use only one ..

        I save the telegrams on the db and I made sure that they are deleted based on a certain priority..

        Logically the server is listening and I can treat it as a device in the system...



        PS: Apologies for my initial question, it wasn't provocative, I just wanted to understand the degree of interest in this topic..​

        Kommentar


          #5
          You will use KNX in your home house/flat and you are living alone in it? If not, think about it what will hapen if you got sik and unable to repair any thing, who will be able to work with your complete unknown software? KNX is a nice hobby and perhaps you are good in programming php, but I only can give you the advice to choose any existing common open source software or buy a commercial logic server device.
          ----------------------------------------------------------------------------------
          "Der Hauptgrund für Stress ist der tägliche Kontakt mit Idioten."
          Albert Einstein

          Kommentar


            #6
            Thanks for the answer, I hope i'am always well

            I am attaching an example of code, as you can see it is very simple..

            It all started because I bought an ABB module for the fancoils, the problem that at the moment I can't do a very stupid who thing that can be done with other brands, i.e. don't start the fan if the water temperature is higher than x if it is in winter mode..

            ps: by the way ABB didn't answer me​

            PHP-Code:
            <?php
            require('./include/boot.php');


            //Server creation
            $ha ('::ha', array(

               
            'mode' => 'server',
               
            'key' => 'maria'

            ));

            //I add interfacing to knx, or other home automation systems in the future
            $ha->addModule('knx', array(

                        
            'host' => '192.168.178.21',
                        
            'port' => 3671,
                        
            'tunneling' => 'udp',
            ));


            $ha->onLoad(function($m$t)
            {
                  
            //On loading event I start tunneling
                  
                  
            $m->knx->start();

                  
            $m->knx->change('0/5/2', function($m$t){

                     
            //Whenever the value is changed, I run this function,
                     //for example if the temperature is 30, if the state has changed.. etc
                    
                  
            });


            })->
            addQueue(function($m$t//$m are modules, $t instance $ha
            {
               
            //A queue is basically a timeout function
              
               
            if($m->knx->isConnected())
               {
                  
            //I do a connection check however this check is done surreptitiously when calling request functions
                  
                  
            $m->knx->set('0/5/50'50'5.001'); //write the value

                  
            $val $m->knx->get('0/5/50''5.001'); //read the value
                  
               
            }


            }, 
            10//every 10 seconds

            ->onUnload(function()
            {
               
            //..
            })

            ->
            run(); //I start the process.. only in server mode​

            Kommentar


              #7
              If you want to find people interested in your code, why don't you put it up on GitHub or GitLab?

              Kommentar


                #8
                Zitat von meti Beitrag anzeigen
                If you want to find people interested in your code, why don't you put it up on GitHub or GitLab?
                Thanks for the reply.. at the moment my code is not ready.. I just wanted to understand if something good is done..

                Kommentar


                  #9
                  Hey!

                  I am very interested in your code as I also do a lot in PHP.
                  What is in your boot.php?
                  Is there the class in there?
                  How does it look?

                  Greetings
                  Alex​

                  Kommentar


                    #10
                    Hi Alex, I'm glad you're interested, inside boot there is simply the initialization of my fw, which I created for the realization of my projects, 'ha' is the home automation management component where you can add the currently only the knx module, but in the future maybe even more..

                    If you use PHP, I think you understand the potential..​

                    Kommentar


                      #11
                      Moin!

                      Yes, I had a few ideas so spontaneously... The FW is that of the BAOS module?
                      I've often thought about getting a BAOS. Do you have a git for your software?

                      There are already implementations (with Perl) that communicate directly with KNX via the multicast address. You could take a look (open source) and get ideas (or translate them into PHP).

                      There is also the KNXD. Communication with PHP is also possible via this interface (open source).

                      Just my 2 cents.​

                      Greetings
                      Alex

                      Kommentar


                        #12
                        Zitat von AlexSchei Beitrag anzeigen
                        Moin!

                        Yes, I had a few ideas so spontaneously... The FW is that of the BAOS module?

                        I don't use baos, the tunneling is created by the server part (php), the fw manages everything else: db, html, sessions, etc..

                        I've often thought about getting a BAOS. Do you have a git for your software?

                        No, I still don't have a version that I can release, also because I only tested with my 773 interface, therefore only UDP tunneling no TCP and...

                        There are already implementations (with Perl) that communicate directly with KNX via the multicast address. You could take a look (open source) and get ideas (or translate them into PHP).

                        There is also the KNXD. Communication with PHP is also possible via this interface (open source).


                        I know that I can connect to a server like openhub or write one in c/vb or use a python one (which I don't know), however my intention was to use only and exclusively the LAMP in order to facilitate the html display too .


                        Kommentar

                        Lädt...
                        X