My goal is to be able to play radio stations through my Chromecast. I have created the following template-switch, to start the playback of P3 radio station: https://pastebin.com/PThpjfqJ
This relies on the radiostream being casted or not. The template-switch fires the script chromecast_play_p3 which looks like this: https://pastebin.com/jLYC44m9
Here I have added a delay to first casting the stream when my amplifier and Chromecast is turned on. Sometimes the Amplifier/Chromecast is already on when starting the radiostream from the template-switch, in this case it won’t have to wait the 30 seconds.
Is it possible to implement a if/else in my script to evaluate if the harmony activity is on or not before executing the rest of the script, if it is on it should cast the stream. If it is off it should wait for 30 seconds before casting the stream.
The template-switch and script works fine now. I just want to evaluate on having to wait the 30 seconds before casting the stream or not.
Thanks in advance.
Regards
Joe