Ankündigung

Einklappen
Keine Ankündigung bisher.

Smart Meter: YouLess LS120

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

  • Smart Meter: YouLess LS120

    Recently, I bought a YouLess LS120 to read the smart meter via the P1 port. Other samples on this forum helped me a great deal, but I wanted to retrieve some more information than actual power use alone.

    So, I collected other pieces of small PicoC code on the web and created a new program that reads all relevant attributes from the JSON file that is returned when you query the YouLess device with http://ip_address/e?f=j

    The code is as follows:

    (Please download YouLess LS120 Parser.txt as I can't paste the code correctly in this editor)

    The script is easy to adapt to your own specifications, so please do and let me know any comments that you have.
    Angehängte Dateien
    Zuletzt geändert von rverkaik; In den letzten 4 Wochen.

  • #2
    Hello and thanks for your script. I don't have too much PicoC experience and can't get the script to run properly. I've copied your code and changed the IP address in my own. It won't produce any output however. When I pull my log file I'm getting the following fault message:

    float p1 = GetValue(""p1":", 0);
    ^
    Youless Fetcher:65:30 identifier not expected here


    Anyone any thoughts on what I'm doing wrong or should alter?

    Thanks a lot in advance!

    Kommentar


    • #3
      Zitat von rverkaik Beitrag anzeigen
      Recently, I bought a YouLess LS120 to read the smart meter via the P1 port. Other samples on this forum helped me a great deal, but I wanted to retrieve some more information than actual power use alone.

      So, I collected other pieces of small PicoC code on the web and created a new program that reads all relevant attributes from the JSON file that is returned when you query the YouLess device with http://ip_address/e?f=j

      The code is as follows:

      [PHP]

      The script is easy to adapt to your own specifications, so please do and let me know any comments that you have.

      Does this actually work for you? I want to check this before I try to load it into my own MiniServer... thing is that this shows PHP as code, which makes me worried to ruin my config.

      Also how do you feed AQ1/AQ2/AQ3 to the energy monitor function block (which parameters on that block)? maybe a screenshot would help.
      Zuletzt geändert von HBeumer; In den letzten 4 Wochen.

      Kommentar


      • #4
        I tried the program, but don't get any values other then zero.
        in the Log I get the same message as RvdB ...

        float p1 = GetValue(""p1":", 0);
        ^
        Youless Fetcher:65:30 identifier not expected here



        Was this ever solved?
        Zuletzt geändert von HBeumer; In den letzten 4 Wochen.

        Kommentar


        • #5
          @HBeumer

          could it be, that before the inner " (string) the escape character \ is missing ?

          try this

          Code:
          if(result != 0)
              {
          float p1 = GetValue("\"p1\":", 0);
          float p2 = GetValue("\"p2\":", 0);
          setoutput(EnergyConsumption, p1+p2);
          
          float n1 = GetValue("\"n1\":", 0);
          float n2 = GetValue("\"n2\":", 0);
          setoutput(EnergyProduction, n1+n2);
          
          float pwr = GetValue("\"pwr\":", 0);
          setoutput(ActualPowerUse, pwr / 1000);
          
          float gas = GetValue("\"gas\":", 0);
          setoutput(GasConsumption, gas);
          
          free(result);
              }
          Zuletzt geändert von Labmaster; In den letzten 4 Wochen.

          Kommentar


          • HBeumer
            HBeumer kommentierte
            Kommentar bearbeiten
            Awesome, seems to do the trick.. some values are now coming through.

          • Labmaster
            Labmaster kommentierte
            Kommentar bearbeiten
            I guess the escape characters are gone as the code was posted as PHP Code

        • #6
          Based on the script I've created a XML file, which can be used to easily create a Virtual Input for loxone.

          Simply paste the following in an XML file, update the IP address and safe it in the right loxone directory.
          Please note that in the Netherlands we have a high and a low price tariff, hence the P1/P2 and N1/N2 values.

          Code:
          <?xml version="1.0" encoding="utf-8"?>
          <VirtualInHttp Title="Youless" Comment="" Address="http://192.168.xxx.xxx/e?f=j" PollingTime="10">
              <VirtualInHttpCmd Title="import from network low tariff" Comment="" Check="\i&quot;p1&quot;:\i\v" Signed="true" Analog="true" SourceValLow="0" DestValLow="0" SourceValHigh="100" DestValHigh="100" DefVal="0" MinVal="-100000" MaxVal="100000"/>
              <VirtualInHttpCmd Title="import from network high tariff" Comment="" Check="\i&quot;p2&quot;:\i\v" Signed="true" Analog="true" SourceValLow="0" DestValLow="0" SourceValHigh="100" DestValHigh="100" DefVal="0" MinVal="-100000" MaxVal="100000"/>
              <VirtualInHttpCmd Title="export to network low tariff" Comment="" Check="\i&quot;n1&quot;:\i\v" Signed="true" Analog="true" SourceValLow="0" DestValLow="0" SourceValHigh="100" DestValHigh="100" DefVal="0" MinVal="-100000" MaxVal="100000"/>
              <VirtualInHttpCmd Title="export to network high tariff" Comment="" Check="\i&quot;n2&quot;:\i\v" Signed="true" Analog="true" SourceValLow="0" DestValLow="0" SourceValHigh="100" DestValHigh="100" DefVal="0" MinVal="-100000" MaxVal="100000"/>
              <VirtualInHttpCmd Title="Current PWR to or from power provider" Comment="" Check="\i&quot;pwr&quot;:\i\v" Signed="true" Analog="true" SourceValLow="0" DestValLow="0" SourceValHigh="100" DestValHigh="100" DefVal="0" MinVal="-100000" MaxVal="100000"/>
          </VirtualInHttp>

          Kommentar


          • #7
            I tried the program and it works. Only the "current power" is always positive, even when my PV installation is producing more power them I am using. Any idea how to change this?

            Kommentar


            • #8
              Zitat von Domoluxe Beitrag anzeigen
              I tried the program and it works. Only the "current power" is always positive, even when my PV installation is producing more power them I am using. Any idea how to change this?
              on the VI in loxconfig you have to check the "signed values" checkbox.

              Kommentar

              Lädt...
              X