Macro Deck Companion
Included with Macro DeckControl the phones and tablets that run the Companion app: brightness, rotation, screen and screenshots.
The Connect a device dialog of the Macro Deck Companion integration, which has no fields
- Set the screen brightness and orientation of a device
- Turn the screen on and off on Android
- Save screenshots of the deck as PNG files on your computer
- Battery, network and memory of each device as variables
- Device Ready trigger when a device connects
The Macro Deck Companion integration connects Macro Deck to the phones and tablets that run the Macro Deck Companion app for Android, iPhone and iPad. Every device that connects gets its own configuration, so you can send commands to one specific tablet and read what it reports, next to all your other devices.
You do not enter anything to set it up. Open the Companion app on the device and connect it to your computer. The device then appears in the integration by itself, under its own name.
What you can do
The actions work on one device at a time. You choose the device in the Device field of each action:
- Set screen brightness and Set orientation (automatic, portrait or landscape) work on Android, iPhone and iPad.
- Vibrate works on Android and iPhone.
- Take screenshot captures the deck, or on Android the whole screen, and saves it as a PNG file in a folder on your computer.
- Turn screen on, Turn screen off and Bring to front work on Android, once you allow them under Device control in the app settings.
Each device also reports its state as variables: battery level, charging, orientation, screen brightness, model, platform, app version, whether Macro Deck is in front, the network type and name, and CPU and memory usage. Use them in labels, conditions and automations like any other variable.
Example setups
- A tablet that only serves as a deck: an automation on Server Stopped runs Turn screen off when Macro Deck quits, and an automation on Device Ready runs Turn screen on when the tablet is back.
- Two automations on Variable Changed for the System integration's
system_lockedvariable turn the tablet's screen off when you lock the computer and on again when you unlock it. - A Schedule event at 22:00 runs Set screen brightness at 20 %, another one at 08:00 sets it back.
- A label on your phone's deck shows
companion_<configuration>_battery_level_percentof the tablet on the wall, so you see when it needs charging. - A button with Take screenshot saves the deck as a PNG file, and Save path to variable puts the file's path into a variable for the next action.
An action needs the device to be connected. When it has just connected, the action waits a few seconds for it to be ready. When a device is not connected, its variables read as unavailable, except companion_<configuration>_is_connected, which reads false.
What you need
- Macro Deck 3 on your computer
- The Macro Deck Companion app on Android 6 or later, or iOS and iPadOS 15 or later
- A Companion app license or the free 7-day trial
- The device in the same network as the computer, or connected by USB
- On Android, the permissions under Device control in the app for turning the screen on and off and for Bring to front
Set it up
Step 1: Install the Companion app
Install Macro Deck Companion from Google Play or the App Store on your phone or tablet. Start the free 7-day trial or buy the license.
Step 2: Connect the device to Macro Deck
In Macro Deck on the computer, open the network panel with the network icon at the top right. In the app, tap Add connection (on iPhone and iPad, +), choose Scan QR code and scan the code in the panel. You can also pick the computer under Found on this network or enter its address.
Step 3: Find the device in the integration
In the sidebar, click Integrations and then Macro Deck Companion. Once a device has connected, it appears under Configuration on the Overview tab by itself, with its name, and the switch at the top right is on. If you turned the integration off before, turn the switch on again. Add configuration opens the Connect a device dialog, which has no fields and only explains this. Rename changes the name Macro Deck uses for a device.
Step 4: Allow device control on Android
To turn the screen on and off or bring the deck to the front, open the app settings on the Android device and turn on the permissions under Device control. Turn screen on also needs Background connection and Display over other apps, so the device stays connected while its screen is off.
Step 5: Add a Companion action to a button
On the Deck page, make sure the deck is unlocked (the button at the top right reads Lock) and click a button. The editor opens with Short Press selected. Click + Add action, choose Macro Deck Companion on the left of the Add action dialog and pick an action, for example Set screen brightness. Choose the device under Device and set the value.
Step 6: Press the button
Click Save and press the button on any of your decks. The device runs the command while it is connected to Macro Deck.
Actions7
Put these on a button or run them from a flow.
- Set screen brightness
- Sets the screen brightness of a Companion device, from 0 to 100 %.
- Set orientation
- Locks a Companion device to portrait or landscape, or lets it rotate automatically.
- Vibrate
- Makes a Companion device vibrate briefly (Android and iPhone).
- Turn screen on
- Turns on the screen of a Companion device and shows this Macro Deck (Android).
- Turn screen off
- Turns off the screen of a Companion device (Android).
- Bring to front
- Shows the deck of this Macro Deck in front on a Companion device (Android).
- Take screenshot
- Captures the deck or, on Android, the full screen of a device and saves it as a PNG file in a folder on your computer.
Triggers1
A button or flow can react to these events.
- Device Ready
- Runs when a Companion app has connected and can run Companion actions, optionally only for one device.
Variables15
Show these values on buttons and widgets, or use them in conditions.
companion_<configuration>_is_connected- Whether the device is connected right now.
companion_<configuration>_battery_level_percent- The battery charge in percent.
companion_<configuration>_charging- Whether the device is charging.
companion_<configuration>_orientation- Whether the device is in portrait or landscape.
companion_<configuration>_screen_brightness_percent- The screen brightness in percent.
companion_<configuration>_model- The device model.
companion_<configuration>_platform- The operating system and its version, for example
Android 14. companion_<configuration>_app_version- The version of the Companion app.
companion_<configuration>_in_focus- Whether Macro Deck is in front on the device.
companion_<configuration>_network_type- The network type: Wi-Fi, cellular, Ethernet, VPN or none.
companion_<configuration>_network_metered- Whether the network is metered.
companion_<configuration>_network_validated- Whether the network reaches the internet.
companion_<configuration>_network_name- The name of the Wi-Fi network, on Android with the Wi-Fi name permission.
companion_<configuration>_cpu_usage_percent- The CPU usage in percent, on iOS.
companion_<configuration>_memory_used_percent- The memory in use in percent.
Frequently asked questions
Do I need the Companion app to use Macro Deck on a phone?
No. Every device with a current browser can use the free web client. The actions and variables of this integration need the Companion app, because a browser cannot control the device itself.
Why does Turn screen on or Turn screen off fail?
These actions work on Android only, and only with the permissions under Device control in the app settings. Turn screen on also needs Background connection and Display over other apps, so the device stays connected while its screen is off. On iPhone and iPad, an app cannot turn the screen on or off.
What happens when a device is not connected?
An action for that device fails with The Companion device is not connected. Its variables read as unavailable, and companion_<configuration>_is_connected reads false. When the device connects again, Device Ready runs and the variables update.
Can I use several phones and tablets?
Yes. Every device that connects gets its own configuration, with its own variables. In each action you choose the device under Device.
Where are the screenshots saved?
On the computer running Macro Deck, in the Folder you choose in the action, as companion-screenshot-<date>-<time>.png. A screenshot of the deck needs the deck to be on the device's screen. A full screen screenshot works on Android only, after you allow it on the device.
Can plugins use my Companion devices too?
Only while Allow plugins to use Companion devices is on under Plugin access in Settings > Companion App. It is off until you turn it on. It does not affect this integration's own actions, variables and trigger.
More in Macro Deck
Macro Deck Delegate
Included with Macro DeckRun scripts on another PC running Macro Deck and use the variables it shares.
Scripts
Included with Macro DeckBuild a set of actions once as a script and run it from any button, automation or other script.
Variables
Included with Macro DeckChange your variables from buttons and automations, and write any variable to a file.