Experiences with openHAB?



  • Hi all,

    I am looking for a control unit for my upcoming smart hone.As I already have a M103 running for my heating (coded it on my own based on C) I prefer to use it for the control unit for smart home.

    I was thinking of using openHAB as it appears to be the most active and stable way for such a unit (tried with NodeRed but this looks really complicated for me) Some years ago I did some first steps in FHEM - I could imagine to get it running...

    Anyway, anyone here who has some experience with openHAB on a Neuron device?

    Thanks!

    /KNEBB



  • Hi,

    just for reference and to help future questions:

    I am running OpenHAB on a dedicated RasPi. It is a Java application which I do not want to run on a Neuron. Keep it simple and stupid.

    In C code it was not too complicated to get data from OpenHAB though curl calls.
    See code snipplet:

    /* Function gets calledd with an item name          */
    /* The url is defined here globally:                */
    /* url="http://openhab.domain.com:8080/rest/items/" */
    
    long get_2file(char *url, char *filename )
    
    {
    CURL *curl_handle;
    FILE *FI;
    
    int r,code;
    
    code = 0;
    curl_handle = curl_easy_init();
    
    /* set URL to get here */
    curl_easy_setopt(curl_handle, CURLOPT_URL, url);
    
    /* disable progress meter, set to 0L to enable and disable debug output */
    curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
    
    /* use default write function */
    curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, NULL);
    
    /* open the file */
    FI = fopen(filename, "w");
    if(FI) {
    
            /* write the page body to this file handle */
            curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, FI);
    
            /* get it! */
            r = curl_easy_perform(curl_handle);
            if (r != 0) {
                    code=-1;
            } else {
                    /* Data is now in the file */
            }
            /* close the header file */
            r = fclose(FI);
    } else {
            code=-1;
    }
    /* cleanup curl stuff */
    curl_easy_cleanup(curl_handle);
    
    return code;
    }
    

Log in to reply