Triggering something when a zigbee device turns on

Is there a way to trigger a rule when Zigbee device (re)joins a network?

Let me explain - I have a bathroom light that I connected to a generic zigbee switch. Generic zigbee switch is connected to the in-wall wired switch. I have a rule that triggers the light based on the motion sensor. However, the zigbee switxh doesn't put the output to on when it itself is turned on and I would like to be able to turn the light on even when motion sensor is disabled (e.g. battery is dead). Is there some way I could achieve this?

What, exactly, are you using where a switch (or a second switch connected to...another switch? Are you using a ThirdReality-type cover here? Or some sort of in-wall module?) can't turn on the lights without a sensor?

Whoa, that’s an unusual description of what you have and what your after but I think you’re trying to describe how my walk in wardrobe works.

I have a regular wall switch wired to a Sonoff Mini and a Motion sensor in the wardrobe.
Either flipping the wall switch OR motion, turns on the light.
I choose to use the Sonoff Mini because it was cheap and had the switch inputs on it. :blush:

But to answer your question, probably BUT it is not a good thing to do.

you generally want an in wall micro for this, the existing physical switch then controls this device in addition to the radio.

This is also going to screw up your mesh. You also won't be able to turn on the light from hubitat unitl the wall switch is switched on. So, why bother having the zigbee switch at all? Wouldn't it just be easier to have the zigbee switch and take out the dumb switch? I don't understand that use-case for having two.

I think there was a bit of confusion because of convoluted terminology - when I say 'zigbee switch' I mean actual electrical switch, but without the rocker (seen @ https://images-na.ssl-images-amazon.com/images/I/51U2juXDSdL.AC_SY450.jpg)

However, all this is moot - since I erroneously thought that when the plain electrical switch (with the rocker) is off, it resets the zigbee switch and it doesn't turn back on when the plain switch is turned on. However I was mistaken, and the zigbee switch remembers its state and acts accordiongly when it is powered on.

Thanks to all you guys on the input though :slight_smile: