Rule for watching a movie with lighting

Hi All,

Does anyone use some kind of rule to prevent lightings turning on due to motion when watching a movie?

When we watch a movie, we turn all the lights off but the motion sensor triggers if you get up to do something quickly and turns the lights on.

Im thinking perhaps I can monitor the state of a device, like my Audio Receiver & my TV (ie TV is pingable and the Receiver is state ON)

Be interested to hear your ideas for something you may have similiar

Cheers!

I’ve got several lighting scenes, one of them is for watching TV, that in your case would inactivate your motion triggers.
I’m also querying my receiver via HTTP binding so I changed to that scene automatically when the receiver becomes active.

Hi Markus can you show us what you’ve done with regards to the Watching TV scene?

Thanks!

don’t know what you mean. Use a virtual item “scene” of number type, manually or automatically set it to ‘5’ or whatever number you assign to your TV scene, then in all rules to trigger on motion detectors, insert an if statement and only change lights if scene != 5.
My rules are way more complex so I don’t show them.

@dastrix80

I created a movie mode item when this is on none of my lighting rules can run

You manually turn on movie mode it turns lights off and blocks any lighting changes until movie mode is disabled

I set mine too turn lights off and they come back on if you pause or stop what your watching you could make them do anything (my movie mode moniters a kodi machine for play pause and stop)

Movie mode on turns lights off blocks changes

Movie mode paused brings lights back on in a dimmed state still blocks changes as movie mode still enabled

Movie mode stop disables movie mode changes lights too normal and allows all changes again

My lighting rules have an if statement if movie mode is off change lights ect of on do nothing

My setup is slightly different than yours my lighting throughout the house is also triggerd by motion but the living room sensor where we watch movies is only for motion it does not turn the lights on or off

My living room lighing is ran by rules at certain times of the day do this too a light

Rule "lights" 
When 
Item motion changed to ON
Then
If (moviemode.state == OFF) {
    //DO LIGHTS STUFF 
} 
End

Or you could do what you were stating replace the if moviemode.state with receiver.state or tv.state

Thanks @Sharpy do you know how it would be possible to disable the motion sensor on the Fibaro Motion sensor zwave unit? by disable as in ignore any events from it.

@dastrix80

Please post your rule for your sensor the part where it detects motion and turns on lights

You can’t (at least not dynamically), you need to do it in the rule.

Certainly


var Timer Eye1_Timer = null
val Integer Eye1_TimeOut = 2



rule "FibaroEye1 motion detection turns ON Living Room Lights when Lux is less than 20, with a 2 Minute Inactivity Timer"
when
        Item FibaroEye1Alarm changed to ON
then
        if (FibaroEye1Lux.state < 20) {
                if (Eye1_Timer !== null) {
                        LivingRoomDim1.sendCommand("5")
                        logInfo("FibaroEye1Motion","Eye1 Timer rescheduled for " + Eye1_TimeOut + " minutes")
                        Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
                } else {
                        logInfo("FibaroEye1Motion", "Eye1 Motion Detected! Turning ON Living Room Lights")
                        LivingRoomDim1.sendCommand("5")
                        logInfo("FibaroEye1Motion","Eye1 Timer created with " + Eye1_TimeOut + " minutes")
                        Eye1_Timer = createTimer(now.plusMinutes(Eye1_TimeOut))
                        [ |
                                if (FibaroEye1Alarm.state ==  ON) {
                                        logInfo("FibaroEye1Motion","Eye1 Timer triggered, but rescheduled again for " + Eye1_TimeOut + " minutes")
                                        Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
                                } else {
                                        logInfo("FibaroEye1Motion", "Eye1 No Motion Detected! Turning OFF Living Room Lights")
                                        LivingRoomSw1.sendCommand("OFF")
                                        Eye1_Timer = null
                                }
                        ]
                }
        }
end

Ok I’m not 100% sure your rules are slightly more advanced than mine

This is what turns your lights on when motion is detected?

but creating the item moviemode that you can turn on from basicui or habpannel when you are watching a movie and add an if moviemode.state == OFF too this section it will stop the lights from turning on when movie mode is on

Item

Switch Moviemode "Movie Mode" 

Rule

If (moviemode.state == OFF ) {
LivingRoomDim1.sendCommand("5")
} 
1 Like

Yep, added the state check for the Moviemode. Ill give it a whirl.

1 Like

var Timer Eye1_Timer = null
val Integer Eye1_TimeOut = 2



rule "FibaroEye1 motion detection turns ON Living Room Lights when Lux is less than 20, with a 2 Minute Inactivity Timer"
when
        Item FibaroEye1Alarm changed to ON
then
        if (FibaroEye1Lux.state < 20 && Scene_Watch_Netflix == OFF) {
                if (Eye1_Timer !== null) {
                        LivingRoomDim1.sendCommand("5")
                        logInfo("FibaroEye1Motion","Eye1 Timer rescheduled for " + Eye1_TimeOut + " minutes")
                        Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
                } else {
                        logInfo("FibaroEye1Motion", "Eye1 Motion Detected! Turning ON Living Room Lights")
                        LivingRoomDim1.sendCommand("5")
                        logInfo("FibaroEye1Motion","Eye1 Timer created with " + Eye1_TimeOut + " minutes")
                        Eye1_Timer = createTimer(now.plusMinutes(Eye1_TimeOut))
                        [ |
                                if (FibaroEye1Alarm.state ==  ON) {
                                        logInfo("FibaroEye1Motion","Eye1 Timer triggered, but rescheduled again for " + Eye1_TimeOut + " minutes")
                                        Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
                                } else {
                                        logInfo("FibaroEye1Motion", "Eye1 No Motion Detected! Turning OFF Living Room Lights")
                                        LivingRoomSw1.sendCommand("OFF")
                                        Eye1_Timer = null
                                }
                        ]
                }
        }
end

Does it work as expected?

You have used scene watch netflix?

Looks OK too me in not sure tho I haven’t learned variables and all the timer null stuff its something I’m planning on learning soon

1 Like

Im still making some changes to the Scene, basically I’m having issues with TV presense detection which is causing the rule to not execute the Input button in my rule.

I think the way you have changed your rule adding watch netflix nothing will work if watch netflix is on you might need too place it only where it turns lights on so the rest of the rule can still run

If lux is above 20 or netflix is on none of your rule will work?

I think you should also swap it from && to ||

|| means or

If Lux is above 20, the rule wont trigger, both items need to be true for the rule to trigger. IE: Lux is below 20 and the Scene is Off.

I’m on a mobile so also struggling too properly see your rule

Yes that sound about right I’m not 100% sure I will look again when I get on a computer :wink: keep me informed

no worries :wink:

1 Like

@dastrix80

Did you manage too get this working

Still working on another rule :wink: