Light - turn off vs brightness value

When the dimmable light is being turned off, its brightness bar goes to zero. Then when I turn on the light, the brightness bar sets to the state reported by the light.

I checked MQTT finding out that the brightness value doesn’t change when the light is turned off (Shelly Dimmer). So it seems to be HA implementation responsible for this UI behaviour.

Is it possible (somehow) to make brightness bar represent brightness reported in MQTT always, regardless light state?
Or maybe there are some limitations or user cases I’m not aware of? Would like to know them if any.
Thanks

with regards

1 Like

Why do you want this? What is the end goal?

There are a few actually:

  1. to know the brightness at the moment the light has been turned off
  2. to predict the brightness applied to the light when turning on
  3. maybe to set brightness prior to turning light on (if technically possible)

In fact, if you take a look at native Shelly app GUI, those 2 attributes (state and brightness) are separated. Which is real representation of what is happening. I don’t understand why HA GUI fakes the brightness bar trying to reflect light state

2 Likes

Scenes have the ability to store light states on the fly. You should be using those to handle all of these requirements.

Because home assistant bridges with other devices and it’s standard for this behavior. When lights are off, brightness is zero.

To actually see what the previous value of brightness was before switching off you could store the value in an input number or sensor. This would require automating all your light turn off actions though.

I can look at MQTT to get the value. But it’s not feasible way for daily use as well as for other users. It’s about usability. Unfortunately I have no enough skills to make the UI show brightness bar as I want. I’m not sure if it’s possible at all.
TBH I’m surprised it’s not done this way or there is no option to switch the behaviour.

I’m not. If the light is off the brightness is zero, by definition.

If you have the brightness value available via mqtt just make a sensor you can add to the front end.

I get you, for you the brightness is a representation of current state. But then having brightness and on/off switch at the same time is redundant, isn’t it? Since cards can show both at the same time, why not allow brightness bar to be light setting, not light state?

For me, brightness is just attribute of the lamp, regardless it is on or off. The same for RGB settings. All those values might remain set when the light is off. I don’t have a problem with such way of understanding. So smart switches developers are, since their products are compliant with my idea.

Redundant or choice?

You can switch the light off or drag the brightness slider to zero. Which is easier?

It also depends on your light hardware capabilities. For example LIFX lights allow you to adjust all parameters of the light while it is off. As far as I am aware it is the only light that can do this.

the problem I had

if I dim the light then turn it off then turn it on it would goback to the last dim setting

so I did this

- id: Lounge Light OFF
  alias: Lounge Light OFF
  trigger:
  - entity_id: light.lounge
    platform: state
    to: 'off'
  action:
  - data:
      payload: 100
      topic: cmnd/Lounge/Dimmer
    service: mqtt.publish

the only good thing is that changing the dim when the light is off did not turn on.

and every time its turn on its 100%