Possible to read from Streamdeck and send commands like "open profile, ..."?

Hi, after a long time I am starting again with KM.
At the moment I am asking myself, if there is a way to read information from a streamdeck and then also control the streamdeck from KM.

I know, there are two plugins for streamdeck (the original and KMLink) to activate a KM macro by a press of Streamdeck button. But that is not, what I want.

I would like to use the streamdeck + to control a streamdeck xl.
More detailed: I want to use a rotary switch of the streamdeck + to rotate through a list of profiles or pages of a profile on the streamdeck xl.
Lets say, I have 5 profiles on my streamdeck xl.
When rotating a knob of the streamdeck +, I want to

  1. Read the actual name of the active streamdeck xl profile
  2. In the macro jump by a switch/case to the position of the actual active streamdeck xl profile.
  3. In that switch/case areas switch to the next profile

So read actual profile 1 from XL, jump to "switch/case 1" and switch XL to Profile 2.
Read actual profile 2 from XL, jump to "switch/case 2" and switch XL to Profile 3.
Read actual profile 5 from XL, jump to "switch/case 5" and switch XL to Profile 1.

Then I think I need two macros. One for rotating the knob from the streamdeck + cw and rotate the profiles from 1 to 2, to 3, ... and then a second macro for rotating ccw --> profiles from 1 to 5, to 4, ...

I hope it's clear, what I want to do and I know there is some functionality to control one streamdeck with an other one. But in general the functionality support of the streamdeck + and the rotary knobs is done so bad by elgato. I am missing several functionalitys I hope I can add with KM.

Extra functionality
An other functionality I am missing since the beginning of Streamdeck is switching between profiles.
In a profile I can set up a button to jump to an other profile. But this is not dynamic.
If I have to main profiles "work 1" and work 2" and I have a functionality that I need in both main profiles - for example buttons for window management (move actual window to the left, right or middle position of the screen) I would like to have this windowmangment in one profile.
Now I would like to open the window mangement profile from both work profiles. That also works fine.
In both profiles I can place a button to open the profile "windowmanagement".
But now I want to jump back from the window management to my previous work profile.
And this function "go back to previous/ calling profile" is not supported by elgato.
What I would like to to wit KM:
When pressing the button "open windowmanagement" from one of the work profiles a KM makro is triggerd that reads the actual streamdeck profile, saves the name to a variable "last profile" and then opens the window mangement profile.
When pressing the "back button" in the window managment profile a KM makro is triggert, that reads the "last profile" variable and then opens that profile.

That are two usecases, I want to solve with KM. Is that possible?
If yes, any tips how to do so? I couldn't find anything like that right now :frowning:

Thanks a lot, Marco