Hi,
i need to create a flow that enable the power saving mode and after the ultra power saving mode.
I have already created the Flow with the correct trigger, but I can't find an action that switch psm on.
I try with System:psm_switch -> 1 but nothing happens.
The phone is Samsung Galaxy S5 (SM-G900F).
Samsung PSM e UPSM
Moderator: Martin
- TheBrain1984
- Posts: 137
- Joined: 07 Aug 2013 08:17
- Location: Germany
Re: Samsung PSM e UPSM
Hi,
I have a S4, so I don't know exactly how to handle it but I made something similar with the dormant_mode on the S4. I think you're on the right way, because I did the same with the dormant_mode. The problem is you need to search the right variable. So if this var you said changes, when you go into saving mode then it should be the right one. What I saw on my phone was that the notification bar didn't change like it should, so when I put the phone in domant_mode the notification that it is in domant_mode doesn't appear. Maybe you have to doublecheck if it is in saving mode.
I have a S4, so I don't know exactly how to handle it but I made something similar with the dormant_mode on the S4. I think you're on the right way, because I did the same with the dormant_mode. The problem is you need to search the right variable. So if this var you said changes, when you go into saving mode then it should be the right one. What I saw on my phone was that the notification bar didn't change like it should, so when I put the phone in domant_mode the notification that it is in domant_mode doesn't appear. Maybe you have to doublecheck if it is in saving mode.
Re: Samsung PSM e UPSM
Hi,
psm_switch was the name used on the S3, Samsung changed the name to powersaving_switch on the S5. Since this is an undocumented manufacturer specific setting, it could also fail or not activate properly.
To my knowledge there's no way to turn on ultra power saving mode. There is a setting called ultra_powersaving_mode but changing the value to 1 does not activate the mode.
Regards,
Martin
psm_switch was the name used on the S3, Samsung changed the name to powersaving_switch on the S5. Since this is an undocumented manufacturer specific setting, it could also fail or not activate properly.
To my knowledge there's no way to turn on ultra power saving mode. There is a setting called ultra_powersaving_mode but changing the value to 1 does not activate the mode.
Regards,
Martin
Re: Samsung PSM e UPSM
Perfect! It work like a charm.
Thanks. For the upsm is not a problem. I'll try with an external app, launched from Automagic.
Thanks again,
Manu
Thanks. For the upsm is not a problem. I'll try with an external app, launched from Automagic.
Thanks again,
Manu
Re: Samsung PSM e UPSM
Ehm, no.
I must do an Errata Corridge.
The setting powersaving_switch only control the psm icon state. By setting it to 1, it "light" the psm icon without entering in power saving mode.
This also happens with ultra_powersaving_switch, like you said.
Hope this will help you,
Regards.
Manu
I must do an Errata Corridge.
The setting powersaving_switch only control the psm icon state. By setting it to 1, it "light" the psm icon without entering in power saving mode.
This also happens with ultra_powersaving_switch, like you said.
Hope this will help you,
Regards.
Manu
Re: Samsung PSM e UPSM
Too bad, I only checked whether the icon of the power saving mode switched properly.
Anything that goes beyond toggling a system setting in the settings database is extremely device specific and most probably requires a rooted device.
On the current Lollipop version distributed for the S5 you might have luck with action Execute Root Command: service call power 30 i32 1 to turn PSM on and Execute Root Command: service call power 30 i32 0 to turn it off. At least the display dims somewhat when I tested the command but the PSM icon did not change. Maybe you would have to combine both actions to properly switch PSM and reflect it in the UI.
You could also use action Control UI to toggle the setting when the screen in on and unlocked. A script script like this could work:
I heard that the plugin Secure Settings offers an action to toggle some of the Samsung specific functions. Maybe this will work properly.
Regards,
Martin
Anything that goes beyond toggling a system setting in the settings database is extremely device specific and most probably requires a rooted device.
On the current Lollipop version distributed for the S5 you might have luck with action Execute Root Command: service call power 30 i32 1 to turn PSM on and Execute Root Command: service call power 30 i32 0 to turn it off. At least the display dims somewhat when I tested the command but the PSM icon did not change. Maybe you would have to combine both actions to properly switch PSM and reflect it in the UI.
You could also use action Control UI to toggle the setting when the screen in on and unlocked. A script script like this could work:
Code: Select all
// open quick settings
quickSettings();
//wait for the animation to finish
sleep(1000);
//click the PSM button
click("Power saving mode is*");
//press back to close the quick settings drawer
back();
Regards,
Martin
Re: Samsung PSM e UPSM
Martin wrote:Too bad, I only checked whether the icon of the power saving mode switched properly.
Anything that goes beyond toggling a system setting in the settings database is extremely device specific and most probably requires a rooted device.
On the current Lollipop version distributed for the S5 you might have luck with action Execute Root Command: service call power 30 i32 1 to turn PSM on and Execute Root Command: service call power 30 i32 0 to turn it off. At least the display dims somewhat when I tested the command but the PSM icon did not change. Maybe you would have to combine both actions to properly switch PSM and reflect it in the UI.
Ok, important information: I have KitKat 4.4.2, rooted (obviously).Martin wrote:I heard that the plugin Secure Settings offers an action to toggle some of the Samsung specific functions. Maybe this will work properly.
I set the psm to put my screen color in gray-scale and to limit my background data. If i active psm with Automagic, the grey-scale or the bglimit don't start.
I tried Secure Setting. The setting exist (Samsung Mode), but it also control the icon state not the psm (same try with grey-scale).
This sounds like a nice trick to do what i need.Martin wrote:You could also use action Control UI to toggle the setting when the screen in on and unlocked. A script script like this could work:I heard that the plugin Secure Settings offers an action to toggle some of the Samsung specific functions. Maybe this will work properly.Code: Select all
// open quick settings quickSettings(); //wait for the animation to finish sleep(1000); //click the PSM button click("Power saving mode is*"); //press back to close the quick settings drawer back();
Regards,
Martin
Only two question:
1) How can I unlock the device screen? I don't use pinlock or fingerprint. Only the finger-slide.
2) Have you a wiki or a knoledgebase with the documentation of this nice script language? Where I could find more pattern for the click() function. I found only examples and a list of functions, not a list of patterns

