Nested macros?

Nillaz's Avatar Topic Author
User User
  • Posts: 444
  • Thanks: 36

Nested macros?

2 years 4 months ago
#2548
Forgive me if this is a stupid question, but is it possible to call a user defined macro from within a macro, and if so what does the syntax for that look like?

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar
User User
  • Posts: 248
  • Thanks: 33

Re: Nested macros?

2 years 4 months ago
#2549
It's just the name of the macro.

Macro|
AV|1~Power~On!
mymacro.theater!

Please Log in or Create an account to join the conversation.

Nillaz's Avatar Topic Author
User User
  • Posts: 444
  • Thanks: 36

Re: Nested macros?

2 years 4 months ago
#2550
lol Well I feel dumb. Thanks for the info!

Please Log in or Create an account to join the conversation.

Fattykidd's Avatar
User User
  • Posts: 150
  • Thanks: 3

Re: Nested macros?

1 year 10 months ago
#3627
I'm trying to figure out the correct syntax for my power macros. 
Below is my coreelec power on macro. Can anyone have a look and help me out. Thanks in advance.

macro|AV|139~Power~On!loadscene|loading!If|IsEQ##{{av_134_power}}##false##Macro|Lighting|33~Level~65!Lighting|35~On!AV|134~Power~On!Pause|10!AV|134~Source~SAT/CBL!Pause|18!AV|130~Home!Pause|6!!##Macro|AV|134~Source~SAT/CBL!Pause|8!AV|130~Home!!loadscene|watchcoreelec

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar
User User
  • Posts: 248
  • Thanks: 33

Re: Nested macros?

1 year 10 months ago - 1 year 10 months ago
#3629
I've found that nesting macros is more difficult then it should be. The outer macro commands needs the extra !'s and not the inner ones. I decided that any place I needed to nest macro commands I would just create a new global macro and call it.  I think this is what your macro should be(I added spacing to help show the levels of nesting):

macro| AV|139~Power~On!!
loadscene|loading!!
If|IsEQ##{{av_134_power}}##false##
  Macro|
    Lighting|33~Level~65!
    Lighting|35~On!
    AV|134~Power~On!
    Pause|10!
    AV|134~Source~SAT/CBL!
    Pause|18!
    AV|130~Home!
    Pause|6##
  Macro|
    AV|134~Source~SAT/CBL!
    Pause|8!
    AV|130~Home!!
loadscene|watchcoreelec!!

or if you were to create two macros like coreelec.poweron and coreelec.alreadyon then it would look like this which is much easier to read/understand:
macro|
  AV|139~Power~On!!
  loadscene|loading!!
  If|IsEQ##{{av_134_power}}##false##coreelec.poweron##coreelec.alreadyon!
  loadscene|watchcoreelec!!

where coreelec.poweron is:
Macro|
  Lighting|33~Level~65!
  Lighting|35~On!
  AV|134~Power~On!
  Pause|10!
  AV|134~Source~SAT/CBL!
  Pause|18!
  AV|130~Home!
  Pause|6!

and coreelec.alreadyon is:
Macro|
  AV|134~Source~SAT/CBL!
  Pause|8!
  AV|130~Home!
Last edit: 1 year 10 months ago by bowlingbeeg.
The following user(s) said Thank You: BigShep, Fattykidd

Please Log in or Create an account to join the conversation.

Fattykidd's Avatar
User User
  • Posts: 150
  • Thanks: 3

Re: Nested macros?

1 year 10 months ago
#3630
Thank you @bowlingbeeg

So to clarify because I'm dumb. 
​​​​​​Define my macros in the macros section of the dashboard and then put the command to call those specific macros in the button command of the remote. Correct ? 

With you saying the single and double delimiter is backwards that makes way more sense as to why I couldn't figure out what the heck was wrong with my macro, it would skip everything except the load scene command at the end. Looking at the logs it was saying no device with name and the generic ir driver was giving errors that it was missing information in the command. 

I've spent so many hours staring at the documentation and my macros comparing. If I had hair I would've pulled it out. 

Please Log in or Create an account to join the conversation.

Time to create page: 0.292 seconds