Install 12 preset buttons on the phone

Wiimer

Major Contributor
Joined
Oct 28, 2022
Messages
4,187
Location
Japan
This is a related post to the following thread.
Today I will show you how to install 12 presets on your Android phone using the Macrodroid app.


<Sample 1>
1000002600.jpg

<Sample 2>
View attachment 1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6756.mp4




First, create the data needed to control the WiiM.

1) Save the IP address of the WiiM device you wish to control in Notepad.

Open the WiiM home app and save the IP in the device settings under Network Status to Notepad.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6654.jpg
# This IP is used to control any WiiM device using the WiiM API. If you want to control multiple WiiM devices, please copy the IPs of all devices.


2) Save the IP as a variable.

Tap the "Variables" tile on the Macrodroid home screen to create a global variable.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6659.jpg


Tap the "+" icon.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6647.jpg


Enter a variable name of your choice and set the variable type to "String". In this example, I use "Ultra_IP".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6648.jpg

Tap OK, and a new variable will be created. Since the value of the variable is still empty.

1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6651.jpg

Tap "empty" and enter the IP.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6657.jpg
Check "Make Variable secure" and tap OK.



3) Create a URL to use in the macro.

Insert a variable into the request URL of the WiiM API.

This is a sample URL to play the preset on a WiiM device.
http://10.10.10.254/httpapi.asp?command=MCUKeyShortClick:%d

Change the yellow IP address to this one.
http://{v=Ultra_IP}/httpapi.asp?command=MCUKeyShortClick:%d

The blue "%d" is the preset number. Setting this to 1 will play Preset 1; setting it to 12 will play Preset 12.

http://{v=Ultra_IP}/httpapi.asp?command=MCUKeyShortClick:1

This completes the process.
This URL is also pasted into Notepad. Please be careful not to include spaces.


4) Create a widget button to play preset 1.


Tap the tile "Add Macro".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6655.jpg

After entering the macro name, tap the "+" button on the Triggers tab.
In this example, I use "01 Ultra Preset 1".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6645.jpg

Tap the magnifying glass icon to search for "widgets".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6672.jpg

Tap the "Widget Button".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6691.jpg

Select "Custom" and tap the OK.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6694.jpg


Tap "Select Image" to select an icon image.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6693.jpg


"Add User Icon" can be tapped to add an image stored in storage here.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6696.jpg

After selecting an image, enter your favorite label name and tap OK.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6683.jpg

The target is now complete. Next, create the action.
Tap "+" to proceed.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6682.jpg

Search for "http", and tap "HTTP Request".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6685.jpg

Paste the URL created in "(3)" here.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6688.jpg

Check the three checkboxes and tap here.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6689.jpg

This completes the macro, but you can also launch any app after tapping the preset button. Here I will add an action that opens the WiiM app when the button is tapped.


Search for "app", and tap "Launch Application".
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6679.jpg

Select "Select Application" and then OK.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6684.jpg

Choose WiiM Home.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6681.jpg

OK.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6680.jpg

Tap this button, and completes the process.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6675.jpg



Press and hold the resulting macro to display the menu. Test your actions here.

Tap "(1) Test actions".
If preset 1 is played on WiiM and the WiiM app starts, it is a success.
1000002599.jpg

In addition, you can duplicate this macro by tapping "(2) Clone macro" to create preset 2 or later macros. To do so, change the number at the end of the request URL.



With the macro completed, return to the phone's home screen and add the Android widget.

Press and hold the Home screen and tap the widget button.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6677.jpg

Select a custom button from Macrodroid widgets.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6701.jpg

Select the macro you just created.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6702.jpg


Thank you for your hard work 😄.
1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6700.jpg



In the next time, I will create a macro that uses the Drawer action to display the preset list.
 

Attachments

  • 1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6675.jpg
    1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6675.jpg
    37.2 KB · Views: 2
  • 1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6696.jpg
    1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6696.jpg
    67 KB · Views: 1
  • 1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6690.jpg
    1c4973d1-9b3c-41f7-9c35-9d95ced6db44-1_all_6690.jpg
    17.2 KB · Views: 1
Last edited:
This is a related post to the following thread.
Today I will show you how to install 12 presets on your Android phone using the Macrodroid app.


<Sample 1>
View attachment 18260

<Sample 2>
View attachment 18262




First, create the data needed to control the WiiM.

1) Save the IP address of the WiiM device you wish to control in Notepad.

Open the WiiM home app and save the IP in the device settings under Network Status to Notepad.
View attachment 18224
# This IP is used to control any WiiM device using the WiiM API. If you want to control multiple WiiM devices, please copy the IPs of all devices.


2) Save the IP as a variable.

Tap the "Variables" tile on the Macrodroid home screen to create a global variable.
View attachment 18226


Tap the "+" icon.
View attachment 18228


Enter a variable name of your choice and set the variable type to "String". In this example, I use "Ultra_IP".
View attachment 18229

Tap OK, and a new variable will be created. Since the value of the variable is still empty.

View attachment 18230

