Need a little help with setting up a rule for lights on my basement stairs.
I bought a handful of Iris motion detectors, so I have a few to play with if necessary.
I'd like to set up a motion rule for turning on the lights on the stairs that "respects" someone watching a movie.
Door at the top of the stairs to the basement has contact sensors. Basement bathroom door is on "far side" of the stairs. {See pic}. Stairs lights are on a zwave switch.
I'd like the stairs lights to come on when the basement door is opened, but not of there's a movie being played. Pretty sure there's a plex media connection that I can use to know if something is being played.
And I'd like the stairs lights to go on if someone goes to walk up the stairs, but not if they walk past the stairs to go to the bathroom.
Looking for some suggestions on where would I want to place and aim the motion sensors? And what conditions / triggers should I use?
You could ask @mike.maxwell to share with you what he did but he added some sort tube over the sensor so that he could put it on a step if I remember correctly anyhow he may share. I try to locate it over at smartthing forum but fail to do so.
On ST, there was the Plex connector. I believe it was in the process of being migrated over, but never got fully completed.
With that said, I went the NodeJS/Maker API route. I have a NodeJS script (which I adapted from webhooks-home-automation/index.js at master · plexinc/webhooks-home-automation · GitHub) that toggles one of three virtual switches in HE via the Maker API. Then, I have RM rules that monitor those switches. The reason I went this way instead of local http endpoints in RM is that they don't support multi-part form posting, and that's what Plex sends out over its webhook calls.
So, simple-ish setup:
Create a NodeJS app and modify from the link I posted above.
Take note of the URL needed to run said app.
Create a webhook in Plex (you'll need to be a Plex Pass owner to do that) and point it to the above URL.
Create 3 virtual switches in HE: Plex Play Switch, Plex Pause Switch, and Plex Stopped Switch.
Create a rule (or rules) that trigger off the switches turning on or off and perform your actions.
I did almost this exact thing. My stairs are lit, but they don't interfere with movie watching. I use harmony, so if any of those harmony switches are on, the lighting fires or doesn't fire according to that status. I have a sensor at the top and bottom of the steps. If you're watching a movie, you may be able to position the upper sensor to read the movement instead of the bottom. Looks like one could go up a few steps before lighting would be really necessary. Or you could place a sensor under the rail facing more up and across the steps so that it's blind to movement past the bottom of the steps to go to the next room.
How about instead of Plex indicating movie watching, just detect if the TV is on, either with a smart tv App like the Roku one, or using a power measuring smart plug. Or maybe TV being on is too general for your not wanting the light to go on.
I have stairs that are open so I used 2 small iris motion sensors pointed down slightly to trigger when someone gets to about the second step. I have a slight delay in that the lights come on by about the 3 step up and 2 step coming down. Had to play with the angles to not get false triggers from people walking by.
Ah, yes, the old Plex webhook. Totally forgot about that. Easy way to trigger a virtual "plex is playing" switch to use for my conditions and triggers.
I love mine because it's got a movie theater effect! Plex comes on lights dim. Plex turns off. Lights up to 100%. Ready to go! Very nostalgic. This is what keeps the lights from turning off in the living room also when movement is minimal. That's a condition of "off" as well.