Thanks in advice,
Best Regards.
Manu
Re: Samsung PSM e UPSM
Hi Manu,
I think the command for the regular PSM mode on a Samsung 4.4.2 ROM was Execute Root Command: service call power 29 i32 1 resp. Execute Root Command: service call power 29 i32 0, but I might be wrong and can't verify anymore.
Working with the lock screen can be quite frustrating since this area of Android is quite buggy and manufacturers like Samsung sometimes even manage to make it worse.
Following actions could work to unlock the screen:
-action Dismiss Slide to Unlock Keyguard
-action Set Keyguard State: Off (later turn it on again using the opposite action)
-action Execute Root Command: input keyevent MENU (often not working on Samsung devices)
The script language in general is documented within the help page of action Script. Here's the online version: Script.
The pattern to use in the function click() depends on the 'label' of the button which can be invisible in the case of the quick settings toggles. The quick settings toggles are especially nasty to get the values for since the quick settings are usually displayed above all other apps. Anyway, you can find the values like this:
-open an action Control UI
-press Show Overlay Control (note the red buttons at the top of the screen)
(pressing INFO shows green borders around the controls of the current screen, pressing back closes the overlay with the green borders. A touch within the green border shows the functions that potentially work for the selected control.)
-expand the quick settings area
-press INFO (note that the overlay with the green borders is displayed behind the quick settings toggles)
-press back to close the quick settings area
-now you see the overlay with green borders superimposed on the screen
-press one of the green rectangles to show the available functions
-select one of the click-functions to copy the function to the clipboard
-press back to close the overlay with the green borders
-paste the text in the text area with the script
Here are a few examples of quick settings toggle names: Wi-Fi is on., Location is on., Mobile data is off. (tested on a S5 with Lollipop).
So it seems that Samsung in general uses the name of the setting with suffix "is on." or "is off.", therefore you can use click("Power saving mode is*"); to toggle the setting to the opposite value.
You could also use an action Launch App to start the settings page of your choice and click on a toggle button or radio button within the settings page. This will also allow to change settings that are not available as a quick settings tile.
Regards,
Martin
I think the command for the regular PSM mode on a Samsung 4.4.2 ROM was Execute Root Command: service call power 29 i32 1 resp. Execute Root Command: service call power 29 i32 0, but I might be wrong and can't verify anymore.
Working with the lock screen can be quite frustrating since this area of Android is quite buggy and manufacturers like Samsung sometimes even manage to make it worse.
Following actions could work to unlock the screen:
-action Dismiss Slide to Unlock Keyguard
-action Set Keyguard State: Off (later turn it on again using the opposite action)
-action Execute Root Command: input keyevent MENU (often not working on Samsung devices)
The script language in general is documented within the help page of action Script. Here's the online version: Script.
The pattern to use in the function click() depends on the 'label' of the button which can be invisible in the case of the quick settings toggles. The quick settings toggles are especially nasty to get the values for since the quick settings are usually displayed above all other apps. Anyway, you can find the values like this:
-open an action Control UI
-press Show Overlay Control (note the red buttons at the top of the screen)
(pressing INFO shows green borders around the controls of the current screen, pressing back closes the overlay with the green borders. A touch within the green border shows the functions that potentially work for the selected control.)
-expand the quick settings area
-press INFO (note that the overlay with the green borders is displayed behind the quick settings toggles)
-press back to close the quick settings area
-now you see the overlay with green borders superimposed on the screen
-press one of the green rectangles to show the available functions
-select one of the click-functions to copy the function to the clipboard
-press back to close the overlay with the green borders
-paste the text in the text area with the script
Here are a few examples of quick settings toggle names: Wi-Fi is on., Location is on., Mobile data is off. (tested on a S5 with Lollipop).
So it seems that Samsung in general uses the name of the setting with suffix "is on." or "is off.", therefore you can use click("Power saving mode is*"); to toggle the setting to the opposite value.
You could also use an action Launch App to start the settings page of your choice and click on a toggle button or radio button within the settings page. This will also allow to change settings that are not available as a quick settings tile.
Regards,
Martin