Automatically adjust ringtone volume Marshmallow
It still possible with Automate to dim the screen and change the volume.


In the Connectivity section, select "Wi-Fi connected". Click on it, enter the Network Name (or click on Pick network to select a Network (the WiFi must be on, if not the list will be empty)). Click Done.
In the Settings section, select "Screen brightness set". Click on it, enter the Brightness level (expressed in percentage). Click Done.
In the Camera &amp; Sound section, select "Audio volume set". Click on it, enter the Volume level (expressed in percentage), then in Audio Stream, select Ring (System is for system-wide sounds). Click Done.
Steps 2 and 3 parameters are for when the phone is connected to a selected Wifi network. Repeat steps 2 and 3, but change the parameter to reflect brightness and volume values when the phone is disconnected from the selected Wifi network.
Link the blocks as seen on the picture below. Save the flow and give it a name. Give the appropriate permissions (some maybe installed). Click Start.
Optional - If you want, the flow to run at boot, in the settings, select Run on system startup