1) Give a description of the problem
I’m trying to create a For Each loop that’ll walk through each light, pull the wanted settings from an array of variables, and apply them. The issue I’m running into is that when I try to apply the settings for the variable to a placeholder variable, it saves the variables’ name instead of the value it holds. Because of the way it functions, it has to auto-generate the name of the variable pulled with each run-through, which is part of what I think the issue is.
Keep in mind this’s a small test script; I have more than three rooms, so I’d need to be able to expand whatever was used.
2) What is the expected behavior?
That the value of the generated variable pointed to is saved.
3) What is happening/not happening?
The name of the variable is saved instead.
**4) Post a Green Snapshot of the piston!
(I know it’s supposed to be a Green Snapshot, but the naming scheme is important to the way the script functions and there’s nothing that should be kept private.)
5) Attach any logs (From ST IDE and by turning logging level to Full)
`
+1ms | ╔Received event [Script Testing].button = pushed with a delay of 67ms |
---|---|
+120ms | ║RunTime Analysis CS > 11ms > PS > 27ms > PE > 82ms > CE |
+123ms | ║Runtime (49793 bytes) successfully initialized in 27ms (v0.2.100.20171211) (122ms) |
+124ms | ║╔Execution stage started |
+131ms | ║║Comparison (enum) pushed gets (string) pushed = true (1ms) |
+132ms | ║║Cancelling condition #2’s schedules… |
+133ms | ║║Condition #2 evaluated true (5ms) |
+133ms | ║║Cancelling condition #1’s schedules… |
+134ms | ║║Condition group #1 evaluated true (state changed) (6ms) |
+226ms | ║║Cancelling statement #52’s schedules… |
+238ms | ║║Executed virtual command setVariable (1ms) |
+242ms | ║║Dining_Room_switch |
+243ms | ║║Executed virtual command log (1ms) |
+247ms | ║║Cancelling statement #52’s schedules… |
+254ms | ║║Executed virtual command setVariable (1ms) |
+258ms | ║║Kitchen_switch |
+259ms | ║║Executed virtual command log (1ms) |
+263ms | ║║Cancelling statement #52’s schedules… |
+270ms | ║║Executed virtual command setVariable (0ms) |
+275ms | ║║Living_Room_switch |
+275ms | ║║Executed virtual command log (1ms) |
+278ms | ║╚Execution stage complete. (154ms) |
+361ms | ╚Event processed successfully (356ms) |
`