Support for latest Martin Jerry trailing-edge dimmers

I have a couple of these dimmers installed (https://www.martinjerry.com/product-page/smart-dimmer-switch-3-way-rotary-model-us-std-kn01, https://www.martinjerry.com/product-page/smart-dimmer-switch-single-pole-touch-model-us-sd-tc01). They are really fantastic for controlling LEDs. They have a wide dimming range and essentially no flicker.

But I’m having a heck of a time getting the dimmer feature to work with HA.

  • With the Tuya Smart mobile app and with the Tuya API explorer, things work as expected.
  • With the longstanding HA Tuya integration, the devices are recognized as switches, and all I can do is turn them on and off. No dimming.
  • With the beta HA Tuya v2 integration, it does not find the devices at all. I imagine that is because they do not use support devices of this category (“tgkg”).
  • With HA localtuya integration, even if I configure them as lights, I can still only turn them on and off. No dimming. That is, the dimmer slider shows up in the HA UI, but it has no effect on the actual device.

Has anyone gotten these great devices working? I’d be happy to share details of any of the million things I’ve tried.

1 Like

Woo-hoo! I figured this out, after some fiddling around with tuyadebug and tinytuya (and a zillion dead ends).

For these devices,

DP 1 is on/off
DP 2 is brightness with a range of 0-255

A typical config/.storage/core.device_registry item looks like this:

            {
                "config_entries": [
                    "...different for you..."
                ],
                "connections": [],
                "identifiers": [
                    [
                        "localtuya",
                        "local_...different for you..."
                    ]
                ],
                "manufacturer": "Unknown",
                "model": "ue3zax30gexryaed",
                "name": "LT DR dimmer",
                "sw_version": "3.3",
                "entry_type": null,
                "id": "...different for you...",
                "via_device_id": null,
                "area_id": "...different for you...",
                "name_by_user": null,
                "disabled_by": null
            }

A typical config/.storage/core.entity_registry item looks like this:

            {
                "entity_id": "light.lr_dr_dimmer",
                "config_entry_id": "...different for you...",
                "device_id": "..different for you...",
                "area_id": null,
                "unique_id": "local_..different for you...",
                "platform": "localtuya",
                "name": null,
                "icon": null,
                "disabled_by": null,
                "capabilities": {
                    "effect_list": [],
                    "supported_color_modes": [
                        "brightness"
                    ]
                },
                "supported_features": 5,
                "device_class": null,
                "unit_of_measurement": null,
                "original_name": "LR DR dimmer",
                "original_icon": null
            }

And, finally, a typical config/.storage/core.config_entries item looks like this:

            {
                "entry_id": "...different for you...",
                "version": 1,
                "domain": "localtuya",
                "title": "LT DR dimmer",
                "data": {
                    "host": "192.168.1.170",
                    "device_id": "...different for you...",
                    "protocol_version": "3.3",
                    "friendly_name": "LT DR dimmer",
                    "local_key": "...different for you...",
                    "product_key": "ue3zax30gexryaed",
                    "dps_strings": [
                        "1 (value: True)",
                        "2 (value: 255)"
                    ],
                    "entities": [
                        {
                            "brightness_lower": 1,
                            "brightness_upper": 255,
                            "color_temp_min_kelvin": 2700,
                            "color_temp_max_kelvin": 6500,
                            "music_mode": false,
                            "friendly_name": "LR DR dimmer",
                            "id": 1,
                            "brightness": 2,
                            "platform": "light"
                        }
                    ]
                },
                "options": {},
                "pref_disable_new_entities": false,
                "pref_disable_polling": false,
                "source": "user",
                "unique_id": "...different for you...",
                "disabled_by": null
            }

I really don’t grok the localtuya entity configuration UI, but I had success with trial-and-error by choosing “light” as the entity type and then selecting the “1” drop-down for ID. (How can the ID be 1? I don’t know, but you can see it in the config items above.) The rest of the items look like this.

The important parts are to

  • select item “2” from the drop-down (ignore the “value” part; it’s the current dimmer value)
  • change the brightness lower and upper values to 1 and 255 (I used 1 instead of 0 because I don’t really know which it should be. I didn’t try this, but I suspect if you have an LED light that flickers or switches off below a certain value, you could set a higher minimum.)
  • leave everything else as-is and submit

Hi,

Thanks for posting this, it helped me get my wifi dimmer RF switches working!

I think it was a combination of you saying leave the irrelevant fields blank, Brightness from Zero to 255 and me suddenly realising that the UI gave you a clue to what DP’s to use.
So in my case for ECR310 dimmer switches:
Platform light, ID 1, brightness “3” because that was the only one that had a value that changed when using the dimmer control in the Smartlife App.

Now all my dimmers work!
Thanks

@wjcarpenter, thank you for posting these instructions. I have the Smart Dimmer Switch (3-Way) | Touch Dimmer | Model: US-STD-TC01 and your instructions worked to make it show up in HASS as a dimmer and not just a switch.

Richard

Wow, pretty crazy. I was re-doing my HA setup. When I got to my Martin Jerry dimmers, I couldn’t figure out how to set them up as dimmers instead of switches. A series of web searches brought me here to find my own advice that I had completely forgotten. I’m sure glad I wrote it down in 2021. :slight_smile:

1 Like

just ordered a couple of the 3 way dimmers pre-flashed with tasmota, do you know which one is the configuration type?

I’m not sure what you mean by configuration type, but what I know about it is what is already in this thread. You want to configure them as lights, not switches.

please see image, usually that needs to be set up properly for home assistant to know what type of device needs to be
image

You are asking about a Tasmota setup. The rest of this thread is about configuring them via LocalTuya with the original firmware. You are more likely to get info by asking in a new thread mentioning the device and tasmota in the subject.