How to limit the frequency of sending data through a virtual output?

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Dmode90
    Dumb Home'r
    • 12.08.2023
    • 13

    #1

    How to limit the frequency of sending data through a virtual output?

    How to limit the frequency of sending data (JSON) through a virtual output in Loxone Config to ensure that data is sent no more frequently than once every 30 seconds, instead of every time the value changes as it currently does?

    I am assembling a JSON using STATUS blocks tree and sending it directly to a virtual output. However, the data is being sent too frequently. I tried using a TEXT_GENERATOR block before the virtual output and triggering it with a pulse every 30 seconds. But when the trigger output value is low, it lacks values, and the virtual output interprets this as a change and attempts to send the empty value.
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 274
Größe: 38,1 KB
ID: 421156Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 198
Größe: 27,6 KB
ID: 421157​​
  • duncan
    LoxBus Spammer
    • 28.08.2015
    • 313

    #2
    if you cant reduce the sampling rate directly from your virtual inputs, one option is to connect them to your status blocks via an analog memory block, and put a pulse every 30 mins onto the set input - this will transfer the input value to the output value every 30 mins

    Kommentar

    • Tico
      Lox Guru
      • 31.08.2016
      • 1035

      #3
      What about changing the Virtual Output 'Command for ON' to just <v>. The full 'Command for ON' is constructed in the Status-text field. In the Status-text field, place <v1> where the constructed text would normally go. Text input goes to I1 of the Status block. A pulse generator (29 secs off, 1 sec on) goes to I2 of the Status block. Then Status block logic -

      If I2 ==1, Status-text Command for on <v1> here

      The second line of the Status block is empty. Nothing will be sent on off.
      Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

      Kommentar

      • Dmode90
        Dumb Home'r
        • 12.08.2023
        • 13

        #4
        Zitat von duncan
        if you cant reduce the sampling rate directly from your virtual inputs...
        Could you please explain what you meant by reducing the sampling rate directly from virtual inputs?

        Zitat von duncan
        one option is to connect them to your status blocks via an analog memory block, and put a pulse every...
        Analog memory block converts string to 1.
        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 182
Größe: 22,0 KB
ID: 421244

        Kommentar


        • Tico
          Tico kommentierte
          Kommentar bearbeiten
          I think duncan was referring to the raw numeric value coming from the virtual inputs and memory flags. An analogue memory needs to be placed on every input (x12?). The analogue memory will only retain numeric values. It won’t retain the unit appended to each value.
          You can re-create the unit in the status-text field ( eg. <v1.3>rpm )
          It’s probably simpler to execute the approach at post #3.
      • Dmode90
        Dumb Home'r
        • 12.08.2023
        • 13

        #5
        Zitat von Tico
        What about changing the Virtual Output 'Command for ON' to just <v>.
        Done.
        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 178
Größe: 8,1 KB
ID: 421246

        Zitat von Tico
        The full 'Command for ON' is constructed in the Status-text field. In the Status-text field, place <v1> where the constructed text would normally go. Text input goes to I1 of the Status block. A pulse generator (29 secs off, 1 sec on) goes to I2 of the Status block. Then Status block logic -

        If I2 ==1, Status-text Command for on <v1> here

        The second line of the Status block is empty. Nothing will be sent on off.​

        Done (if I understood correctly). But pulse placed to i4 input. And set to 15s (0.1ON, 14.9OFF)
        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 177
Größe: 84,2 KB
ID: 421247
        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 173
Größe: 30,2 KB
ID: 421248


        But as a result, requests are still made more frequently than the pulse settings (15s).
        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 175
Größe: 18,0 KB
ID: 421249

        Kommentar

        • Tico
          Lox Guru
          • 31.08.2016
          • 1035

          #6
          From the last Status block you have pictured here -

          Klicke auf die Grafik für eine vergrößerte Ansicht

Name: 2nd Last Status block.png
Ansichten: 227
Größe: 9,2 KB
ID: 421253

          Take the Txt output into a new Status block before the Virtual Output. This last Status block will contain the argument that will prevent changes flowing through to the Virtual Output.

          Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Last Status block.png