Tap "empty" and enter the IP.
View attachment 18231
Check "Make Variable secure" and tap OK.



3) Create a URL to use in the macro.

Insert a variable into the request URL of the WiiM API.

This is a sample URL to play the preset on a WiiM device.


Change the yellow IP address to this one.


The blue "%d" is the preset number. Setting this to 1 will play Preset 1; setting it to 12 will play Preset 12.



This completes the process.



4) Create a widget button to play preset 1.


Tap the tile "Add Macro".
View attachment 18233

After entering the macro name, tap the "+" button on the Triggers tab.
In this example, I use "01 Ultra Preset 1".
View attachment 18234

Tap the magnifying glass icon to search for "widgets".
View attachment 18235

Tap the "Widget Button".
View attachment 18236

Select "Custom" and tap the OK.
View attachment 18238


Tap "Select Image" to select an icon image.
View attachment 18239


"Add User Icon" can be tapped to add an image stored in storage here.
View attachment 18241

After selecting an image, enter your favorite label name and tap OK.
View attachment 18242

The target is now complete. Next, create the action.
Tap "+" to proceed.
View attachment 18243

Search for "http", and tap "HTTP Request".
View attachment 18245

Paste the URL created in "(3)" here.
View attachment 18246

Check the three checkboxes and tap here.
View attachment 18247

This completes the macro, but you can also launch any app after tapping the preset button. Here I will add an action that opens the WiiM app when the button is tapped.


Search for "app", and tap "Launch Application".
View attachment 18244

Select "Select Application" and then OK.
View attachment 18249

Choose WiiM Home.
View attachment 18251

OK.
View attachment 18252

Tap this button, and completes the process.
View attachment 18253



Press and hold the resulting macro to display the menu. Test your actions here.

Tap "(1) Test actions".
If preset 1 is played on WiiM and the WiiM app starts, it is a success.
View attachment 18256

In addition, you can duplicate this macro by tapping "(2) Clone macro" to create preset 2 or later macros. To do so, change the number at the end of the request URL.



With the macro completed, return to the phone's home screen and add the Android widget.

Press and hold the Home screen and tap the widget button.
View attachment 18254

Select a custom button from Macrodroid widgets.
View attachment 18255

Select the macro you just created.
View attachment 18258


Thank you for your hard work 😄.
View attachment 18259



In the next time, I will create a macro that uses the Drawer action to display the preset list.
Too much work to do for me. I’m lazy 😂 😂 😂
Anyway well done my friend
 
That's awesome! Thanks for the step-by-step tutorial!

Just kind of silly we have to make our own widgets and shortcuts. Also confirms once again I should stick with Android ;)
 
Continuing from last time, today I will make a drawer macros. Let's get started right away.


View attachment 1000002679.mp4

As you can see, just tap the icon on the home screen to open the drawer of the preset list. If you have already completed 12 preset macros, this macro is very easy to make.


1) Create a trigger for the "widget button"

Start creating a new macro and first decide on a macro name. In this case, I chose "A01 Drawer".

1000002732.jpg

(If you want to control multiple WiiM devices, give it a name that identifies which device it belongs to.)


Tap the "+" button on the trigger tab to search for "Widget".
1000002698.jpg


Select "Custom".
1000002700.jpg


After selecting an icon image, enter a label name.
1000002703.jpg
(If you want to control presets for multiple WiiM devices, give them easy-to-understand label names.)

The trigger is now complete!



2) Create a drawer action.

Search for "drawer", and tap "Macrodroid Drawer"
1000002705.jpg


Select a "Open".
1000002707.jpg


Yes, the macro is complete!
After saving, return to the phone's home screen and follow the same procedure as before to create the widget button.

Select a custom widget.
1000002709.jpg


Select the "A01 Drawer" that just created.
1000002711.jpg


Tap the icon added to the home screen, and the drawer should slide out.
1000002713.jpg

Once the drawer is displayed without problems, all that remains is to add preset buttons to it.



3) Add a preset macro to the drawer.

Tap the "+" button in the upper right corner of the drawer.
1000002715.jpg


Select a "Macro".
1000002717.jpg
(Tip: You can also add a music app here, or the WiiM playback control macros. How to create a playback control macro will come later...)


Select the preset macro you created last time.
1000002722.jpg


Select the preset icon again.
1000002724.jpg


"Choose Drawer when run" can be turned on to close the drawer when the preset button is tapped.
1000002726.jpg


The Preset 1 macro has been added to the drawer. Tap the icon to confirm that WiiM plays Preset 1.
1000002729.jpg


Now, to add all 12 presets, this process must be repeated 12 times 😂.


You can also rearrange the list by tapping the sort button next to the "+."
1000002731.jpg




The weakness of this drawer is that it cannot sync the WHA preset list.

Perhaps it would be easier to get a list of presets from the WiiM API to create a drawer that can be auto-sync. But my knowledge is not up to that level yet, so I will use the basic method this time, sorry.


In the next time, I will create a music controller for the WiiM app in the notification panel.

1000002734.jpg


Thanks.
 
Back
Top