Dimmed Light automation

Hi guys, Im new here, sorry if posting this tread in wrong place. Need your assistance with my first automation.

I have mounted 6 tradfri led spotlights in my bedroom. I would like to switch one of the lights, dimmed to lowest setting without switching on rest of the lights. Reason is that I want to use this light to dress up in the dark without waking up my wife.

In Ireland we don’t have neutral in light switches, on live wire. To switch live, feeding all 6 spots I am using sonoff mini switch.

Problem I have is that first I have to switch power using sonoff switch, only then when leds have power on I can switch 5 them off them one by one and dim remaining light off. This takes couple of seconds in which lights comes on at full intensity and this wakes up my wife.

Is this even possible, what I am doing wrong?

Take out the sonoff switch, and only control the zigbee state :wink:

Reason, zigbee light status is unknown after powering up and should be operated once before status is 100% up to date (mine always turn on fully at first power, while HA still says off).

Further more, powered zigbee devices are used as a repeater node (router) in the zigbee mesh, so other zigbee devices might loose connection when nodes are powered down.

A mesh could look like this:

That’s certainly an option, however I need physical switch, which is currently wired in to sonoff

It seems like you have too few components to do that properly if everything relies on the single sonoff. Are you using a native sonoff or did you flash it with ESPHome? If you flash it then you might be able to take better control of it and have it turn on at a lower power during certain hours (or based on certain helper values - i.e., I have a sleep mode helper that does what you are trying to do to keep my wife from waking me up).

Why ?

I also use physical swithes, but they are either used by shelly’s, or I use zigbee switches
(which cannot be used as router, they are end-points, but that is besides the point here)

If you want to continue using the physical switch, Ikea Trådfri bulbs can be programmed to remain off when first powered up. You’ll need to have either the Trådfri or Dirigera gateway, or a Zigbee dongle in the HA box to have the controls for that. Here’s what the latter (using ZHA) looks like in Home Assistant (device info).

Practically, I would expect you’ll find it more convenient to leave the physical switch on all the time and control the lights with an automation or a wireless remote. You could have two in the bedroom - one dimmer for the dress-up light, and another for all of the rest. As they’re wireless, you can place them where-ever they’d be conveniently accessible. Or even have a third one, so that you can control the master lights from both the doorway and bedside.

This can also be done with Zigbee2MQTT:

And you could also approach it in a different way…
Bypass the power on the Sonoff, but leave it connected to the mains.
In that way the Zigbee lights will always be powered.

You can then use the Sonof switch as a ‘detached switch’, so basically it won’t switch anything.
But the switch on/off signals will be detected in HA and can then be used as a trigger to turn on the lights :wink:

description: ""
mode: single
  - platform: state
      - switch.bathroom_lights
    from: "on"
    to: "off"
    id: "off"
  - platform: state
      - switch.bathroom_lights
    from: "off"
    to: "on"
    id: "on"
condition: []
  - service: light.turn_{{ trigger.id }}
      entity_id: light.somelightgroup

It would be a waste of resources, as the sonoff will be degraded to a physical switch only.
I would still recommend to replace it by a zigbee switch :stuck_out_tongue:

I’ve done exactly this in my bedroom closet and there is no way to avoid the bright flash if you want the physical switch to be a fail-safe mode of operating them. (That is why I have z-wave physical switches on all my lights even though the bulbs are all IKEA zigbee.)

I ended up needing a separate zigbee lamp (I used IKEA’s closet light strips) and a motion sensor. When the bedroom lights are off and it is dark outside, the motion sensor turns on the closet lights strips at 5%, otherwise it turns on the ceiling light switch and the closet strip at 100%.

There is one other potential problem with what you are doing: when you turn off the wall switch you will have 6 zigbee devices go off the network. If a lot of other devices are using them to communicate, those will take several minutes to re-connect. I had this problem with 14 spotlights in my living room. This doesn’t matter for lights that are controlled by wall switches (they’ll still turn on and off) but means that remotes or plug controls may stop working all of a sudden. The easy solution to that is to have two zigbee networks with two zigbee radios: one for the lights that are controlled from the wall and one for all the others. That way the others (remotes and plug switches) won’t lose connections because they won’t know about the lights on the other network.