After migrating from version 2021.4.3 to version 2021.7.0 I am experiencing problems with the light entity.
Brightness seams to be read in 0 to 100 scale but store in 0 to 255, that produce an annoying brightness change when modifiing the color.
I am ussing ws2812b with Tasmota, controlled with MQTT.
Usually the state is saved as brightness (so 0-255) and not brightness_pct (0-100). Are you sure you are using the correct service call?
This is on 2021.6, and was this way as long as I can remember.
If you use service call brightness_pct it should work? If you put brightness at 255 or brightness_pct to 100, should give the exact same result. If not, then you’d best create a ticket.
Home Assistant represents brightness using a range of 0 to 255 (it’s not something new in 2021.7.0). If your device uses a different range then there are different ways to perform the conversion in MQTT Light but it depends on which light schema
you are using (default, JSON, or template).
Is your light entity configured automatically via MQTT Discovery or have you configured it manually?
Version 2021.5 introduced new color modes. If you are using Tasmota 9.5.0 and Home Assistant’s MQTT Discovery, you are advised to reconfigure the Tasmotized device to use Tasmota’s own discovery method (and the Tasmota integration). From 9.5.0’s release notes:
BREAKING Lights using MQTT discovery will not work correctly in Home Assistant 2021.5 due to new color modes. Upgrade to v9.5 of Tasmota and use Tasmota integration
If you have manually configured the MQTT Light, I suggest you review the updated color_mode
documentation.
Thanks a lot both for your reply!
I´ve tryed to change dimmerRange 0,100 to dimmerRange 0,255 without success. Also upgrade Tasmota version to 9.5.0 but it seams to be more a HA problem than Tasmota. It worked fine in 2021.3.4 and the problem is specifically produced when dimmer is less than 99 and changing color at the same time. The new color schema seams to have any issue with legacy “MQTT light entity”
I am using manual configuration:
light:
- platform: mqtt
name: “Luz de Lucca”
on_command_type: first
state_topic: “stat/LUZ_LUCCA/POWER”
command_topic: “cmnd/LUZ_LUCCA/POWER”
brightness_state_topic: “stat/LUZ_LUCCA/RESULT”
brightness_command_topic: “cmnd/LUZ_LUCCA/Dimmer”
brightness_value_template: “{{ value_json.Dimmer }}”
brightness_scale: 100
rgb_state_topic: “stat/LUZ_LUCCA/RESULT”
rgb_command_topic: “cmnd/LUZ_LUCCA/Color”
rgb_value_template: “{{ value_json.Color }}”
qos: 1
payload_on: “ON”
payload_off: “OFF”
optimistic: false
Now: I removed the manual configuration and I used autodiscovery and problem was solved. Seams to have 2 diferents entity types?