dbwarner5 Posted December 12, 2022 Posted December 12, 2022 @Javi Have been customizing my UD Mobile app and have run into two questions: I have a folder of programs that I use to Enable / Disable variables which then subsequently enable /disable certain functions around the house. I have changed all the program icons / colors and response texts. All is fine there, however 2 things I have noticed need clarification / help to better understand: 1) some of the programs when I touch the toggle circle on the program screen, will run the Else, while others run the THEN. To run the opposite, I click on the broader area (not the toggle) of the program and it opens up the choices of Enable, Run If, Run Then etc. What is making one run the else and the other the then? 2) for many of these programs that I want to put into a favorites folder, I want to keep them simple and only see the Run Then, or Run Else, so I selected edit / Hide the other commands. However, while I am doing this INSIDE the edit of one program, it changes ALL my programs to these limited selections. That is not what I would have expected or desired. Shouldn't that be a global preference setting but when I do it within a specific program, maintain that ONLY for that program? thanks!
Javi Posted December 13, 2022 Posted December 13, 2022 Hi @dbwarner5, 34 minutes ago, dbwarner5 said: @Javi Have been customizing my UD Mobile app and have run into two questions: I have a folder of programs that I use to Enable / Disable variables which then subsequently enable /disable certain functions around the house. I have changed all the program icons / colors and response texts. All is fine there, however 2 things I have noticed need clarification / help to better understand: 1) some of the programs when I touch the toggle circle on the program screen, will run the Else, while others run the THEN. To run the opposite, I click on the broader area (not the toggle) of the program and it opens up the choices of Enable, Run If, Run Then etc. What is making one run the else and the other the then? 2) for many of these programs that I want to put into a favorites folder, I want to keep them simple and only see the Run Then, or Run Else, so I selected edit / Hide the other commands. However, while I am doing this INSIDE the edit of one program, it changes ALL my programs to these limited selections. That is not what I would have expected or desired. Shouldn't that be a global preference setting but when I do it within a specific program, maintain that ONLY for that program? thanks! See https://wiki.universal-devices.com/index.php?title=UD_Mobile#Programs_(My_Programs) for the toggle behavior. Program toggle button function If (program-running){ STOP PROGRAM }else { RUN IF } The reason being (currently) there is only one toggle action button. So for toggle actions the app needs a status, in this case it uses the program running status. As an alternative use Favorites Command Type to specify if/then/else/stop actions on click. This would give you the added ability to set the Variable in your example as the "display status" combining your variable and program into a single tile. 10 minutes ago, dbwarner5 said: 2) for many of these programs that I want to put into a favorites folder, I want to keep them simple and only see the Run Then, or Run Else, so I selected edit / Hide the other commands. However, while I am doing this INSIDE the edit of one program, it changes ALL my programs to these limited selections. That is not what I would have expected or desired. Shouldn't that be a global preference setting but when I do it within a specific program, maintain that ONLY for that program? I've added this to our issue tracker, although it may be some time before I can change this behavior. The reason being, it was designed this way with an assumption only Similar Nodes (i.e. Insteon Dimmer) would share these command values. As an alternative create a Favorites Folder. Then Favorites Command Type with the desired if/then/else/stop commands.
dbwarner5 Posted December 13, 2022 Author Posted December 13, 2022 32 minutes ago, Javi said: If (program-running){ STOP PROGRAM }else { RUN IF } Got it thanks..
dbwarner5 Posted December 13, 2022 Author Posted December 13, 2022 @Javi Continue to play with how to make a program become a toggle: run then if false, run else if true. Looking at the rule above, if the program is NOT running, then it will run the IF. If the IF is empty then this will return a True and run the THEN. So in the original program below, I had no IF statement, so the toggle would only run the THEN. So I added the If as shown in green, thinking that the IF will always be evaluated upon any toggling and it will vary the prgroma running the THEN and the ELSE. This did not work, it only ran the ELSE, even when the program status was false, contrary to what the rule says of running the IF. So I then disabled the program and did the same test. This time, each toggle only ran the THEN.... Based on this, I made the final addition of Disable / enable program as shown below in orange. Now its working, each press alternates between the running the THEN and running the ELSE... Just not clear how this behavior lines up with your previous communication. Thanks. Alert Start /Stop SD - [ID 0043][Parent 001C][Not Enabled] If Program 'Alert Start /Stop SD' is False Then Enable Program 'Alert Start /Stop SD' Set 'Keypad Alert' On Wait 1 second Set 'Keypad Alert' On Run Program 'Alert Button2' (Then Path) Else Set 'Keypad Alert' Off Wait 1 second Set 'Keypad Alert' Off Run Program 'Alert Button Off' (Then Path) Disable Program 'Alert Start /Stop SD'
Javi Posted December 14, 2022 Posted December 14, 2022 17 hours ago, dbwarner5 said: @Javi Continue to play with how to make a program become a toggle: run then if false, run else if true. Looking at the rule above, if the program is NOT running, then it will run the IF. If the IF is empty then this will return a True and run the THEN. So in the original program below, I had no IF statement, so the toggle would only run the THEN. So I added the If as shown in green, thinking that the IF will always be evaluated upon any toggling and it will vary the prgroma running the THEN and the ELSE. This did not work, it only ran the ELSE, even when the program status was false, contrary to what the rule says of running the IF. So I then disabled the program and did the same test. This time, each toggle only ran the THEN.... Based on this, I made the final addition of Disable / enable program as shown below in orange. Now its working, each press alternates between the running the THEN and running the ELSE... Just not clear how this behavior lines up with your previous communication. Thanks. Alert Start /Stop SD - [ID 0043][Parent 001C][Not Enabled] If Program 'Alert Start /Stop SD' is False Then Enable Program 'Alert Start /Stop SD' Set 'Keypad Alert' On Wait 1 second Set 'Keypad Alert' On Run Program 'Alert Button2' (Then Path) Else Set 'Keypad Alert' Off Wait 1 second Set 'Keypad Alert' Off Run Program 'Alert Button Off' (Then Path) Disable Program 'Alert Start /Stop SD' Evaluating self (Program.self) may not work as you intend especially when the program is disabled thus disablening evaluation. I suggest using another condition or variable. Looking at your program I assume if 'Keypad Alert' is On you want to turn it off. So maybe use " If 'Keypad Alert' is not equal to ON" as the If condition. If you desire a true toggle function based on the last toggled value as the condition a variable would be more appropriate using as boolean 0/1. We also have an example on our wiki: https://wiki.universal-devices.com/index.php?title=UD_Mobile#Favorite_Custom_Toggle 1
dbwarner5 Posted December 15, 2022 Author Posted December 15, 2022 On 12/14/2022 at 9:04 AM, Javi said: Evaluating self (Program.self) may not work as you intend especially when the program is disabled thus disablening evaluation. I suggest using another condition or variable. Looking at your program I assume if 'Keypad Alert' is On you want to turn it off. So maybe use " If 'Keypad Alert' is not equal to ON" as the If condition. If you desire a true toggle function based on the last toggled value as the condition a variable would be more appropriate using as boolean 0/1. We also have an example on our wiki: https://wiki.universal-devices.com/index.php?title=UD_Mobile#Favorite_Custom_Toggle Understand.. Have modified the program as follows and will leave it disabled. Made the command to run the IF of this program. Works as a toggle perfectly Alert Start /Stop LD - [ID 0043][Parent 001C][Not Enabled] If 'KP Hall to Master.A: Alert' Status is Off Then Set 'Keypad Alert' On Wait 1 second Set 'Keypad Alert' On Run Program 'Alert Button2' (Then Path) Else Set 'Keypad Alert' Off Wait 1 second Set 'Keypad Alert' Off Run Program 'Alert Button Off' (Then Path) Also By the way, I finally spend the time to really understand UD Mobile. You have done an OUTSTANDING job with it. While it's a bit overwhelming at first, once you get the hang of the amazing capabilities, you can really do just about anything. Also like that I can lock out edits and hide things like resources for on my wife's phone so she really on can see the favorites which are all color coded green for "good", red for "bad".....(two battery devices not reporting due to writes needed from a PLM change, but will be green as well.) Thanks for all your work!! Cheers. 1
Recommended Posts