habe mich gerade angemeldet, um neben dem englischen OH Forum auch hier mal reinzuschauen und mich von anderen inspirieren zu lassen.
Ich habe für eine Wohnung eine recht große OH Implementierung und möchte gerne in einer Rule morgens nach dem Aufstehen eine Routine ablaufen lassen. Das untenstehende Rule funktioniert auch soweit aber 2 Dinge fehlen noch. Diese Rule nur ausführen zwischen 6-9 Uhr + nur einmal am Tag. Habt ihr Ideen wie ich das hier integrieren kann? Das Problem ist, das ich die Timer in der Rule schon sehr angepasst habe und nicht sicher bin wie ich weitere Timer und Timechecks integriere. Ich würde mich über Vorschläge freuen wie ihr die beiden Aspekte integrieren würdet bei den bereits gesetzten Timern.
Code: Alles auswählen
var Timer tAutoOff = null
var int iAutoOff = 0
var Timer t1 = null
var Timer t2 = null
rule "Morgenroutine"
when
Item LobbyMotionSensor changed from OFF to ON
then
if(tAutoOff !== null) // timer already scheduled, so leave rule
return;
iAutoOff = 0 // initialize counter
tAutoOff = createTimer(now, [|
iAutoOff ++
switch(iAutoOff) {
case 1 : {
AlexaTTS.sendCommand('XYZ')
broadlink_rm3_78_0f_77_5a_be_d1_command.sendCommand("NUBERTON")
AllLightsSwitchGroup.sendCommand("ON")
Receiver.sendCommand("ON")
LivingRoomLoungeLight.sendCommand("ON")
BedroomLoungeLight.sendCommand("ON")
}
case 2 : {
t1 = createTimer(now.plusSeconds(10), [|
AlexaTraffic.sendCommand("Traffic")
AlexaTraffic.sendCommand("Weather")
])
}
case 3 : {
Sonos_Master_Bedroom_Add.sendCommand("RINCON_000E582AC07601400")
Sonos_Master_Bedroom_Add.sendCommand("RINCON_000E582AC07E01400")
Sonos_Master_Bedroom_Add.sendCommand("RINCON_B8E93783325201400")
Sonos_Master_Bedroom_Add.sendCommand("RINCON_B8E9375835EC01400")
LivingRoomSonosVolume.sendCommand("85")
SonosShuffle.sendCommand("ON")
SonosPlaylist.sendCommand("Fluid")
}
case 4 : DenonInput.sendCommand('MPLAY')
case 5 : {
t2 = createTimer(now.plusSeconds(10), [|
NubertSelect.sendCommand("NUBERTCHANOPTICAL") ])
}
default : {
tAutoOff = null
return;
}
}
tAutoOff.reschedule(now.plusSeconds(3))
])
end