companion icon indicating copy to clipboard operation
companion copied to clipboard

Variables in connection settings to change ip adress dynamically

Open gustlmumpitz opened this issue 3 years ago • 5 comments

Is this a feature relevant to companion itself, and not a module?

  • [X] I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the feature

Hi, would it be possible to use the custom variables also in the connection settings? Or can you create an internal function to change a connection's ip adress?

Thanks in advance VariablesInConnections

Usecases

So I can create one page f.ex. with my PTZ commands and dynamically change the ip adress of the camera where it is pointing to with one button press (change the variable instead of editing the connection settings).

gustlmumpitz avatar Feb 24 '22 13:02 gustlmumpitz

While not as pretty, you could do this today by having each camera defined as its own instance, making each button perform the action on each device, and then having some buttons to enable and disable each of the ptz instances.

I'm not sure that we should allow for variables here, as they aren't the most stable and could easily cause some infinite loops. While connecting they often get reset back to 'empty'/defaults, which will cause this instance to break for a bit. Also reconnecting isnt an instant thing, so changing properties on the fly could cause other issues.

Im not saying no, but im not convinced that this is a good idea to do

Julusian avatar Feb 24 '22 15:02 Julusian

I understand your idea, but I'm not sure if this fits my needs. The cameras are just one part. In my case I have a vMix System and a camera at a certain place mounted as one kit. Depending on my production setup I use multiple of these kits, but I don't know which of them before. So changing the IP adresses dynamically as a variable would help a lot, as me and other collegues only have to type in the adresses into the "change variable" button instead

gustlmumpitz avatar Feb 24 '22 15:02 gustlmumpitz

I roughly see the need, but from an architecture perspective the configuration of a connection is considered 'stable' data meaning its designed to be set and forget, and maybe updated/changed occasionally. We don't allow actions to change them, and there's no way to hook a change event on a variable. From that perspective I think custom variables was introduced without giving clear thought to how the architecture wasn't ready for how people would want to use them. They were always and only for putting dynamic text onto button labels, not complex programming/automation. And so we need to re-think the whole architecture around them getting used in actions, feedbacks, and [apparently] configuration settings. There's no quick fix here. We have to replace that entire engine with something substantially more robust.

krocheck avatar Feb 24 '22 16:02 krocheck

okay, thanks for this little insight and your great work on companion anyway :)

gustlmumpitz avatar Feb 24 '22 16:02 gustlmumpitz

If I need to work dynamically with IPs, I would prefer to work with Hostname and not with a Variable. Having the network do the work for you, will always be more precise than a variable to be instructed ... Hoping to have understood your request well.

DiegoMarchente avatar Mar 18 '22 13:03 DiegoMarchente

I've recently been working a lot with the variables in companion to create one master config to use in the different studio's we have. Currently I have an instance for every device in each studio which means also a page per for each instance in my case to controle everything. If we could change the ip address from a button press then i could have a third of the pages i've created right now(we have 3 studio's) as they dynamically change to the selected studio. Is this feature still on the maybe list?

jalmar2000 avatar Dec 03 '22 21:12 jalmar2000

I'd say it is more on the not likely list. Additionally to the so far mentioned workarounds there are more possibilities: you could use a router to rewrite your ip traffic and change the rewriting rules from companion. Easy task with Mikrotik. Or you could use a proxy on your machine and control the proxy with shell commands.

dnmeid avatar Dec 04 '22 04:12 dnmeid