Larder (Pantry) light automation with Zigbee Smart Life / Tuya PIR sensor and wifi light switch

OK, so we have a cold, dark and dank north-facing fancy pantry and either your hands are full when you’re going in or coming out so turning on the light switch inside is inconvenient. I’ve already got a Zigbee temperature sensor to check it really is cold enough to store food safely, running into a Tuya Zigbee 3.0 hub (can’t recommend this tech enough, it’s battery powered and super-quick to get the data back to Apilio) but I wanted to automate the lighting, to make it hands-free.

So I bought a super-cute Zigbee PIR sensor - from Sonoff by the way but which also works with the Tuya Zigbee hub - and added an Apilio Trigger Condition (called larder_movement) to evaluate a Logicblock (larder_light_on) and then run two Tuya positive actions when the PIR sensor triggers the evaluation positively. The first Tuya action turns on the larder light switch and the second Tuya action, with a 2 minute delay, turns off the light switch. I added the delay to match the time-out of the PIR sensor so the light doesn’t go off but not again again within two minutes.

I just couldn’t resist this I’m afraid so here’s a quick video to show just how quickly the light comes on after the PIR sensor triggers - it is amazing (well I think so anyhow as the data’s going via Zigbee to hub then internet to Smart Life and via integration across to Apilio then back to Smart Life to turn on the light switch).

It feels a little wasteful to have the light switch going on during the day and so I’ve found a light level sensor to use as a daytime condition as it’s sometimes too dark in there to see during the day BUT in the meantime I will add a sunrise/sunset condition with a 1hr offset (i.e. don’t turn on light between one-hour-after-sunrise and one-hour-before-sunset) to stop the light coming on when there’s enough light to see inside.


Amazing, @DanT! So good to see it in action!! It is indeed super fast :sunglasses: :rocket:


Great use case! You could make it blink twice when you enter and the temperature has been over a threshold for 2 days to let you know to eat the fruit before you go after the chocolate :slightly_smiling_face: