Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Visualization
    4. How to create a variable Object Id in Vis 2?

    NEWS

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    How to create a variable Object Id in Vis 2?

    This topic has been deleted. Only users with topic management privileges can see it.
    • Jack 3
      Jack 3 last edited by

      Hello,

      I am trying to link an object ID to the value of another object. I have many objects which are named the same except for one number, which I would like to be able to change from the Vis_2 platfrom so I can change which one I am monitoring from the runtime window. I have included the object ID below.

      modbus.0.holdingRegisters.1.40001_Output_voltage

      The 0 between "modbus" and "holding" I would like to be able to change like a variable with the value of another object which is named as follows.

      0_userdata.0.variable

      I am trying to do this in a widget from the basic library called "Number". I have also attached a picture of the widget and attributes. Please let me know if you need any more information. Thanks in advance.

      6b53c4e7-bff7-4592-8e3f-7381700028da-image.png

      Homoran 1 Reply Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @Jack 3 last edited by

        @jack-3 I don't know whether I did understand exactly what you are intended to do.

        I don't see what you want to achieve by linking two oid's.
        So I cannot tell whether this is possible at all.

        The field you filled to append is usually used for the unit

        Jack 3 1 Reply Last reply Reply Quote 0
        • Jack 3
          Jack 3 @Homoran last edited by

          @homoran The appending thing i didnt mean to be in there, that is a mistake on my part. What I would like is that the object ID for the number widget changes with a value that I enter into an input widget. So when I input 0, the obejct Id for this number widget will be modbus.0.holdingRegisters.1.40001_Output_voltage, when I input 1 it will be modbus.1.holdingRegisters.1.40001_Output_voltage etc.

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @Jack 3 last edited by

            @jack-3 sagte in How to create a variable Object Id in Vis 2?:

            What I would like

            ok! Now I understand!
            But again: I really dont 'know whether this is possible. (at least this way)

            Let's try to see it from another angle
            Your primary aim is to get different numbers in the same widget, right?

            Jack 3 1 Reply Last reply Reply Quote 0
            • Jack 3
              Jack 3 @Homoran last edited by

              @homoran Im not sure what is meant by that, my primary aim is to be able to display values from different objects with the same widget, and also to be able to change which object it is myelf from the runtime window. I understand this is a very odd request and it very well may not be possible.

              OliverIO Homoran 2 Replies Last reply Reply Quote 0
              • OliverIO
                OliverIO @Jack 3 last edited by

                @jack-3

                in vis1 this was not possible (i called this dynamic id)
                I'm pretty sure that this was not implemented in vis-2 either

                1. you can create an issue on github for a feature request

                To achieve your goal, you can place several widgets on top of each other and switch the visibility on and off depending on the condition
                (at least with only a few object IDs)

                For more complex rules and more IDs, I would create with blockly/javascript/node-red to display the corresponding value using exactly one data point in a widget

                Jack 3 1 Reply Last reply Reply Quote 1
                • Homoran
                  Homoran Global Moderator Administrators @Jack 3 last edited by Homoran

                  @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                  my primary aim is to be able to display values from different objects with the same widget,

                  That is what I tried to say 😁
                  ok!

                  @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                  also to be able to change which object it is myelf from the runtime

                  yes, that would have been my next question to clarify.

                  @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                  I understand this is a very odd request

                  no it isn't!

                  @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                  it very well may not be possible.

                  I think it will be possible, but not by this way

                  EDIT
                  @OLIVERIO figured out some possible ways to do

                  Jack 3 1 Reply Last reply Reply Quote 0
                  • Jack 3
                    Jack 3 @OliverIO last edited by

                    @oliverio Ok, thank you for the help. About making an issue on GitHub, I'm fairly new to GitHub overall. Where would I go to do this and how would I phrase this request?Thanks.

                    OliverIO 1 Reply Last reply Reply Quote 0
                    • Jack 3
                      Jack 3 @Homoran last edited by

                      @homoran How would you do it in the other way that you mention? Thank you for helping me with this.

                      Homoran 1 Reply Last reply Reply Quote 0
                      • OliverIO
                        OliverIO @Jack 3 last edited by OliverIO

                        @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                        Where would I go to do this and how would I phrase this request?Thanks

                        this is the place there all the source code live
                        https://github.com/ioBroker/ioBroker.vis-2

                        on this page you can see all open (and closed) issues
                        you can create a new issue via the green button on top right

                        the form "Feature request" will guide you.

                        Describe it as if you were explaining it to a 12-year-old. (no the developer is not only 12 😉 )
                        but as clearly and precisely as possible.
                        perhaps with an example, your specific use case
                        and what you expect to see at the end.

                        1 Reply Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @Jack 3 last edited by

                          @jack-3 sagte in How to create a variable Object Id in Vis 2?:

                          How would you do it in the other way that you mention?

                          I also would use a kind of logic.
                          Using the input widget, connected to an state where your input is stored.
                          Triggering on that state on change, read this value and write the value of the according state to another state, that is displayed in the number widget.

                          Sorry for such a long phrase. I hope it won't confuse too much.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          864
                          Online

                          31.6k
                          Users

                          79.4k
                          Topics

                          1.3m
                          Posts

                          3
                          11
                          675
                          Loading More Posts
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes
                          Reply
                          • Reply as topic
                          Log in to reply
                          Community
                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                          The ioBroker Community 2014-2023
                          logo