Control Smart Can Lights With Wall Switch

I recently replaced the existing can lights in my kitchen with Lumary smart cans. I can control them via Home Assistant using the Local Tuya integration and that piece works well. What I’ve struggled with is how to still control the lights via the wall switch but not have the cans be offline if the wall switch is in the off position.

My initial attempt was to use a Shelly 1L I had lying around and using it as a detached switch. That let me program automations to the light switch to turn on and off and still do timed automations like turning on the night light mode when it gets dark since the cans are still getting power when the switch is off.

The problem I’m seeing is that once a week or so the Shelly goes offline and I have to flip the breaker switch to get it to come back online. When the Shelly is offline my automations no longer works and so the lights won’t come on. I’m not sure if this is a problem with the Shelly or with my wiring (I’ve never used a Shelly with a neutral wire before).

I’m wondering if anyone has come up with a more elegant solution for controlling smart bulbs with a light switch.

Assuming you have the shelly running tasmota
You can setup a rule that restarts the switch if wifi is disconnected, something like wifi disconnected >60 seconds then do a reboot.

For esphome, you could refer to this config that toggles the relay if wifi/router is offline

For me, i would just use device group with all my lights and switch, i could dim/change color/toggle the lights without relying on ha automation

Thank you. I’ll take a look at auto-restarting the Shelly this week.

For the device group are you using a Tuya switch and then grouping it in the Tuya app? Or are you grouping them in HA?

It’s tasmota device group, doesn’t rely on HA and it just works as long as they’re connected to wifi

Thanks for the advice. For now I made a few tweaks to the Shelly settings and so far it’s been stable. If it continues to have issues I plan to look at the Inovelli switches with smart bulb mode.