It’s very easy. You have to change button type
to detached switch
and power on default mode
to on
in Shelly configuration.
In HA you have to move your smart bulb entity to the frontend (to turn on/of the light manually) and add automation:
- id: smart_bulb_toggle
alias: 'Smart Bulb Toggle'
trigger:
- platform: state
entity_id: binary_sensor.shelly_input_entity
from: 'off'
to: 'on'
action:
service: light.toggle
entity_id: light.your_smart_bulb_entity
This is for momentary switch. If you have non-momentary switch:
- id: smart_bulb_turn_on
alias: 'Smart Bulb Turn On'
trigger:
- platform: state
entity_id: binary_sensor.shelly_input_entity
from: 'off'
to: 'on'
action:
service: light.turn_on
entity_id: light.your_smart_bulb_entity
- id: smart_bulb_turn_off
alias: 'Smart Bulb Turn Off'
trigger:
- platform: state
entity_id: binary_sensor.shelly_input_entity
from: 'on'
to: 'off'
action:
service: light.turn_off
entity_id: light.your_smart_bulb_entity
Of course you have to add binary_sensor.shelly_input to HA configuration. If you use my Shellies Discovery script it is already in HA.