I have some smart switches for lights around the house, and I also have motion/presence sensors around to control lights. Most of the time I don’t use the switches because of the motion sensors, but sometimes I (or more often my partner) want to just use the switches and not have the motion sensors control things (one such scenario is when taking a nap). I’m just curious how others are using their smart switches and motion sensors together and especially creating ways to easily hand manual control back to the switches when desired. Thanks!
#How are you using smart switches & motion sensors together?
1 messages · Page 1 of 1 (latest)
Hi, I use Sonoff ZigBee devices (later I'll put the model) that can control a light via HA but with the physical button too
Sonoff ZigBee Minil2 and MiniR2
One needs neutral wire, the other don't
Yeah I have similar light switches, and they’re great. I’m not looking for hardware to address my scenario, I’m looking for how people have their automations for smart switches + motion sensors configured
Then I will set a helper (inut_boolean) when I turn it on via motion. And only turn it off via motion if this helper is set. That way if you manually turn it on it's an override.
So is it motion detected -> boolean & lights turned on -> motion no longer detected -> Boolean & lights turned off? I’m not sure I’m fully understanding
Normally when motion is detected, if light is off, you turn it on and set the helper. When motion is not detected anymore, light goes off but only if the helper is on.
If light is on when motion happens, then don't do anything, I guess it was set by user
Something like that, no?
if motion.detected():
if not light.is_on():
helper.turn_on()
light.turn_on()
else:
pass
# Light is already ON
# nothing to do here
else:
if helper.is_on():
light.turn_off()
helper.turn_off()
when the light will already be on, set by either switch or from the dashboard, motion won't turn it on again and thus turn-off helper won't be set. This will prevent light going off when motion is not detected anymore.
If you have multiple areas with same automation, cerating a blueprint is a good strategy
I think this is not quite what I’m imagining. So here’s a scenario. Say I walk into a room and the lights turn on because motion detected, however I actually feel like sitting in the dark and run the lights off with the switch. Right now I’m really brute forcing it by going into the app and disabling the automation because I don’t want the lights to turn on when it detects motion again because I’m not sitting perfectly still.
I’m wondering if maybe what I’m imagining is some sort of logic where, if the lights turn on via motion sensor and then they are turned off by a light switch, maybe that activates a helper that says to my HA “hey he doesn’t want the motion sensors in control for right now.” I think one stumbling block is I’m not sure what would be the best way to turn that helper back off. Does it stay on until I manually turn the lights on with the switch? Do I put it on a timer?
But wouldn't you turn lights back again on when motion is detected, but only if lights are off?
Sort of, but more:
motion detected AND boolean off AND light is off->Turn on boolean & lights -> motion no longer detected AND boolean on -> Turn off boolean & lights
This way, when I turn them on manually they will not go out automatically (or at least nog by "no motion "
this example does not check for a fact if lights are currently on. It will turn the boolean even if light is on already, when motion is detected
You are right, have that as well of course. Edit 😄
But you can also do it the other way around. Set a helper when motion turned it off. Now you know when it's turned off manually. And you can just do
Motion detected AND bool on => turn on light AND turn bool off, motion cleared AND light on => turn off light AND turn on boolean.
Ahh, I think this is what I’ve been trying to do. Thanks! I’ll give this a spin
did you mean smart watch tracking? im doing that using esphome and ble tracking
May I ask which watches you use?
I have a Samsung watch 4 whose battery is dying ( 5 hours of usage max) and looking to replace!
Take Fenix 8.
I used to use Watch 4, now im using Apple Watch 10. Battery was more than 5 hours as far as i remember, but having to turn ble on from ha companion app definitely took a hit to the battery
That's my exact setup, strongly recommend.
I stop the automation by using the phone on charge entity - so if I want a nap I put my phone on the wireless charger, the lights go off and a helper is the override for the movement automation
I was just about to make this automation today lol
https://r2.fivemanage.com/image/TAWQeSYSf2ik.png
this basically ?
@obtuse quiver Those are just input_booleans yes. You can also make them in the UI. But it is what you do with them where the magic is. By themselves they do nothing.
And please, never ever post code as image again 😄
just a showcase haha no need to copy my bad code
where can i do that tho?
just a helper?
input_boolean:
# Kalender Erinnerung
kalender_erinnerung_aktiv:
name: Kalender Erinnerung aktiv
initial: false
icon: mdi:calendar-alert
# --------------------------------------------------------------
# Lichtschalter Overrides
# --------------------------------------------------------------
override_kueche:
name: Override Küche
icon: mdi:lightbulb-auto
override_ankleidezimmer:
name: Override Ankleidezimmer
icon: mdi:lightbulb-auto```