emontnemery / hatasmota

MIT License
24 stars 20 forks source link

~~Feature request:~~ Bug? Update of Dimmer/Color/CT without turning power on #221

Open pomeloy opened 1 year ago

pomeloy commented 1 year ago

Tasmota SetOption20 1 enables updating Dimmer/Color/CT values without turning the power on (source: https://tasmota.github.io/docs/Commands/#setoptions)

I have a Tuya LED that defaults to white when sending boolean data to the light DpId, no matter the previous state. Hatasmota sending a command Backlog NoDelay;Power2 ON;NoDelay;HsbColor1 <H>;NoDelay;HsbColor2 <S> results in the color first visibly switching to white and eventually to the new color.

I suggest having hatasmota read the value of option20 and change the command accordingly.

pomeloy commented 1 year ago

Well, it seems as if I came up with that idea a measly 2,5 yrs after the fact judging from d68ba34b2637a9b24e4996249f3b3feae1bc76ba

Still, I am at a loss as to why setting the option does not work with my setup. I am running Home Assistant 2023.4.6 which itself is using hatasmota 0.6.4. The autodiscovered Tasmota device was removed and the HASS docker container and the Tasmota device itself restarted after setting option 20 in the Tasmota console. The POWER2 command is still sent when changing dimmer/color/CT values.

Lenbok commented 1 year ago

I think this is a bug. I have the problem with the lights on an oil diffuser. Whenever it gets a POWER2 ON command, it sets the rgbmode to cycle. Thus any attempt to set the RGB from HA instantly sets it to cycle mode!

If Tasmota internally has the SetOption20 that controls whether Dimmer/Color/CT setting turns the lights on, I don't see why hatasmota ever needs to send an explicit power on when changing Dimmer/Color/CT, just let tasmota handle it.

Lenbok commented 1 year ago

So, additional notes from experimenting:

hatasmota only queries the SetOption20 setting on discovery, so whenever you change SetOption20 in tasmota, you need to remove the device in HA and trigger rediscovery by restarting tasmota in order for the change to be picked up.

When SetOption20 is off (the default, where tasmota will turn on when Dimmer/Color/CT are adjusted):

When SetOption20 is on (tasmota will let you adjust Dimmer/Color/CT without turning on the light):