Tuya dimmer switch cannot change brightness, only on/off
See original GitHub issueThe problem
Tuya dimmer switches not getting brightness command from Home Assistant. product Category is “tgq”. I have 2 types of this dimmer, and one type works and the other does not. Suspect related to a differenece in: Working tgq instruction set:
switch_led_1 | Boolean | "{true,false}"
-- | -- | --
bright_value_1 | Integer | { "unit": "", "min": 10, "max": 1000, "scale": 0, "step": 1 }
Non working set:
switch_led | Boolean | "{true,false}"
-- | -- | --
bright_value_v2 | Integer | { "min": 10, "scale": 0, "unit": "", "max": 1000, "step": 1 }
One uses bright value 1 and the other bright value 2. These are the same brand… working unit “Smart 3-Way Dimmer Switch_DS02_NEW”, non working unit “DS02S Smart dimmer switch”
HA is not sending any brightness command information to these devices… brightness control works well in native app.
Logs and debug info below.
What version of Home Assistant Core has the issue?
2021.11.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
tuya
Link to integration documentation on our website
No response
Example YAML snippet
N/A
Anything in the logs that might be useful for us?
2021-11-28 08:02:11 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device 8240074324a1603a1e8e: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-28 08:02:13 DEBUG (Thread-5) [homeassistant.components.tuya] Received update for device 8240074324a1603a1e8e: {'switch_led': True, 'bright_value_v2': 100}
THIS COMMAND EXECUTED VIA SERVICE CALL TO LIGHT_ON... SAME RESULTS
2021-11-28 08:04:11 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device 8240074324a1603a1e8e: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-28 08:04:11 DEBUG (Thread-5) [homeassistant.components.tuya] Received update for device 8240074324a1603a1e8e: {'switch_led': True, 'bright_value_v2': 100}
THIS IS A COMMAND TO THE WORKING SWITCH FOR THE SAME ACTION:
2021-11-28 08:07:41 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device 22002172e0980605bf33: [{'code': <DPCode.SWITCH_LED_1: 'switch_led_1'>, 'value': True}, {'code': <DPCode.BRIGHT_VALUE_1: 'bright_value_1'>, 'value': 445}]
2021-11-28 08:07:41 DEBUG (Thread-5) [homeassistant.components.tuya] Received update for device 22002172e0980605bf33: {'switch_led_1': True, 'bright_value_1': 445, 'brightness_min_1': 100, 'led_type_1': 'incandescent'}
Additional information
This Unit Works Correctly:
Product Name: Smart 3-Way Dimmer Switch_DS02_NEW Product Category: tgq
Code Type Values
switch_led_1 Boolean "{true,false}"
bright_value_1 Integer {
"unit": "",
"min": 10,
"max": 1000,
"scale": 0,
"step": 1
}
brightness_min_1 Integer {
"unit": "",
"min": 10,
"max": 1000,
"scale": 0,
"step": 1
}
led_type_1 Enum {
"range": [
"incandescent",
"halogen"
]
}
This is the non working model:
Product Name: DS02S Smart dimmer switch Product Category: tgq
Code Type Values
switch_led Boolean "{true,false}"
bright_value_v2 Integer {
"min": 10,
"scale": 0,
"unit": "",
"max": 1000,
"step": 1
}
HA is not sending any brightness command to the non working unit. I cannot find any further log information related to the problem, no errors or other messages that trace back to this.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top GitHub Comments
I am experiencing the “on/off works, but brightess doesn’t” on my Gosund SW-2 dimmers. Tuya category “dj”
The following behavior is consistent on both of the following dimmers:
On this version of HA:
When debugging using the Tuya IoT platform to send instructions directly to the dimmers, I have noticed that when sending instructions containing BOTH
switch_led
&bright_value
at the same time, thebright_value
gets ignored.For example, with the switch OFF, and the last bright_value @ 255, sending:
Will only turn the switch ON.
Once the switch is ON, sending the same instructions does not change the brightness at all (bright_value still at 255)
HOWEVER, once the switch is on, if you send JUST the bright_value, it is respected and the light dims.
E.g. - sending:
adjusts the brightess as expected.
I have noticed that the HA never sends two separate messages (e.g. one for power, the other for brightness) - instead, it looks like both are always sent at once (and in my case, the brightness value is ignored by the dimmer switch)
e.g. - turning the switch ON using HA look like this in the debug logs:
changing the brightness (which doesn’t change the brightness) looks like this:
I believe that if HA was to send distinct instructions/API requests to Tuya for dimming & power, then adjusting the brightness would work.
E.g.: When turning ON in HA:
When changing brightness in HA:
When turning OFF in ha:
Note that sending bright_value when the switch is OFF appears to be ignored, as well.
I’m new to HA & these switches, so cannot comment on whether this has ever worked before, and/or what might have changed over time to change the behaviour.
I have this problem too. It worked just before the recent status delay/lost issue. With on/off starting to work again yestrerday, brightness was lost. It works using the Tuya Smart app but not using HA.
I have latest HA and recently restarted the entire host.
Product name: WIFI Dimmer module Product Category: dj
EDIT: I have since quit everything Tuya.