Help with Simple Macro

More
6 hours 8 minutes ago - 5 hours 59 minutes ago #5086 by Chrisan
Help with Simple Macro was created by Chrisan
Trying to create my first macro in MyServer.   It's pretty simple.  If one variable equals something set this other variable to a certain value.   It's not working.  
Thanks for any help, Chris
Macro|If|isEqual##{{irrigation_active_zone_1_status}}##on##SetVariable|{{irrigation_active_zone}}~1 
and tried this:
Macro|
If|isEqual##{{irrigation_active_zone_1_status}}##on##SetVariable|irrigation_active_zone~1
Last edit: 5 hours 59 minutes ago by Chrisan.

Please Log in to join the conversation.

More
1 hour 57 minutes ago #5087 by Nillaz
Replied by Nillaz on topic Help with Simple Macro
The overall structure looks correct so I'm not entirely sure where things are going off the rails. What does the myServer log say when you try to run it?

Some off the cuff ideas:

I'm assuming that "irrigation_active_zone_1_status" is a variable that already exists. If not create it. Otherwise, the macro is referencing a server variable that isn't in the database.

I'm not 100% sure if "isEqual" is acceptable syntax. I know some conditions allow for various formatting so it's probably fine but I don't have the documentation handy to verify. I use "IsEQ" and "IsNE" for equal/not equal conditions, so if I was writing this it would look like: 

Macro|
If|IsEQ##{{irrigation_active_zone_1_status}}##on##SetVariable|irrigation_active_zone~1!

Note the "irrigation_active_zone" is not in curly braces.

Does your macro contain more than one command and your example is just one command within it? If so also note the exclamation point at the end. This is required at the end of each command within a macro.

Please Log in to join the conversation.

Time to create page: 0.236 seconds