Ankündigung

Einklappen
Keine Ankündigung bisher.

Miele@Home LBS for Homeserver (14360)

Einklappen
Dieser Beitrag wurde beantwortet.
X
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Roeller Works great, thank you for your commitment!

    MarcelAdamsKNX https://github.com/En3rGy/11087_JSON...rser_v1.4.hslz
    Was meinst Du mit A5 im Detail? Nachstehend die Möglichkeiten von Miele zur Spülmaschine.

    image.png

    PHP-Code:
    "ProgramID": { "value_raw"13"value_localized""QuickPowerWash""key_localized""Program name" }, "status": { "value_raw"5"value_localized""In use""key_localized""status" }, "programType": { "value_raw"0"value_localized""Program""key_localized""Program type" }, "programPhase": { "value_raw"1795"value_localized""Main wash""key_localized""Program phase" }, "remainingTime": [ 054 ], "startTime": [ 0], "targetTemperature": [ { "value_raw": -32768"value_localized"null"unit""Celsius" }, { "value_raw": -32768"value_localized"null"unit""Celsius" }, { "value_raw": -32768"value_localized"null"unit""Celsius" } ], "coreTargetTemperature": [ { "value_raw": -32768"value_localized"null"unit""Celsius" } ], "temperature": [ { "value_raw": -32768"value_localized"null"unit""Celsius" }, { "value_raw": -32768"value_localized"null"unit""Celsius" }, { "value_raw": -32768"value_localized"null"unit""Celsius" } ], "coreTemperature": [ { "value_raw": -32768"value_localized"null"unit""Celsius" } ], "signalInfo"false"signalFailure"false"signalDoor"false"remoteEnable": { "fullRemoteControl"true"smartGrid"false"mobileStart"true }, "ambientLight"null"light"null"elapsedTime": [ 028 ], "spinningSpeed": { "unit""rpm""value_raw"null"value_localized"null"key_localized""Spin speed" }, "dryingStep": { "value_raw"null"value_localized""""key_localized""Drying level" }, "ventilationStep": { "value_raw"null"value_localized""""key_localized""Fan level" }, "plateStep": [ ], "ecoFeedback": { "currentWaterConsumption": { "unit""l""value"}, "currentEnergyConsumption": { "unit""kWh""value"0.7 }, "waterForecast"0.4"energyForecast"0.65 }, "batteryLevel"null

    Knochen Hast Du eine Möglichkeit gefunden die Restzeit vernünftig zu formatieren? Mit den LBS vom HS komme ich da irgendwie nicht zurecht...
    Zuletzt geändert von SMA; 11.02.2026, 09:22.
    Grüße
    Marc

    Kommentar


      It's now VERY EASY to extract the JSON values. See this scripting block I've build:


      https://knx-user-forum.de/forum/%C3%...tyserver-14362



      Example:


      JSON
      Let's take the following sample JSON to explain:
      PHP-Code:
      {
        
      "device": {
          
      "name""LivingRoomController",
          
      "status""online",
          
      "metrics": {
            
      "temperature"21.6,
            
      "humidity"48,
            
      "power"312.4
          
      },
          
      "modes": [
            { 
      "id"1"name""Auto""active"true },
            { 
      "id"2"name""Eco""active"false },
            { 
      "id"3"name""Boost""active"false }
          ]
        }
      }
      ​​ 
      Connect the Miele Building Block Output to the Scripting Building Block Input (for example: Input to IN11). Then set the following script:


      PHP-Code:
      ​var obj JSON.parse(IN11); // Read Input11 as JSON

      OUT11 obj.device.name// "LivingRoomController"

      OUT12 obj.device.metrics.temperature// 21.6

      OUT13 obj.device.modes[0].name// "Auto"

      OUT14 obj.device.modes[2].active// false

      OUT15 obj.device.modes.length// 3

      OUT16 obj.device.status " / " obj.device.metrics.power "W"


      Special note on the last example, If you are using " or ' in a script, please read this note: https://knx-user-forum.de/forum/%C3%...93#post2082193
      The homeserver does not allow ' or ". And if you try it via copy/paste from notepad.exe, it seems to work, but after the Homeserver restarts, it will replace " with a ?

      And you get all the values at the outputs of the Scripting block! Just two blocks to get this done!
      Zuletzt geändert von Roeller; 01.03.2026, 17:37.

      Kommentar


        I know you're doing great work, and it's probably a simple task for most IT professionals.
        But I don't understand which LBS I need to wire up and how to get the values.
        Could you perhaps give a small example of how the JSON string needs to be processed so I can get the filling level readings?

        TIA.
        image.png
        ​​​

        Kommentar


          Hello Knochen. Well, you are almost there!

          Connect the A12 Fillinglevels to the IN11 TXT of the Scripting logic.
          The output A12 will give you some JSON output like this:

          HTML-Code:
           [{"deviceId":"000023234234", "fillingLevels":{"twinDosContainer1FillingLeve l":n ull, "twinDosContainer.....
          (just log the stuff to textlines, a split textlines or an text-archive to see it).

          Now, just drop the content in AI and ask "Give me a script for my building block from https://www.roelbroersma.nl/scripting, based on javascript which extracts the fillinglevels... (detail here) to OUT11-OUT15, while the JSON input is at IN11."

          Or (if you want to figure it out yourself), set the Script (of the Scripting Block) to:


          PHP-Code:
          var obj JSON.parse(IN11);
          var 
          dev obj.find(=> d.deviceId === "000023234234");
          OUT11 Object.entries(dev.fillingLevels)[0]; 

          Line 1 = Parse the JSON.
          Line 2 = Get the array )all fillinglevels) for device: 000023234234
          Line 3 = Get the first fillinglevel for that device


          If you want to specify the FillingLevel by name, use something like this:

          PHP-Code:
          var obj JSON.parse(IN11);
          OUT11 arr.find(=> d.deviceId === "000023234234")?.fillingLevels?.twinDosContainer1FillingLevel
          Throw that as a Oneliner into the Script input. If you want such a Oneline, go to www.roelbroersma.nl/scripting, it will create it for you.

          Want more fillinglevels? One at OUT11, another at OUT12, see this example:

          PHP-Code:
          var obj JSON.parse(IN11); OUT11 arr.find(=> d.deviceId === "000023234234")?.fillingLevels?.twinDosContainer1FillingLevelOUT12 arr.find(=> d.deviceId === "00001111111")?.fillingLevels?.twinDosContainer2FillingLevel


          Connect a telegramgenerator to the "Get Fillinglevels" and trigger the block every 30 seconds (could also be less.. but just for testing is OK). This will trigger ALL fillinglevels of ALL devices. So you don't need the "Get FillingLevel" input anymore.


          Voila... you get the outputs! Just two block... and 1 line between the Miele Block and the Scripting Block.


          Or use the scripting building block to separate the output, so you can first copy it to a notepad or see it better:

          PHP-Code:
          var IN11;for (let i=0;i<10;i++) this["OUT"+(11+i)] = s.slice(i*50,(i+1)*50); 



          Special note: If you are using " or ' in a script, please read this note: https://knx-user-forum.de/forum/%C3%...93#post2082193
          The homeserver does not allow ' or ". And if you try it via copy/paste from notepad.exe, it seems to work, but after the Homeserver restarts, it will replace " with a ? See the workarround in that note.​​
          Zuletzt geändert von Roeller; 01.03.2026, 17:39.

          Kommentar


            222.jpg Ok, I wired it as intended, but I don´t receive any output.
            Trigger is set to 30 seconds.
            Dishwasher is powered up.

            Any idea?
            Martin
            Zuletzt geändert von Knochen; 28.02.2026, 17:47.

            Kommentar


              You have nothing at your Script input. It doesn't know what to do know...

              Kommentar


                Put the 'text in zeilen' block directly to the output of the Miele Module. And show a screenshot. Then I give you the script. You can blank the devices (or not.. it doesn't matter.. it's not privacy or so)

                Kommentar


                  Limitations in Homeserver do not allow you to have a " or ' (double or single quote) in the Script. But there is a solution!

                  1. For easy testing your scripts (on the fly, so you don't have to restart your homeserver every time, we do the following:

                  image.png

                  We use netcat, (download from here: https://nmap.org/dist/ncat-portable-5.59BETA1.zip) to send the script to the homeserver Logic Node, script input.



                  For this to work, set this in the Homeserver:

                  A. Under Communication -> IP/KNX Telegrams (receive):
                  image.png​​(just for the test, allow the call from anywhere)


                  B. On the tab: Receive

                  Capture the output and set it to a 14Byte Text field:

                  image.png

                  C. Connect the 14Byte Text field to the Script input on the Homeserver:

                  image.png



                  ​Once you have tested and a good working script. You want to set it on the Script Input, however, there is a problem. The Experte does not allow ' or " to be used as 'initial value'. You might copy/paste it from Notepad, but after the Homeserver restarts, it will convert " to ?

                  The solution for this:


                  Under Communications -> Send IP/KNX telegrams: Create a telegram that 'sends' text to a 14Byte Text object.

                  image.png
                  And on the Send tab, set the script:


                  image.png

                  Now, on the logpc page, make it like this: This will trigger the script to the script input, right after the Homeserver starts. It allows single and double quotes now.
                  image.png


                  I hope they will allow ' and " in future Experte versions..

                  Angehängte Dateien

                  Kommentar

                  Lädt...
                  X