Variable to Variable action lowercases the variable

Posted on
Wed Dec 27, 2023 3:36 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Variable to Variable action lowercases the variable

I have a schedule to store the contents of one variable in another then reset the first one back to zero.

If I use a Set Variable to Variable action the variables get lowercased and therefore don't work e.g. HeatingMinutes becomes heatingminutes

If I use the Modify Variable action this doesn't happen and it remains mixed case.

The actions list looks like this:
set value of 'previousactivetotal' to the value of 'activetotal'
set variable ActiveTotal to 0

How do I stop it doing this (apart from using lowercase variables)?

Posted on
Wed Dec 27, 2023 9:46 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Variable to Variable action lowercases the variable

I'm not seeing the same behavior. What version of Indigo are you using?

I created two variables: xxx1 and xxx2.
I set the value of xxx1 to "True"
I `Set the Value` of xxx2 to the value of xxx1.
I `Modify` the value of xxx1 to 0 (I added a one second delay on this one.)

xxx1 = "0"
xxx2 = "True"

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Dec 27, 2023 10:09 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Variable to Variable action lowercases the variable

That is just a UI thing: the summary shows lower case in the Mac client action list, but it doesn't change the behavior because the action (in code) uses the id of the variables, not the names. You should probably look more closely at your schedule to make sure that it's configured correctly.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Dec 27, 2023 10:11 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Variable to Variable action lowercases the variable

I also tried this and it was successful. Also added a delay between the 1st and 2nd command.

Variables:
I created two variables: previousactivetotal and activeTotal.
I set the value of activeTotal to "35"

Created an action group to test:
Step 1 - I `Set the Value` of previousactivetotal and activeTotal.
Step 2 - I `Modify` the value of activeTotal to 0 (I added a 3 second delay on this one.)

Results:
activeTotal = "0"
previousactivetotal = "35"

Posted on
Wed Dec 27, 2023 4:23 pm
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Variable to Variable action lowercases the variable

You are using lowercase though, if the variables are called ActiveTotal and PreviousActiveTotal, what happens?

Posted on
Wed Dec 27, 2023 4:32 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Variable to Variable action lowercases the variable

my variable name is activeTotal. I changed the other to "PreviousActiveTotal" and there was no problem.

As Jay noted, the ID of the variable is what is used anyway.

What version of Indigo are you using ?

Posted on
Wed Dec 27, 2023 5:11 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Variable to Variable action lowercases the variable

pnm wrote:
You are using lowercase though, if the variables are called ActiveTotal and PreviousActiveTotal, what happens?

I redid the example with your variable names and Indigo did not change them. The only thing that I can think of that might be different between our setups is localization settings; but I can't think of a reason that would matter.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Dec 28, 2023 1:53 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Variable to Variable action lowercases the variable

I'm using 2023.1 on a new Mac mini in the UK, but I had the same issue with 2022. If I execute the schedule both variables end up at zero.

Edit
It's the Delay that fixes it. If I add it to the reset to zero step it works, do the steps run in parallel?

Posted on
Thu Dec 28, 2023 5:31 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Variable to Variable action lowercases the variable

Indigo actions are asynchronous -- meaning that any individual task can complete at any time. This is by design and is a great feature of Indigo. If it weren't that way, a hung script or non-responsive device could hold up the entire show. A delay is a way to mimic synchronous commands, but it's still not assured that one will complete before another. If you must have one command run before another starts, the best way is some form of conditional, like: "When the value of variable 'PreviousActiveTotal' changes, set the value of variable 'ActiveTotal' to 0".

I am completely stumped on why any variable name would change from upper to lower case.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Dec 28, 2023 10:43 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Variable to Variable action lowercases the variable

DaveL17 wrote:
I am completely stumped on why any variable name would change from upper to lower case.


It is only changed when the description of the action is displayed in the Mac Client UI. For historical purposes, we've always lowercased the descriptions when we show them in the action list (probably not the right choice for this particular usecase). It does not, however, impact the operation of the action since it's just a UI display choice.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Dec 28, 2023 11:14 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Variable to Variable action lowercases the variable

pnm wrote:
I'm using 2023.1 on a new Mac mini in the UK, but I had the same issue with 2022. If I execute the schedule both variables end up at zero.

Edit
It's the Delay that fixes it. If I add it to the reset to zero step it works, do the steps run in parallel?


Can you please post a before and after screenshot of where you are seeing your variable name being changed? It also sounds like your process is running properly now?

Posted on
Thu Dec 28, 2023 11:27 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Variable to Variable action lowercases the variable

jay (support) wrote:
It is only changed when the description of the action is displayed in the Mac Client UI.

Sigh. It didn't occur to me that we could be talking about the Actions list.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Dec 28, 2023 6:21 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Variable to Variable action lowercases the variable

DaveL17 wrote:
jay (support) wrote:
It is only changed when the description of the action is displayed in the Mac Client UI.

Sigh. It didn't occur to me that we could be talking about the Actions list.


This is why I asked for a screenshot. It was unclear what the actual problem was

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests