Ankündigung

Einklappen
Keine Ankündigung bisher.

Reading a GA and displaying the value in decimal via PHP

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

  • callidomus
    antwortet
    Zitat von Warichet Beitrag anzeigen
    0.23 which is totally inconsistent
    as I think about it. It couldn't be a raw value. There are only bits (represented as integers or hex) on the wire. The conversion to float happens afterwards.
    In your case you get a float from the groupread command. That doesn't seem right.

    sorry, i couldn't help you further.

    Marcus

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Hi Nils,

    Nice to hear from you again.
    Zitat von NilsS Beitrag anzeigen
    Its in python but that shouldn't be to hard to port to php.
    Mmmm, this is far beyhond my modest programming skills

    I'm still puzzled by the post on the professional forum, it clearly says "
    Umrechnung Temperaturen" and I've no reason to suspect it.
    Then, it could be that GroupRead doesn't supply the data in a format compatible with the conversion routine.

    Thank you for your kind help

    Einen Kommentar schreiben:


  • callidomus
    antwortet
    Hi Ray/Marc?,

    I have found your post on the French google group. I think the F2_decode function is the right one. But you could compare it to Nils function.

    Hth

    Marcus

    Einen Kommentar schreiben:


  • NilsS
    antwortet
    Hi Ray,

    maybe this can help you get eis5 (DPT9) decoding done.
    SourceForge.net Repository - [openautomation] Contents of /PyWireGate/trunk/knx_connector/DPT_Types.py

    Its in python but that shouldn't be to hard to port to php.

    There is also a DPT Type guessing function.

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von mknx Beitrag anzeigen
    You are using the wrong decoding function.
    Ah ?!? some light in my tunnel

    Zitat von mknx Beitrag anzeigen
    there should be a function in the client
    I've seen the function f2_decode($val), it doesn't work either, maybe it was the wrong one.

    Zitat von mknx Beitrag anzeigen
    you have to Look for the right function by yourself.
    OK, I'll have a closer look.

    Thank you for the hint.

    PS: I was convinced it was the right function, because when I type a value, as seen in ETS, I get the right output.

    Einen Kommentar schreiben:


  • callidomus
    antwortet
    I think I see your Problem. You are using the wrong decoding function. Floating Point values are a little ugly to decode, but there should be a function in the client.

    I'm on a Road Trip and have no access to my dev computer. => you have to Look for the right function by yourself.

    So long

    Marcus

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von mknx Beitrag anzeigen
    I give it a try.
    Much appreciated, thank you aforehand

    Zitat von mknx Beitrag anzeigen
    What is the return value of the Groupwrite command?
    0.23 which is totally inconsistent
    The actual temp as shown in the Visu is 21.8

    Zitat von mknx Beitrag anzeigen
    And you do have an running eibd, which listens on 127.0.0.1.
    Yes, I understand that's the standard way of doing.
    eibd is running on a NAS QNAP with PHP5.
    I've another application to display KNX data on a Cisco phone, also using PHP, and it is working fine, using the same GroupRead.

    Thanks

    Einen Kommentar schreiben:


  • callidomus
    antwortet
    I'm not sure that I could help you, but I give it a try. What is the return value of the Groupwrite command?
    And you do have an running eibd, which listens on 127.0.0.1.

    Marcus

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    This is beyhond my understanding.
    The command GroupRead is not to be suspected as it works in other applications in the same environment.

    The conversion is not to be suspected as it works with a fixed value.

    But the 2 together, no go.

    Anyone has an idea, please ?

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    There is something wrong with the GroupRead
    When I force the input to a known value, the conversion works fine, i.e: 1902 = 20,64°
    PHP-Code:
    $value GroupRead("127.0.0.1","0/6/38");
    $value 1902;
    $eis5 hexdec($value);
    $wert = ($eis5 0x07ff);
    if ((
    $eis5 0x08000) != 0)
     {
     
    $wert $wert 0xfffff800;
     
    $wert $wert *-1;
     }
    $wert $wert << (($eis5 0x07800) >> 11);
    if ((
    $eis5 0x08000) != 0)
     {
     
    $wert $wert * -1;
     }
    $val $wert/100;
    ......
    $string "Temp: " $val "°C"

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Hi,

    I'm unable to make anything consistent with the conversion.
    Here is an extract of the code
    PHP-Code:
    $value GroupRead("127.0.0.1","0/6/38");
    ....
    $eis5 hexdec($value);
    $wert = ($eis5 0x07ff);
    if ((
    $eis5 0x08000) != 0)
     {
     
    $wert $wert 0xfffff800;
     
    $wert $wert *-1;
     }
    $wert $wert << (($eis5 0x07800) >> 11);
    if ((
    $eis5 0x08000) != 0)
     {
     
    $wert $wert * -1;
     }
    $val $wert/100;
    ......
    $string "Temp: " $val "°C"
    Maybe a sharp eye will see the problem ?

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von mknx Beitrag anzeigen
    Download the source code and look for a php file.
    That's what I did before posting.
    No luck

    Thanks anyway

    Einen Kommentar schreiben:


  • callidomus
    antwortet
    Hi,

    I dont know the path. Download the source code and look for a php file. On Linux you could use: find . | grep php

    So Long

    Marcus

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Hi,

    Zitat von mknx Beitrag anzeigen
    see the eibd examples threre is a simple php client.
    I don't feel at home within eibd, I would appreciate a pointer to the file

    Thank you

    Einen Kommentar schreiben:


  • callidomus
    antwortet
    Hi,

    see the eibd examples threre is a simple php client.

    hth

    Marcus

    Einen Kommentar schreiben:

Lädt...
X