I need a rule for this scene:
I want to switch some lights on if the TV went on:
rule "Szene TV an"
when
Item TV_Switch changed to ON
then
Lichtleiste.sendCommand(ON)
Hue_Color_Wohnzimmer_links.sendCommand("35,90,50")
Hue_Color_Wohnzimmer_rechts.sendCommand("35,90,50")
Hue_Color_Kueche_links.sendCommand("35,90,50")
Hue_Color_Kueche_rechts.sendCommand("35,90,50")
Hue_Toole_Leselampe.sendCommand(OFF)
}
end
So far so good. But, I want that the lights switched only on after sunset. Somebody an idea how to do this? I already use the Astro function astro:sun:local:set#event for some other events.
rule "Szene TV an"
when
Item TV_Switch changed to ON
then
if (SunElevationItem.state < 0) { // Sun is down
Lichtleiste.sendCommand(ON)
Hue_Color_Wohnzimmer_links.sendCommand("35,90,50")
Hue_Color_Wohnzimmer_rechts.sendCommand("35,90,50")
Hue_Color_Kueche_links.sendCommand("35,90,50")
Hue_Color_Kueche_rechts.sendCommand("35,90,50")
Hue_Toole_Leselampe.sendCommand(OFF)
}
}
end
Yesterday I switched the TV off at 22.42 o’clock: 2020-01-05 22:42:59.262 [vent.ItemStateChangedEvent] - SamsungTV_Power changed from ON to OFF
After round about 2 minutes, the state of the TV changed automatically again to on: 2020-01-05 22:44:44.329 [vent.ItemStateChangedEvent] - Samsung_Power changed from OFF to ON
So the lights will be switched again on, and will stay on till the next morning.
The TV is a Samsung and connected via LAN cable to the network.
Somebody with an similar problem? How do you resolved it?