How to switch tradfri bulbs with dumb light switches? Sonoff/Shelly switch with Tasmota the solution?

It’s very simple. The relay inside Sonoff actually controls the mains to the bulb. So you would have a switch inside the app that turns the relay on or off. If it’s off, no power going to the bulb.

It seems a little complicated but it’s a win/win situation for using both the power switch and having a smart lamp.

I’m gonna overanalyse things now, so be prepared!
So, when choosing lights, you have 2 options:
i) Having dumb bulbs with a smart switch
ii) Having smart bulbs and disabling the switch
The switch is the on/off switch you already have for turning the lights on or off. With the first option, you can turn the bulb with a flick (or rather, touch) of the switch and also control it from hass. Advantage is you don’t have to open the app everytime you want to turn the light on or off, and to be honest, it “feels” better to have a switch. For us that setup the home it may be easy, but for a guest it’s frustrating to search for a switch that isn’t there! Greatest disadvantage is that the bulb is dumb. No brightness, no colors. And going with a smart bulb along with the smart switch is even worse. When flicking the switch, the bulb gets power, starts its firmware, searches for the wifi(or the zigbee coordinator), then IF the command is retained, turns on. BIG delay.
With the second option, you have the bulbs that can do brightness and colors(depending on the bulb), but no way to physically control them. You flick the dumb switch, you cut the power to the bulb. You flick the switch again, you give power to the bulb but you didn’t command the bulb to do anything.

Best option is to combine the 2 worlds with a twist. You install a smart bulb. You install a smart switch. But now you still cut the power to the bulb when flicking the switch. That’s where Tasmota firmware comes to play. Tasmota has an option where it “disconnects” the smart switchs’ button from it’s relay. So when you press the switch, it only sends an update to Hass that the switch was pressed and nothing else.
So, you program hass to command the smart bulb directly when pressing the switch (turn on or off, change color etc), rather than cutting the power.
But you also have relays inside the smart switch that are presented to hass. It depends on the number of buttons, so either 1,2 or 3. These relays cut and give power directly to the bulbs(mains power). So on your dashboard, you add these relays so when a bulb is burnt or you want to move it and play safe, go on the dashboard, flick the switch to cut the bulbs mains and do your job. When done, flick the switch from hass and the bulb has power again.

With this solution, the ONLY disadvantage (apart from programming the 2 to do what you want), is that the buttons on the Sonoff depend on Hass. If something happened (Hass got stuck or you lost power and came back) you would have to wait for hass to come up to control the lights from the Sonoff. But I guess if something like that happened, you would have larger problems than this one.

2 Likes

I was dealing with the same question recently and meanwhile found a solution, which completely meets my requirements (including WAF :wink: ).

  • single push --> toggle Group of IKEA Tradfri
  • double push --> electrically disconnect Tradfri lamps via shelly1 relais
  • long push --> dim Tradfri lights

My solution was inspired by this article, although I am not using ControllerX, but standard Tasmota MQTT integration instead.

I am using a Shelly1 with Tasmota 9.2.0 connected to a normal PushButton with following config

Switchmode 11 #Set switch to pushbutton with dimmer mode incl. double press feature
SetOption1 0 #Set button multipress mode to --> allow all button actions (default)
SetOption11 0 #Swap button single and double press functionality --> disabled (default)
SetOption19 0 #Set Home Assistant discovery protocol --> use Tasmota integration (default)
SetOption32 20 #Number of 0.1 seconds to hold button before sending HOLD action message.
SetOption73 1 #Detach buttons from relays and send multi-press and hold MQTT messages instead --> enabled
SetOption114 1 #Detach switches from relays and send MQTT messages instead --> enabled

# Create Rule toggle PowerOutput on double press
Rule1 ""
Rule1
  ON switch1#state=8 DO power1 2 ENDON
Rule1 1
# Create Rule toggle PowerOutput on single press (deactivated as long as MQTT is available)
Rule2 ""
Rule2
  ON switch1#state=2 DO power1 2 ENDON
Rule3 ""
# Create Rule to de-/activate Rule2 based on MQTT availibility
Rule3
  on mqtt#disconnected do rule2 1 endon
  on mqtt#connected do rule2 0 endon
Rule3 1

On Home-Assistant side configuration is straight forward.
I have created a helper Toggle (input_boolean) to switch between DimUP and DimDOWN.
4 simple automations look like this

- id: '1616864334966'
  alias: Light_Kuechentisch_TOGGLE
  description: ''
  trigger:
  - platform: mqtt
    topic: stat/Shelly1_1/RESULT
    payload: '{"Switch1":{"Action":"TOGGLE"}}'
  condition: []
  action:
  - type: turn_on
    device_id: 080e54fe071017dc47f569d206a15226
    entity_id: switch.shelly1_1
    domain: switch
  - service: light.toggle
    data: {}
    entity_id: light.licht_kuechentisch
  mode: single
- id: '1617466800291'
  alias: Light_Kuechentisch_DimDirection
  description: ''
  trigger:
  - platform: mqtt
    topic: stat/Shelly1_1/RESULT
    payload: '{"Switch1":{"Action":"POWER_RELEASE"}}'
  condition: []
  action:
  - service: input_boolean.toggle
    data: {}
    entity_id: input_boolean.light_kuechentisch_dimdirectionup
  mode: single
- id: '1617466317326'
  alias: Light_Kuechentisch_DimDown
  description: ''
  trigger:
  - platform: mqtt
    topic: stat/Shelly1_1/RESULT
    payload: '{"Switch1":{"Action":"POWER_INCREMENT"}}'
  condition:
  - condition: state
    entity_id: input_boolean.light_kuechentisch_dimdirectionup
    state: 'off'
  action:
  - service: light.turn_on
    data:
      brightness_step_pct: -10
    entity_id: light.licht_kuechentisch
  mode: single
- id: '1617467057277'
  alias: Light_Kuechentisch_DimUp
  description: ''
  trigger:
  - platform: mqtt
    topic: stat/Shelly1_1/RESULT
    payload: '{"Switch1":{"Action":"POWER_INCREMENT"}}'
  condition:
  - condition: state
    entity_id: input_boolean.light_kuechentisch_dimdirectionup
    state: 'on'
  action:
  - service: light.turn_on
    data:
      brightness_step_pct: 10
    entity_id: light.licht_kuechentisch
  mode: single
1 Like

Nice solution, I knew this was possible but never tried it, but I’am always wondering, how is the dimming?

Is it like “smooth” dimming? Just like with the original ZigBee remotes and Tradfri bulbs combination? or just like the Shelly Dimmer and a directly connected light bulb? Do you maybe have a video of this setup?

I’m really curious, so thank you in advance. Would not be so robust as Shelly Dimmer, but I already have Shelly everywhere and some smart bulbs. Would be a nice solution.

Rick

Thanks Rick.

To be honest, dimming is not as smooth as I am used too from professional solutions. I don’t have a zigbee remote as reference, but I would expect better user experience.
There is ~1sec delay from holding button to start dimming and again ~1sec between each dim-step

In everydays life it does not bother me too much. 90% of our use case is, to switch it on and off. Dimming is more the exceptional case.

I can try to capture this on video.

Phil

Thanks for the explanation, 1 sec seems indeed “not so smooth” to me.

I agree the use case is on/off and not dimming all the time :slight_smile: Still have to try the setup myself when I have time.

I’m still interested in a video :stuck_out_tongue: gives a better feeling to the actual workings.

Thank you again

Rick