Brightness indication weirdness when setting brightness state of lights

Hi, all-

I am trying to set the STATE of a light as shown in the frontend without also executing the action that would normally change the state, e.g., to show a light as on and full brightness without calling the light.turn_on service. The use case is for a project I’m close to finishing that will show the correct state of one-way/no-feedback light switches such as Lightwave RF Gen1/433 when they are switched manually at the wall.

Setting the light state to on or off and setting other attributes excluding brightness via dev-state (and also a rest_command or shell_command curl) works fine… except the brightness level slider looks the same as when off when viewed in the Lovelace light card, entity card (bulb color not slider), the States UI (bulb color not slider) and the slider-entity-row custom card from @thomasloven . The brightness percent on Thomas’ card shows NaN%. I guess that means that not specifically setting a brightness attribute clears the brightness attribute state that existed previously. That’s more or less understandable.

Setting the light state including brightness is when things start to get weird. The lightbulb icon disappears at brightness levels above 3 out of 255. What I think it actually happening is the the bulb goes transparent after starting out already very faint at level 1.

I don’t know whether this a problem when setting the brightness attribute or with the frontend. I suspect that the root of the problem is in the setting of the attribute. It’s like there is a secret additional or different attribute that the frontend uses for showing brightness.

Here’s a visual summary:

LINK TO IMAGE IN CASE IT’S TOO SMALL HERE: https://photos.app.goo.gl/AJxab2D4Fz57Ndq69

I read on some other threads that brightness may be handled differently in different light components. The example here is with rfxtrx. I also tried with mqtt lights and got the same result.

I posted a related thread https://community.home-assistant.io/t/light-entity-icon-disappears-when-overwriting-brightness-attribute-via-api/101973and raised an issue https://github.com/home-assistant/home-assistant.io/issues/8783 earlier, but I’ve since done more testing and perhaps uncovered more clues. Hence the desperate new posting. :wink:

THANKS for reading through. I hope that you have some ideas of what may happening.

Ron

Brightness should be an integer, not a string.

"brightness": 255

(same goes for supported_features)

Edit: Likewise, the correct value for assumed_state is true, not "true". Doesn’t matter much in this case, but if you want to not use assumed state, "false" will evaluate to true

1 Like

Thanks so much. I equal parts relieved and embarrassed that it was such a simple mistake with all the testing I did. :wink:

Annoying, I tried with quotel-ess 255 early on, but I must have had another issue at the time and never retested that.

Also closing the issue on Github.

Thanks again!