good point, thanks!
i want to show you my rule for a harmony hub and maybe you have ideas how to optimize that.
I want to say “Alexa, start SKY TV” and it turns everything on as defined with my harmony hub. I need to change the state of everything else to OFF then, because i may want to say “start kodi” but if kodi was started before, it will not start again, because it is already in the state of started.
if there is a better solution for that, then i am grateful for any ideas how to optimize the construct
to switch everything off i made an extra rule called “alle Media Geräte aus” which is alway on if a acitvity was started. so i am able to say “alex, switch all devices off”.
the last small problem is, that if i am now saying “alexa, turn on sky tv” alexa asks me which device (because i have “sky tv” and “sky beamer” and i need to repeat what i was saying. very annoying. siri dont ask me that, she simply does her job
items:
//Harmony
String Harmony_Activity "Current Activity [%s]" (Wohnzimmer) { channel="harmonyhub:hub:HarmonyHub:currentActivity" }
Switch Harmony_skytv "Sky Fernseher" (Wohnzimmer) [ "Switchable" ]
Switch Harmony_skybeamer "Sky Beamer" (Wohnzimmer) [ "Switchable" ]
Switch Harmony_koditv "Kodi Fernseher" (Wohnzimmer) [ "Switchable" ]
Switch Harmony_kodibeamer "Kodi Beamer" (Wohnzimmer) [ "Switchable" ]
Switch Harmony_alles "alle Media Geräte" (Wohnzimmer) [ "Switchable" ]
rules
rule "Sky TV schauen"
when
Item Harmony_skytv changed to ON
then
Harmony_Activity.sendCommand("24360745")
postUpdate(Harmony_koditv, OFF)
postUpdate(Harmony_skybeamer, OFF)
postUpdate(Harmony_kodibeamer, OFF)
postUpdate(Harmony_alles, ON)
end
rule "Sky Beamer schauen"
when
Item Harmony_skybeamer changed to ON
then
Harmony_Activity.sendCommand("24360747")
postUpdate(Harmony_koditv, OFF)
postUpdate(Harmony_kodibeamer, OFF)
postUpdate(Harmony_skytv, OFF)
postUpdate(Harmony_alles, ON)
end
rule "Kodi TV schauen"
when
Item Harmony_koditv changed to ON
then
Harmony_Activity.sendCommand("24361209")
postUpdate(Harmony_skybeamer, OFF)
postUpdate(Harmony_kodibeamer, OFF)
postUpdate(Harmony_skytv, OFF)
postUpdate(Harmony_alles, ON)
end
rule "Kodi Beamer schauen"
when
Item Harmony_kodibeamer changed to ON
then
Harmony_Activity.sendCommand("24360748")
postUpdate(Harmony_koditv, OFF)
postUpdate(Harmony_skybeamer, OFF)
postUpdate(Harmony_skytv, OFF)
postUpdate(Harmony_alles, ON)
end
rule "Alle Media Geräte aus" //Switch everything off and update the activities
when
Item Harmony_alles changed from ON to OFF
then
Harmony_Activity.sendCommand("PowerOff")
postUpdate(Harmony_koditv, OFF)
postUpdate(Harmony_skybeamer, OFF)
postUpdate(Harmony_kodibeamer, OFF)
postUpdate(Harmony_skytv, OFF)
postUpdate(Harmony_alles, ON)
end