Ich häng mich hier mal kurz rein.
Also ich verstehe nicht ganz warum du am Ende
setState ("sonos.0.root.192_168_178_218.favorites_set", 'Radio');
machst, du speicherst doch vorher den aktuellen Sender, da schreib ihn doch einfach wieder rein.
Ich mach das z.B. so
var idSonosfav = getState("sonos.0.root.192_168_66_40.favorites_set").val;
var idSonosplay = getState ("sonos.0.root.192_168_66_40.state_simple").val;
if (obj.newState.val ==="green" && idSonosplay === true) {
setState (idSayIt, "Alles in Ordnung, der CO2 Gehalt liegt bei" + getState('hm-rega.0.1968').val);
setTimeout(function () {
setState ("sonos.0.root.192_168_66_40.favorites_set", idSonosfav);
}, 9000);
});