This is a minimal reproduction repository for a bug regarding "switchToProfile" event - https://developer.elgato.com/documentation/stream-deck/sdk/events-sent/#switchtoprofile
It contains a small Javascript plugin with a preconfigured profile and two actions that will be useful for demonstration purposes:
- switchToProfile action - emits "switchToProfile" event with "Preconfigured Profile" as the payload
- switchToNull action - emits "switchToProfile" event with "null" as the payload
https://help.elgato.com/hc/en-us/articles/360053419071-Elgato-Stream-Deck-Smart-Profiles
A Smart Profile automatically switches the active profile on Stream Deck based on the program in focus.
The bug causes the Smart Profiles functionality to stop working after a plugin sends a "switchToProfile" event with any payload.
Assuming Windows 10 and a clean installation of the Stream Deck app:
- Configure Smart Profiles
- Create two profiles
- Open Preferences ⚙️ → Profiles
- Click on the first profile, then check "Make this my default profile"
- Click on the second profile, assign it to an application
- Close the Preferences
-
Install this plugin
- Download com.bug.switch-to-profile.streamDeckPlugin file and double-click to install it
- Accept installing preconfigured profiles
- You’ll see a new profile has been added called "Preconfigured Profile"
-
Place plugin’s action
-
Ensure Smart Profile functionality is working
- Close the Stream Deck app (close - not quit, not minimize). It’s needed as Smart Profiles functionality does not work when the app is open, even when minimized to taskbar.
- Start changing focus between the app you assigned to a profile on step 1.4, and your desktop or any other app (so that the default profile gets activated).
- Observe that profiles are switching as you change the focus (Smart Profiles are working).
- Close the Stream Deck app (close - not quit, not minimize). It’s needed as Smart Profiles functionality does not work when the app is open, even when minimized to taskbar.
-
Press the plugin's action button you placed on step 3; the "switchToProfile" event should be sent by plugin, resulting in switching to the plugin's bundled profile called "Preconfigured Profile". The plugin's bundled profile should be activated as expected.
- Smart Profiles feature no longer works. You can focus the app or desktop - the profile will stay the same.
This bug can be reproduced consistently every time a plugin sends "switchToProfile" event.
After a plugin sends a "switchToProfile" event and changes the currently active profile, changing focus from the currently focused application should activate the profile associated with the newly focused application.
The Smart Profiles feature gets disabled (profiles no longer switch automatically when changing focus) after a plugin sends "switchToProfile" event, even if the plugin specifies "null" as the payload.
This causes inconvenience to users who have to manually enable the functionality every time a plugin attempts to switch to any, even non-existent, profile.
Unfortunately, there is no way for a plugin to "return control" over profiles to the Stream Deck app once a "switchToProfile" event has been triggered. If the plugin sends "switchToProfile" with "null" as the payload, the previously active profile gets activated as stated in documentation:
If the
profile
field is missing or empty, the Stream Deck application will switch to the previously selected profile.
However, the Smart Profiles feature still does not begin to work even after that.
There are two ways to make Smart Profiles work again, but both require manual user action:
- open Stream Deck app, select a different profile, then close Stream Deck app.
- place a "Switch Profile" action from the "Navigation" category on the plugin’s preconfigured profile and trigger it.
The bug has been observed on the following setup:
- Device: Stream Deck +
- Software Version: 6.0.5.18168
- Firmware Version: 2.0.3.1
- OS: Windows 10 20H2 (OS build: 19042.1466)
This bug significantly affects the usability of the Stream Deck application, especially for users who frequently switch between profiles. The Smart Profiles feature, which is designed to automatically switch profiles based on the active application, becomes practically unusable as users have to manually enable it every time a plugin attempts to switch profiles.