NEWS
How to create a variable Object Id in Vis 2?
-
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.
-
@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
-
@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.
-
@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? -
@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.
-
in vis1 this was not possible (i called this dynamic id)
I'm pretty sure that this was not implemented in vis-2 either- 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 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 -
@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.
-
@homoran How would you do it in the other way that you mention? Thank you for helping me with this.
-
@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-2on this page you can see all open (and closed) issues
you can create a new issue via the green button on top rightthe 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. -
@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.