how does this work?

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

Re: how does this work?

2 years 5 months ago
#1879
Yes, you can pass parameters to macros and as far as I know it can be as many as you want. Here is an example of a macro that I was using before the JVC driver was working correctly I had a jvc.cmd.theater macro defined like this:

Macro|
GetURL|http://localhost:5000?devname=JVC%20RS2100&cmd=¶m=!

I would call it with jvc.cmd.theater|PW~1 and it would run the following command

GetURL|http://localhost:5000?devname=JVC%20RS2100&cmd=PW&param=1!

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

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: how does this work?

2 years 5 months ago
#1881
yes exactly! The server will parse the command and then make the <p1>... <pn> substitutions.

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

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: how does this work?

2 years 5 months ago
#1882
so if I mapped this command to a button on remote
LaunchApp.{{activeroom_{{clientname}}}}|Netflix

and created a macro named livingroom.LaunchApp
with this code
AV|{{livingroom_shieldtv_id}}~Launch~<p1>!
in it

Would it Work?

YES!
 

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

cjisble's Avatar
User User
  • Posts: 202
  • Thanks: 12

Re: how does this work?

2 years 5 months ago
#1883
We want to try to reduce the number of macros being created but wasn't expecting someone to reflash a new server so soon. Instead of VolumeUp, VolumeDown, PowerOn, PowerOff it's better to have just one Volume and Power macro and pass in the options as needed.

Volume.room|up   or Volume.room|up~3 (up 3 steps)  Volume.room|down   or Volume.room|down~3 (down 3 steps) 
VolumeMute.room|on  or VolumeMute.room|off  or VolumeMute.room|toggle
Power.room|on  or Power.room|off  or Power.room|toggle

The updated smartremote, moonlight tablet and phone templates will be calling these macros.

This should not break anything for existing installs using the old macro naming conventions as the server will compensate. Since you are a little ahead of the curve modify your project hard button commands to use the new macro naming conventions.


 
I've got the reverse problem.  My smart remote template has the hard button calling power.familyroom | on, but my macros are still the old ones:  poweron.familyroom.

What is the best way to get back in sync?  Should I create the new macros manually, using the instructions in this thread to pass in the variables?

 

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

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

Re: how does this work?

2 years 5 months ago
#1888
Did some testing
Code:
Macro| // The macro is responsible for controlling volume in a room! AV|{{livingroom_avamp_id}}~Volume~<p1>~3! if|IsEQ##<p1>##up##Lighting|8~On! if|IsEQ##<p1>##down##Lighting|8~Off!
Works!!

But ran into different issue can't edit or save changes to hard buttons on smartremote.
I have read/write access to the myserver folder from my desktop and I can edit gui aspects with mydesigner
so not sure whats going on. Could be a server bug?

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

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: how does this work?

2 years 5 months ago
#1889
The server update I will release today will get you back in sync automatically. You won't have to do anything. It will automatically call the old macro if the new one does not exist.

The server update is delayed because I'm fixing a MQTT subscribe issue.

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

Time to create page: 0.302 seconds