Problem to ramp up/down Hue Lights via switch

Hi there,
first: I’m quite new to homeassistant and I’m struggling with this problem:
I installed 2 hue bulbs and an zigbee switch. They are already paired via zigbee2mqtt and appear in HA. Also I created a group for the 2 hue lights.

What I like to do is:

  • Turn on the physical wall-switch
  • the ralais (zigbee switch) will power-up the hue lamps (this happens)
  • The hue lamps ramp up the light to a predefined value (this happens not)

and the other way:

  • Turn off the physical wall-switch
  • The hue lamps ramp down the light to zero (this happens not)
  • the ralais (zigbee switch) will power-down the hue lamps (this happens)

So I think I need a delay before turning off the power. But I don’t get that far. The lights won’t even ramp up.
What happens is: the lights turn on and off immediately, when I push the button and don’t ramp up/down

This is what I tried:

alias: Esstisch Licht smooth On/OFF
description: ''
  - platform: state
      - switch.esstisch_schalter_l2
    attribute: state_l2
    to: 'on'
condition: []
  - condition: device
    type: is_off
    device_id: 61389235e21b74e19adaea206c0a5caf
    entity_id: light.esstisch_licht_grp2
    domain: light
  - type: turn_on
    device_id: 61389235e21b74e19adaea206c0a5caf
    entity_id: light.esstisch_licht_grp2
    domain: light
mode: single

Does anybody have some hints?
Would be great!

If I am reading this right I think you want to do something like this:

- service: light.turn_on
    brightness: 255
    color_temp: 332
    transition: 2
      - light.upstairs_hallway

The transition is the key, when the light is turned on it will ramp up to the desired brightness. So to turn off you would use the same thing but just use the light.turn_off service.

hey @TinyDoT,
thank’s for your reply. I was thinking about this the hole day. In my opinion the main problem seems to be, that these switch modules I use (ZigBee Smart Light Switch Module No Neutral Wire Required 2MQTT — MOES) does not distinguish between the events “button push” and “open/close relais for power”. So my hue bulbs does not have a chance to get commands to ramp up/down.
So maybe I have to rethink this concept in my brave new homeautmation-world … or live without smooth light-transitions. ¯\_(ツ)_/¯

I see your dilemma now, at the moment I can not think of any fix for this situation. I believe you will have to rework things. One fix could be, to wire the smart bulbs to always be on, and and use a zigbee button on the wall:

Then you would be able to have the lights work the way you would like.