Chromecast Audio link/integration

Hi,

I’ve looked for answers to this but not getting anywhere at the moment - most posts are about controlling chromecast from within smartthings but I kind of want to do the opposite.

I have 3 Chromecast Audios plugged into 4 amps powering ceilings speakers in 3 rooms. The amps are on all day everyday in case anyone wants to cast to them but we only really use them for a few hours a day. They use power and give off heat so I want to try and reduce the time they’re on for.

I’m looking for a way to turn the amps on when Chromecast audio starts playing. I have all 4 amps on one extensionlead plugged into a smart plug at the moment but it’s working on a simple timer so it turns off at night.

Options I’m considering

  1. Some kind of link (Ifttt?) to trigger smartthings to turn on the amps when Chromecast audio is playing

  2. Motion sensors to turn on the amps when the rooms are occupied

  3. Some kind of Splitter on the audio output from the Chromecast audio going into a sensor that could detect that music was playing and trigger the smart plug.

  4. Remotes/buttons in each room to manually turn the amps on when required. (This is my least favourite option as I don’t want manual intervention.

Any ideas on how to achieve the above (well 1 or 3 at least - 2 and 4 I already know how to do) or any better ideas?

I got tired of messing around with ever changing API’s and came up with this. I use an el wire headphone cable and a zwave lux sensor to do the same thing with an airport express. I keep the cable and lux sensor in a dark box. The green one is the brightest.

This is the automaton I use to drive it.

Thanks, I didn’t know those even existed! That’s a definite option although 3 cables plus the light sensor and box isn’t cheap.

I agree that avoiding APIs makes a lot of sense.

If you have the Chromecasts turned on and you have (edit) caSt-web-api, your piston would be “If status changes to playing, turn on smart plug”.

Searching for cat-web-api turns up some interesting results but once I realised you meant cast-web-api I made more progress. I’d never come across it before but it looks very promising. I have a NAS with docker I should be able to run it on so I’ll give it a try. Thanks!

I shouldn’t trust my writing without my monocle.

OK, so I’m half way there. Turning the amplifier on works but turning it off doesn’t seem to. Anyone spot the (hopefully obvious) mistake in my webcore code? It’s my first time using webcore so I’m probably doing something silly.

I wouldn’t use an Else, just do another separate If block for starters. Then just play with the second block until it works, try without the 300 seconds first, try If changes to stopped, ready… Etc you’ll get there.

Edit and in the first If, you have “Any” devices, and in the second If “All” devices.