I searching for a solution for this problem:
I like to create a rule or scene if I’m on holiday the lights should turn off on 0 o’clock instead on 23 o’clock.
Somebody with an idea?
I have already created this scene
rule "Szenen"
when
Item Szenen_EG received command
then
switch receivedCommand {
//alles aus
case 0: {
Lichtleiste.sendCommand(OFF)
Hue_Color_Wohnzimmer_links.sendCommand(OFF)
Hue_Color_Wohnzimmer_rechts.sendCommand(OFF)
Hue_Color_Kueche_links.sendCommand(OFF)
Hue_Color_Kueche_rechts.sendCommand(OFF)
Hue_Toggle.sendCommand(OFF)
}
//kochen
case 1: {
Lichtleiste.sendCommand(ON)
Hue_Color_Wohnzimmer_links.sendCommand("43,90,60")
Hue_Color_Wohnzimmer_rechts.sendCommand("43,90,60")
Hue_Color_Kueche_links.sendCommand("0,0,100")
Hue_Color_Kueche_rechts.sendCommand("0,0,100")
}
//essen
case 2: {
Lichtleiste.sendCommand(ON)
Hue_Color_Wohnzimmer_links.sendCommand("0,0,100")
Hue_Color_Wohnzimmer_rechts.sendCommand("0,0,100")
Hue_Color_Kueche_links.sendCommand("35,90,60")
Hue_Color_Kueche_rechts.sendCommand("35,90,60")
} ...
But here I have to switch every day manually between the scenes.
I’m searching for a solution, where I switch one time for a week for example.
You can set up a 2nd rule with a cron trigger at 0 o’clock that checks if a virtual switch (let’s call it HolidayMode) is set to ON and if yes send command 0 to your Szenen rule.
This would call scene 0 every day at midnight until you set HolidayMode to OFF
But I have several problems with the rule. I tried this:
rule "HolidayMode"
when
Item HolidayMode changed to ON
then // OFF at 0 o'clock
sendCommand(Hue_Toggle_Kueche_links, OFF)
else // OFF at 23 o'clock
sendCommand(Hue_Toggle_Kueche_links, OFF)
end
But here I missing the cron trigger.
Do you have an idea how I can implement the cron trigger?
rule "LightsOff_HolidayMode_ON"
when
// Trigger at 0 o'clock
Time cron "0 0 0 1/1 * ? *"
then
// check if HolidayMode is ON
if (HolidayMode.state == ON) {
Szenen_EG.sendCommand(0)
}
end
rule "LightsOff_HolidayMode_OFF"
when
// Trigger at 23 o'clock
Time cron "0 0 23 1/1 * ? *"
then
// check if HolidayMode is OFF
if (HolidayMode.state == OFF) {
Szenen_EG.sendCommand(0)
}
end
In your first post you have postet your “Szenen” rule with the Item Szenen_EG. How have you defined this item? The code of your rule implies this is a number item as your case clause lists different numeric cases. So sending this command to the item should trigger the respective case to change to state of all lights.