Ansichten: 181
Größe: 5,9 KB
ID: 421254


          I1 is the Text input. I2 is the Pulse Generator. Only when the Pulse Generator is high, will the command be executed by the Virtual Output.

          To ensure you don't have any extra messages during the brief time that I2 is held high, I would make the Pulse Generator very fast. ie. Duration On = 0.2, Duration Off = 29.8.

          The Txt output of the last Status block goes to the Virtual Output with Command for ON <v>
          Zuletzt geändert von Tico; 01.02.2024, 06:08.
          Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

          Kommentar

          • Dmode90
            Dumb Home'r
            • 12.08.2023
            • 13

            #7
            Zitat von Tico
            Take the Txt output into a new Status block before the Virtual Output. This last Status block will contain the argument that will prevent changes flowing through to the Virtual Output.
            I did everything just like on your screenshots.
            Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 162
Größe: 26,5 KB
ID: 421303
            Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 165
Größe: 11,9 KB
ID: 421304

            But unfortunately, when there's no pulse, the string disappears from the output of the status block.

            Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 189
Größe: 19,7 KB
ID: 421301
            Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 170
Größe: 17,6 KB
ID: 421302

            So, the virtual output considers this a change and sends an empty message.

            Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 161
Größe: 21,1 KB
ID: 421305

            Kommentar

            • Dmode90
              Dumb Home'r
              • 12.08.2023
              • 13

              #8

              However, the solution you proposed here, with an analog memory block on each input of the status block, solves the problem but requires many monotonous steps.
              It would be much more efficient if everything could be resolved by the last status block without analog memory...

              Thank you so much for the tip. I would be even more grateful if you could help finalize the solution with the last status block.
              Click image for larger version  Name:	image.png Views:	0 Size:	38.4 KB ID:	421308
              Angehängte Dateien
              Zuletzt geändert von Dmode90; 01.02.2024, 11:51.

              Kommentar

              • Tico
                Lox Guru
                • 31.08.2016
                • 1035

                #9
                I hadn't appreciated that all your data is going in the 'HTTP Body for ON'. The use of <v> in this field isn't effective for subduing unwanted messages.

                When <v> is used for the 'Command for ON', it effectively kills the structure of the POST command. I don't have a solution unfortunately.

                The analogue memories might be the only option.
                Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                Kommentar

                • Tico
                  Lox Guru
                  • 31.08.2016
                  • 1035

                  #10
                  Also try entering a white space (space-bar) on the second line of the Status Text. If you hover over the space, it will look like this -

                  Klicke auf die Grafik für eine vergrößerte Ansicht

Name: White space.gif
Ansichten: 181
Größe: 23,0 KB
ID: 421314
                  Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                  Kommentar

                  • Dmode90
                    Dumb Home'r
                    • 12.08.2023
                    • 13

                    #11
                    Zitat von Tico
                    Also try entering a white space (space-bar) on the second line of the Status Text.
                    Didn't help, the string still disappears from the output of the status block when the pulse block is at a low state.

                    Kommentar


                    • Tico
                      Tico kommentierte
                      Kommentar bearbeiten
                      The string should disappear when the pulse block is at a low state. What we really want to assure is that nothing is sent to the Virtual Output in the low state.
                      If a condition isn't satisfied in a Status Block, the final line in the Status-Text or Value will be output. That would normally be a zero in the low state. The white-space has had some success before in not being recognised as a value. Therefore, no value change and no POST command is sent.
                      Does the POST command send anything when the white-space is used? Does it cause issues in the downstream application?
                      Zuletzt geändert von Tico; 01.02.2024, 14:46.
                  • Dmode90
                    Dumb Home'r
                    • 12.08.2023
                    • 13

                    #12
                    Zitat von Tico commented
                    What does the POST command send when the white-space is used?
                    White space as POST request body

                    Zitat von Tico commented
                    Does it cause issues in the downstream application?
                    ​No issues, except for an unnecessary POST request, and the response with an error code.

                    Kommentar

                    • romildo
                      Lebende Foren Legende
                      • 25.08.2015
                      • 5144

                      #13
                      ...maybe in this way​

                      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: TextAusgabeverzögerung.png
Ansichten: 238
Größe: 147,5 KB
ID: 421371
                      lg Romildo

                      Kommentar

                      • Tico
                        Lox Guru
                        • 31.08.2016
                        • 1035

                        #14
                        Very nice romildo. Is it your view that the Status block behaviour has changed over recent upgrades?
                        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                        Kommentar


                        • romildo
                          romildo kommentierte
                          Kommentar bearbeiten
                          no, I do not think so, but I don't know.
                      Lädt...