Basement lights on with motion but need some help


#1

1) Give a description of the problem
I have my basement lights turn on with motion but I want this action to stop when I Ask Alexa to put the lights into a scene. But my lights keep going back to what is set in this piston when there is motion again. In my piston I have it set to run in modes leaving out “Movie” mode which I thought would work except how do I get Alexa to change the mode?

2) What is the expected behavior?
For the lights to stay on and at the setting that I asked Alexa to set them at.

3) What is happening/not happening?
Lights keep coming on to the setting in the piston.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Sorry, I don’t have your answer but how do you “when true”?


#3

Enable it in the webCoRE settings.


#4

Thanks - can you more specific?
I just checked and I do not see anything relating to it.

Nevermind, I got it. Thank you


#5

If I understand it correctly, when you talk to Alexa you are executing a routine which calls a scene, correct? Here’s the way I would hack that:

  1. Log into the IDE and create a simulated switch.
  2. Create a piston such that when the simulated switch is on, the mode is changed to “movie”
  3. Add turning on the simulated switch to the Alexa routine.

If you don’t want to mess about with modes, you can just have your basement lights piston check the state of the simulated switch. Don’t forget to give yourself a way to turn the simulated switch back off to resume normal operation.
But I wouldn’t use a mode if I didn’t have to because they are often changed by another piston, using either presence or time. So you might be in the middle of your movie and have it switch modes - correctly, but unintentionally. You don’t want to have to figure out how to disable all your other pistons while in movie mode and then reenable afterwards.


#6

I just saw in another thread that it is possible to subscribe to routines, so that might be another way to do this without creating the virtual switch.


#7

So create a routine for Movie Time that would set the lights and change Mode to Movie? Can a routine set a hues scenes?


#8

A switch is also a good option.


#9

I have to have someway to keep the piston set off by motion from triggering. So modes or a switch. But yes, I need a way to put the mode or switch back. I can ask Alexa to change the mode of turn off the switch I guess.


#10

Yes, this happened to me the other day when my daughter came home and the mode changed to “Home” and the lights all came on bright while we were watching TV. So what is the better way to do it?


#11

So this is what I have done with the piston. I have setup a virtual switch instead of setting it by Location Mode. So I have also setup a Routine in Alexa app that when I say “Alexa, let’s watch TV” it will turn on the Virtual Switch and then turn on a Hues Scene. This way if the virtual switch is “on” the motion detection will not keep turning the lights back on. Then if we say “Alexa turn on the lights” it will turn the VS off and set the lights to another Hues Scene. If someone doesn’t “turn the lights on” after watching TV then the piston will check if the VS is “on” and BasementKodi is “stopped” and then it will turn the virtual switch “off”. I am hoping this will work.


#12

Sorry for not getting back to you sooner, but Happy New Year! :smiley:
That was very much what I was envisioning. I know I sound like a parrot always squawking “simulated switch!” but what you’ve described sounds like it should work and is user friendly (i.e. not overly complicated to use). Have you had a chance to test this?

One question: What is ‘keypad 1’? That must essentially be the same as “MS1, MS2, or MS3 is not active” grouped together as room, yes? I don’t have any motion sensors (yet), so I’m only familiar with them on a theoretical level.

I had no idea Kodi integration was possible… new year, new pistons, here I come.


#13

Sorry for the late reply, I thought I had sent a reply earlier from my phone. I guess I didn’t hit “reply”. Happy New Year! Keypad 1 is actually referring to the Room “Basement” from Room Manager app. This works but I discovered that it will only work if someone is watching Kodi. It doesn’t work if we are watching anything on Roku or cable. I am wondering how to solve this problem? Any ideas?


#14

Yes, I see how watching cable or Roku is always going to turn off Switch 5 in 60 seconds and turn the lights back on. Line 43 is clearly only concerned with the status of BasementKodi, so you’d need DTHs for Roku and cable in order to add two additional ANDs there. It looks like there’s some Roku stuff out there, but it also looks like a lot of work and won’t do squat with your cable box. Maybe if you had a cable-card in a PC, but again, the long way 'round. Any chance you have a Harmony w/Hub (or other ST-aware remote) that controls everything in the basement? If so, I imagine it’s possible to grab the play/pause/stop button presses that are common to Kodi, Roku, and cable (as well as any future devices you might add down there). So rather than directly reading the state of your 3 devices, the way you’re currently reading the state of Kodi, you’d infer the state of watching/not-watching from the last button press. Follow?

But if you don’t have a Harmony, or even if you do, maybe it’s better to just disable the motion sensors when you tell Alexa that you’re watching TV and re-enable them when you tell her to go back to normal. Alexa can’t do that as part of the routine, so you need another piston which reads Switch 5 and disables them. It’s probably better to reverse the logic too, so that on = enabled & off = disabled. Yes, it’s possible to add that condition to this piston, but it just seems easier to me to pull it out into its own piston. Switch 5 is therefore no longer needed in this piston and all references, including lines 41-50, should be removed.


#15

Funny how things get real complicated fast! The only reason that I incorporated “Kodi” was incase people watching TV didn’t give the Alexa command to turn the lights back on which would also set the switch to “Off” which would enable the motion detectors again. I thought about putting a timer in but there is no guarantee that someone wouldn’t be watching tv still (you know how young adults can stay up late:wink:) I am not sure that this can be done. Then what will happen is the lights will stay on in the movie scene.


#16

True, a lot of things depend on you doing them a certain way. So, let’s embed magnets in your whole family and put sensors in the sofa …


#17

Now your talking!:grin:


#18

I might have a solution to this by using Room Manager. I have to find out about some of the settings in the app.