Borrowing this idea from Tom McGuinness.
This is the ultimate setup to allow features of a smart bulb like changing colours, Zigbee/Matter repeater and still retain the functional use of your light switch.
The concept is to disconnect the bulb from the switch. When the light switch is used, it does not physically cut or reconnect power. Instead, it the relay treats it as a sensor like button to say someone (or something) has pressed the light switch.
In Shelly, go the device setting > Input/output settings > Switch > Set Shelly device to be in “Detached” switch mode.
In Home Assistant, the sensor is named input for the switch.
The automation looks something like this in Home Assistant:
- id: "1700940016581"
alias: "Porch: Light Switch"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.porch_main_light_input
condition: []
action:
- service: light.toggle
data: {}
target:
entity_id: light.porch
mode: single
I would encourage you to watch Tom’s video Shelly Relays And Smart Lights – My lightbulb moment!