#How are you using smart switches & motion sensors together?

1 messages · Page 1 of 1 (latest)

slow bolt
#

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!

hoary cosmos
#

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

slow bolt
#

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

hazy swift
#

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.

slow bolt
#

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

cunning ibex
#

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.

cunning ibex
#

If you have multiple areas with same automation, cerating a blueprint is a good strategy

slow bolt
#

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?

cunning ibex
#

But wouldn't you turn lights back again on when motion is detected, but only if lights are off?

hazy swift
cunning ibex
hazy swift
#

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.

slow bolt
#

Ahh, I think this is what I’ve been trying to do. Thanks! I’ll give this a spin

wary lichen
#

did you mean smart watch tracking? im doing that using esphome and ble tracking

modest galleon
cunning ibex
#

Take Fenix 8.

modest galleon
#

OOF! 1.3k CAD 😛

#

It's a bit above the Watch 7 at 250 let's say 😅

wary lichen
light quiver
crisp zenith
wary lichen
hazy swift
#

@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 😄

obtuse quiver
#

just a showcase haha no need to copy my bad code

obtuse quiver
#

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```