by Roberto Colombo
This flow is designed to launch the "I´m feeling lucky radio" from Google Play Music app on bluetooth speakers, when the morning alarm goes off.
Works also without an external bluetooth device.
The flow will begin when the alarm goes off, only when at home (identified by WiFi network name) and only for morning alarms during working days.
Wifi and Bluetooth connection will be enabled in the beginning of the flow and disabled at the end. End of the flow is triggered by lost home-WiFi connection
The Bluetooth device must have been already paired previously, and both Bluetooth and WiFi connections must start automatically when bluetooth/wifi are enabled.
Start the flow for the first time, it will start then again at each alarm.
-"Is in time window". Block 10, music will play only if the alarm goes off during the specified time interval
-"Is Wi-Fi connected". Block 28, set your WiFi network details
-"Is Wi-Fi connected". Block 27, set your WiFi network details
-Delay block is there to allow the phone enough time to establish the connection, and allow the user to turn the alarm off (music will snooze the alarm if it starts before the alarm is turned off)
-the two "Set audio volume" blocks, which are there to set volume when the music starts and to restore it to a different value when the music stops.
Tested on Sony Z5 compact, Android 6.0.1