- Posts: 373
- Thank you received: 3
"Alias" Feature
- bitzerjd
- Topic Author
- Offline
- User
-
Less
More
6 months 3 weeks ago #4714
by bitzerjd
"Alias" Feature was created by bitzerjd
In UNC's Complete Control software there was a way to reference a button with an "Alias". The benefit was that you could configure the single button and when it was reused you referenced the original button. If you reused the button 10 times...you could change the original one and that change would cascade to the others (because they were Alias's)
Is this functionality in myDesigner?
In my use case, I have a "Turn on Home Theater" button on all the source inputs (Zidoo, Roku, ATV, etc) Each button calls a macro so it's easy to update the macro and the "buttons" are updated, however, if you want to change the macro name, you need to change it in each button. Having an Alias would be great...change it in the "source button" and it would be used in the others.
Thanks!
Is this functionality in myDesigner?
In my use case, I have a "Turn on Home Theater" button on all the source inputs (Zidoo, Roku, ATV, etc) Each button calls a macro so it's easy to update the macro and the "buttons" are updated, however, if you want to change the macro name, you need to change it in each button. Having an Alias would be great...change it in the "source button" and it would be used in the others.
Thanks!
Please Log in to join the conversation.
- aa6vh
- Offline
- User
-
Less
More
- Posts: 108
- Thank you received: 7
6 months 3 weeks ago #4716
by aa6vh
Replied by aa6vh on topic "Alias" Feature
Its called "Server Variables", and you can even nest those variables.
You probably have seen things similar to (for example):
PowerButton_{{Active_Room}}
The variable "Active_Room" is to be set to a particular room (say "Family").
So now that variable will be processed as if it was:
PowerButton_Family
Setting "Active_Room" to "Kitchen" would then have the variable processed as:
PowerButton_Kitchen
There is never an actual sever variable declared as "PowerButton_{{Active_Room}}", only actual sever variables declared with the names "PowerButton_Family" and "PowerButton_Kitchen".
This allows Allonis to have entire sets of commands that can be changed immediately be just changing one of those nested variables (like setting the "Active_Room" variable to Family) when controlling something in the family room instead of the kitchen).
You probably have seen things similar to (for example):
PowerButton_{{Active_Room}}
The variable "Active_Room" is to be set to a particular room (say "Family").
So now that variable will be processed as if it was:
PowerButton_Family
Setting "Active_Room" to "Kitchen" would then have the variable processed as:
PowerButton_Kitchen
There is never an actual sever variable declared as "PowerButton_{{Active_Room}}", only actual sever variables declared with the names "PowerButton_Family" and "PowerButton_Kitchen".
This allows Allonis to have entire sets of commands that can be changed immediately be just changing one of those nested variables (like setting the "Active_Room" variable to Family) when controlling something in the family room instead of the kitchen).
Please Log in to join the conversation.
- aa6vh
- Offline
- User
-
Less
More
- Posts: 108
- Thank you received: 7
6 months 3 weeks ago #4719
by aa6vh
Replied by aa6vh on topic "Alias" Feature
BTW: We discussed this previously in regards to using string replacement variables when wanting to send a Allonis Run Macro command from Home Assistant.
allonis.com/forum/home-assistant/519-ha-...-of-myserver?start=0
We suggested using the HA's implementation of string replacement variables so that you only have to create the HA send request command once, by using a replacement variable to specify the desired Allonis Macro name.
allonis.com/forum/home-assistant/519-ha-...-of-myserver?start=0
We suggested using the HA's implementation of string replacement variables so that you only have to create the HA send request command once, by using a replacement variable to specify the desired Allonis Macro name.
Please Log in to join the conversation.
- bitzerjd
- Topic Author
- Offline
- User
-
Less
More
- Posts: 373
- Thank you received: 3
6 months 3 weeks ago #4720
by bitzerjd
Replied by bitzerjd on topic "Alias" Feature
Hmmmm, so a Server Variable can contain a set of commands? If so, you can then reference the variable.
In the button command Macro|{{dosomething}} and the Server Variable could be what ever the command string would be?
Time to play...Thanks!!!
In the button command Macro|{{dosomething}} and the Server Variable could be what ever the command string would be?
Time to play...Thanks!!!
Please Log in to join the conversation.
- bitzerjd
- Topic Author
- Offline
- User
-
Less
More
- Posts: 373
- Thank you received: 3
6 months 3 weeks ago #4721
by bitzerjd
Replied by bitzerjd on topic "Alias" Feature
Actually, what I was looking for was a little different. In thinking more about it, it's a new Button Type...an Alias. That Alias would place an identical button on the screen that references the source button. In URC you can say, copy format, code, all, etc. In the "code" mode, if you modify the code in the source, it is reflected in the alias button. If "all" mode, the label, and format are also linked. Change the name in the source button, and the name changes in the alias.
Hope this makes sense
Hope this makes sense
Please Log in to join the conversation.
- aa6vh
- Offline
- User
-
Less
More
- Posts: 108
- Thank you received: 7
6 months 3 weeks ago #4722
by aa6vh
Replied by aa6vh on topic "Alias" Feature
I am afraid you are still not understanding the concept of a "replacement variable" containined in a string. And since what you want is so easily done as shown below, I doubt Allonis will have much enthusiasm for your new feature suggestion.
So let me try to explain again.
Computer commands are usually given in an english text sentence, containing letters formatted into words in a specified order. The computer does not understand this, it does not know what needs to be done until that sentence has been translated into "machine language", and into individual steps that will accomplish the task. This coversion from english to machine is usually called "Compiling", but sometimes also refered to as "interpreting" or "processing". The english statement is translated, and the individual steps needed are identified to the computer.
The string replacement variables are dealt with prior to the start of that "compile" phase. Replacement variables are only handled in this "preproccesing" stage. The script you give to the computer to process is searched to see if there are any replacement variables contained in it, and if so, the replacement string is substituted for the replacement variable. After ALL of the replacement variables have been replaced, that modified script is then presented to be compiled, processed, and ran.
Getting to your issue with your button, where you have a need to have a button that needs to have different scripts in it depending on different situations. You accomplish what you want to do by creating two separate Server Macros contaiing those different scripts. In your button, you specify that button to call a macro, but the macro name specified will be a replacement variable. Then you set the replacement variable value itself with the names of either one of those two macros, as you require.
Example:
Macro Tweedledum:
Macro|<some useful script statements here>
Macro Tweedledee:
Macro|<some different script statments here>
You then create a server variable (lets call it "Tweed") that contains the actual maacro name. At some point, you run a statment that does:
SetVariable|Tweed~Tweedledum!
In your button script, you then simply have:
Macro|{{Tweed}}!
At the time of execution, Allonis will take the statement "Macro|{{Tweed}}" and replace "{{Tweed}}" with "Tweedledum", and then repeat that script processing with that modified script (i.e "Macro|Tweedledum!")
Understanding the above is essential, so please ask again, if any part of the above is still confusing. You will get there.
So let me try to explain again.
Computer commands are usually given in an english text sentence, containing letters formatted into words in a specified order. The computer does not understand this, it does not know what needs to be done until that sentence has been translated into "machine language", and into individual steps that will accomplish the task. This coversion from english to machine is usually called "Compiling", but sometimes also refered to as "interpreting" or "processing". The english statement is translated, and the individual steps needed are identified to the computer.
The string replacement variables are dealt with prior to the start of that "compile" phase. Replacement variables are only handled in this "preproccesing" stage. The script you give to the computer to process is searched to see if there are any replacement variables contained in it, and if so, the replacement string is substituted for the replacement variable. After ALL of the replacement variables have been replaced, that modified script is then presented to be compiled, processed, and ran.
Getting to your issue with your button, where you have a need to have a button that needs to have different scripts in it depending on different situations. You accomplish what you want to do by creating two separate Server Macros contaiing those different scripts. In your button, you specify that button to call a macro, but the macro name specified will be a replacement variable. Then you set the replacement variable value itself with the names of either one of those two macros, as you require.
Example:
Macro Tweedledum:
Macro|<some useful script statements here>
Macro Tweedledee:
Macro|<some different script statments here>
You then create a server variable (lets call it "Tweed") that contains the actual maacro name. At some point, you run a statment that does:
SetVariable|Tweed~Tweedledum!
In your button script, you then simply have:
Macro|{{Tweed}}!
At the time of execution, Allonis will take the statement "Macro|{{Tweed}}" and replace "{{Tweed}}" with "Tweedledum", and then repeat that script processing with that modified script (i.e "Macro|Tweedledum!")
Understanding the above is essential, so please ask again, if any part of the above is still confusing. You will get there.
Please Log in to join the conversation.
Time to create page: 0.333 seconds