Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Wi-Fi Dimmer? #5737

Closed
jsponz opened this issue May 2, 2019 · 293 comments
Closed

Support for Wi-Fi Dimmer? #5737

jsponz opened this issue May 2, 2019 · 293 comments
Labels
question Type - Asking for Information

Comments

@jsponz
Copy link

jsponz commented May 2, 2019

Is this Wi-Fi Dimmer supported?

https://www.aliexpress.com/item/Wifi-Smart-Dimmer-220V-240V-150W-Controller-Timer-Switch-light-Voice-Control-Works-With-Amazon-Alexa/32962631174.html?spm=a2g0s.9042311.0.0.27424c4dZ69TdG

I have used tuya-convert to flash Tasmota, and it works. I have it with Tasmota.

I can't find any Info about this device. I have tried Tuya Dimmer but no success (no switching, no dimming control from the Tasmota interface).

Thanks!

@Jason2866
Copy link
Collaborator

No. Please read and this CONTRIBUTING

@ascillato2
Copy link
Collaborator

Closing this issue as it has been answered.


Support Information (Guide)

See Wiki for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

@ascillato2 ascillato2 added the question Type - Asking for Information label May 2, 2019
@dr-apple
Copy link

dr-apple commented May 8, 2019

Hello i have have the same device, i flash tasmota 6.5, but what is the pin occupancy for the serial connection and switch ? Have any a idea ?

@keesschollaart81
Copy link

I also recently bought this device and I'm very intersted in Tasmota support. It's the cheapest wifi AC dimmer out there (~15$ price point), very interesting!

@jsponz
Copy link
Author

jsponz commented May 8, 2019

@dr-apple I have tried all the possible options with no success.

I guess there is also anything related to serial communication and/or chip identification.

@keesschollaart81 I am with you. It works ok. Robust and cheap.

Any help is welcome!

@dr-apple
Copy link

dr-apple commented May 8, 2019

@jsponz thank you for the info, i have testet all options for the button but zero :-(

I've been looking for hours in the network for schematics, pin assignments, but I can not find anything about the thing or the structure ....

https://docs.tuya.com/en/hardware/WiFi-module/wifi-e1s-module.html

@meingraham
Copy link
Collaborator

You guys may be stuck between a rock and a hard place.

First let me ask if you have tried different Tuya Dimmer IDs (SetOption34)?

It is likely that the dimming function is not handled by the ESP chip itself. The dimming function is probably handled by a separate MCU. The dimming actions to perform are usually communicated via codes sent from the ESP chip to the MCU via the serial communications interface. The dimming codes vary from device to device, even revision to revision.

In order for Tasmota to work if installed on the dimmer, Tasmota needs to send the right codes when an action request is made to it and also receive codes to confirm the action completed or to know what the device is up to when a change is made physically at the device (i.e., a human made the change). If you know the codes, then these can be programmed into Tasmota rules or customized into the code itself and compiled into the firmware.

But first you have to know the codes. And for that you would have had to reverse engineer the original firmware. Of course, if you provision the device on the Smart Life app in order to see it operate, Smart Life may update the firmware and thus blocking the ability to use Tuya-Convert. And thus the rock and a hard place 😬

If you backed up the original firmware, you may be able to flash it back onto your device to attempt the reverse engineering process. @digiblur went through that is some of his videos.

Regards.

Mike

@keesschollaart81
Copy link

Impressive work from @digiblur 💯, super cool to see these videos.

Some pictures from inside of the device:
https://ibb.co/pPhL3cL
https://ibb.co/7Ysv6gR
https://ibb.co/3pmzzVh
https://ibb.co/s2Gg5S3
https://ibb.co/jLbc7Yg

Tuya Convert log

Original firmware binary

After flashing Tasmota is was able to configure it via the web interface and I tried some different combinations but without success. Module set to 'Tuya Dimmer (54)'. After trying some different RX/TX configuration and some random guesses for the SetOption34 I was not able to see any RX messages in the console (with web log level 4). Also no incoming data when manually switching the device.

What would be a next thing to try/work out? I don't think I'm able to solder/connect to the serial port myself (too small & no experience).

@jsponz
Copy link
Author

jsponz commented May 9, 2019

@keesschollaart81 Thanks for your analysis. I spent some time as well. One of my devices is broken: it does not boot.

The other one is flashed with Tasmota, but nothing happens. Same result as you have.

@dr-apple
Copy link

dr-apple commented May 9, 2019

if I could find out the pin assignment, then I would try to read the protocol and recreate .... I have to lie on the couch for 2 weeks, have time ;-)

@keesschollaart81
Copy link

Maybe @jsponz can disassemble his broken device and expose the chip so that we can see which Tuya device it compares with / which pins we have?

@digiblur
Copy link
Contributor

digiblur commented May 9, 2019

Which pins did you try for TX/RX?

@jsponz
Copy link
Author

jsponz commented May 9, 2019

@keesschollaart81 Of course!

It is already disassembled :-)

Tomorrow I will send you pictures.

@keesschollaart81
Copy link

keesschollaart81 commented May 9, 2019

@digiblur same as described here

I also tried to point the Tuya Tx107 and Rx108 to the GPIO1 and 3. Also swapped 107 and 108 in both configs. Every test I tried to toggle the input switch but the logging is always the same

By the way, the bulb seems to be on the lowest brightness after power on. The input switch does not turn on/off the light.

@jsponz
Copy link
Author

jsponz commented May 10, 2019

@keesschollaart81 the same happens here with the original firmware. I have reported it and they have told me that it is a production issue. A new device is on the way with this fix. I will confirm as soon as I have it...

However, after flashing one unit with Tasmota (as it is right now without support for this device), I see that the light is always off, so I guess it is firmware related.

@keesschollaart81
Copy link

After I set TuyaRx18 to GPIO16 it does not boot any more... :-/

@dr-apple
Copy link

dr-apple commented May 10, 2019

You must reset the esp with 3 x ac power on / off with 2 sec sleep, after that, the esp has delete the config make a hotspot....

@jsponz
Copy link
Author

jsponz commented May 10, 2019

@dr-apple, @keesschollaart81 the same happened here and esp did not boot up anymore.

I will try later, when taking pictures.

@Jason2866
Copy link
Collaborator

Not all GPIOs can be used for all. See https://github.com/arendst/Sonoff-Tasmota/wiki/Expanding-Sonoffs#restrictions

@keesschollaart81
Copy link

@jsponz any update?

@jsponz
Copy link
Author

jsponz commented May 14, 2019

@keesschollaart81 Sorry, I have a personal issue. Tomorrow I will take the pictures.

@jsponz
Copy link
Author

jsponz commented May 15, 2019

As promises, please find attached the pictures.

IMG_20190515_073344
IMG_20190515_073437
IMG_20190515_073406
IMG_20190515_073457
IMG_20190515_073841
IMG_20190515_073418

@Jason2866
Copy link
Collaborator

Jason2866 commented May 15, 2019

It seems there is a sort of ESP module hooked on a PCB with a MCU.
The type of the MCU cant be identified on the photos. Next step is to identify type of MCU
and someone hast to hook up a logic analyzer and sniff commands that needs to be sended
and are received from the ESP to activate on off and dimming. If this is done and providing this detailed information someone can implement this type of dimmer in Tasmota.
Tbh i dont believe this will happen because there are already supported easy to buy dimmers available.

@CJS0815
Copy link

CJS0815 commented May 17, 2019

@Jason2866
Please, can you say me what Types/Models of dimmers for in-wall? (only box without switch or push-button) is supported by tasmota?
5 Days ago I've buyed 4pc of the parts above - shit happens

sorry for my english :-(

@dr-apple
Copy link

The Model is : QS-WIFI-D01-TRAIC

@CJS0815
Copy link

CJS0815 commented May 17, 2019

You mean TRIAC?

Not available in Europe :-(
Not on aliexpress

Do you have a dealer for me?

@dr-apple
Copy link

? show the first post here, it from ali and came frome china ?

@CJS0815
Copy link

CJS0815 commented May 17, 2019

??? I dont understand !?!

The part from the first post was actual not supported - or did I read complete wrong?
I asked for a supported module like this from the first post, but even supported ...

@blackscreener
Copy link

Flashed with tasmota standard, one channel is working like a charm. DimmerRange is 0 - 1003.

@LukevdPalen
Copy link

@blackscreener nice, i also managed to flash the device. Can you share your configuration? What template did you use?

@blackscreener
Copy link

blackscreener commented Jun 3, 2020

@blackscreener nice, i also managed to flash the device. Can you share your configuration? What template did you use?

Template: TuyaMCU (54)
Initial config: https://tasmota.github.io/docs/TuyaMCU/#dimmers

21:32:36 RSL: stat/tasmota_57CA8B/RESULT = {"TuyaMCU":[{"fnId":11,"dpId":1},{"fnId":21,"dpId":2},{"fnId":12,"dpId":7}]}

dpID 1 - on, off 1 ch
dpID 2 - dimmer 1 ch
dpID 7 - on, off 2 ch
dpID 8 - dimmer 2 ch

We need to add 2nd dimmer option to Tasmota.

@LukevdPalen
Copy link

@blackscreener Thanks for sharing. Besides channel 2 being uncontrollable in Tasmota. I also notice that the dimming state is not being stored. When switching on and off the dimming level is at a very low value. Do you also have this issue?

@blackscreener
Copy link

blackscreener commented Jun 6, 2020

@LukevdPalen
For me dimming state is being stored. Try my config, second channel as relay is disabled.
Tuya_2_ch dimmer_config_tasmota_57CA8B_2699_8.3.1.2.zip

@blackscreener
Copy link

blackscreener commented Jun 9, 2020

@LukevdPalen

2 channel works in esphome without problems. Thank you very much for help.
Screenshot_2020-06-09-17-11-33-175_io homeassistant companion android

@blackscreener
Copy link

blackscreener commented Jun 9, 2020

With this script running, is it still possible to reset the device with various combinations long presses...?

@dbrb2
No, reset mode is only for default wifi settings. If you want to change minimum brigtness value for MCU you must send TuyaSend command from Tasmota console:
#7379 (comment)

@Clement87
Copy link

Hi, I have the same 2 gangs (TYWE2S one) but I'm still stuck at the flashing part.

  • I tried to desolder it in order to access the IO0 pin at the back without success.
  • I tried Tuya Converter but I got a device with a new PSK format

How did you manage to flash it ?
Thanks

@strongset
Copy link

strongset commented Jun 27, 2020

Programming it is not the issue. The issue is to know how to configure it with the two dimming channels.

The GPIO_0 is accessible after you remove the metal shield.
tywe2s

@blackscreener, what are the complete comand list to configure the two dimming channels? I tried to restore the configuration file you shared and I lost the comunication with the module, I needed to erase and program again the flash.

Thanks

@strongset
Copy link

strongset commented Jun 27, 2020

I just can configure as funcion two relay, just one dimmer.

imagem

Commands used:
TuyaMCU 21,2
TuyaMCU 11,1
TuyaMCU 12,7

I think is missing the implementation of the second dimmer on the tasmota and I'm guessing the command would be:
TuyaMCU 22,8

There is any other way?

@blackscreener
Copy link

@diasarmando
#8663

I gave up with tasmota. With esphome 2 channels works fine.

@strongset
Copy link

@blackscreener can you please share the link or configuration?
Thanks

@blackscreener
Copy link

@diasarmando

esphome:
  name: 2ch_dimmer
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "xxxxxxx"
  password: "xxxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "2Ch Dimmer"
    password: "xxxxxxx"

captive_portal:

# Make sure logging is not using the serial port
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  password: "xxxxxx"

ota:
  password: "xxxxxx"

sensor:
  - platform: wifi_signal
    name: "2CH Dimmer RSSI"
    update_interval: 60s

# My dimmer used the hardware serial port on the alternate pins
uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

# Create a light using the dimmer
light:
  - platform: "tuya"
    name: "dim1"
    dimmer_datapoint: 2
    switch_datapoint: 1
    min_value: 0 
    max_value: 1003

  - platform: "tuya"
    name: "dim2"
    dimmer_datapoint: 8
    switch_datapoint: 7
    min_value: 0 
    max_value: 1003

@blackscreener
Copy link

Is that new MS-105B 1 ch dimmer or it's old V2 version ? I flashed it with tuya convert.
IMG_20200701_183343
IMG_20200701_183716

@yuraivan
Copy link

yuraivan commented Jul 7, 2020

You can find a modified version of the script which is intend to work with SetOption20 1 in order to have Channel and Power decoupled. In other word the brightness channel and power are separated, so you are able to change brightness before powering on the device. The script is also shorter giving the possibility to add further features.
It has been working fine for about 2 months now.

Dimmer-QS-WiFi-D02-Script.txt

Credits to thxthx0 and MaWork77, this script is based on their version.

In the repo README I have also summarize some info to properly set up the device.

Hello!!!! I did everything according instruction.I have entered the script, the template and activated "Setoption68 1". In web interface I see all correct. Toggle 1 and 2 are working but my lamps not light(((((( What is the problem???

@gonzaechev
Copy link

gonzaechev commented Jul 13, 2020

Hello, I have this device without dimmer, I need to use with two channels for rollershutter with Tasmota blind option,
I tried flashing with tuya-convert but withoutc succes, Could someone help me with the GPIO mapping? thanks
MoesMini2Gang_2
Moesmini2Gang

@jayjohns0n
Copy link

@LukevdPalen how did you remove the shield?

@Clement87
Copy link

@LukevdPalen how did you remove the shield?

I used a hot air iron. I also tried to drill a hole carefully at the right place. Both worked.

@jayjohns0n
Copy link

Thank you @Clement87 I got a hot air iron and it worked well. Did you manage to flash it? I can't get it into flash mode, I connected GPIO0 with a needle to ground but I couldn't flash it. same method worked with my Sonoff devices with ESP8266. Did someone have the same problem?
IMG_1407

@Clement87
Copy link

@jayjohns0n I flashed four of them without issue. Check your wires and set GPIO0 to the ground only a few seconds while you flash it.

@TheeBeginner
Copy link

Thank you @Clement87 I got a hot air iron and it worked well. Did you manage to flash it? I can't get it into flash mode, I connected GPIO0 with a needle to ground but I couldn't flash it. same method worked with my Sonoff devices with ESP8266. Did someone have the same problem?
IMG_1407

Hi I have the same problem, i dont get if flashed, did all as per above
-removed the shield

  • soldered the serial connection
  • removed the bridge
  • while plugging in my usb in the computer i jump between GPIO0 and earth

Issue i don't know if it's in flashing mode ...? Neither with Tasmota or ESPeasy the flashing starts

Any suggestions ...

@Clement87
Copy link

Thank you @Clement87 I got a hot air iron and it worked well. Did you manage to flash it? I can't get it into flash mode, I connected GPIO0 with a needle to ground but I couldn't flash it. same method worked with my Sonoff devices with ESP8266. Did someone have the same problem?
IMG_1407

Hi I have the same problem, i dont get if flashed, did all as per above
-removed the shield

  • soldered the serial connection
  • removed the bridge
  • while plugging in my usb in the computer i jump between GPIO0 and earth

Issue i don't know if it's in flashing mode ...? Neither with Tasmota or ESPeasy the flashing starts

Any suggestions ...

Hi,

  • Be sure you didn't invert RX and TX (take a look at the datasheet)
  • Be sure the bridge is properly desoldered (use a multimeter to check)
  • Be sure you used a USB cable that can transfert datas (a lot of cable only charge devices)
  • Use an other USB to Serial adapter (not sure, but as I remember, you need one with 3.3V, not 5V. This is something to check)
  • For the flashing part, touch GPIO0 with ground then connect the USB cable then run the flash. When flashing is progressing you can take off GPIO0 needle.

I was using esphome python module.
That's all.

@TheeBeginner
Copy link

Thank you @Clement87 I got a hot air iron and it worked well. Did you manage to flash it? I can't get it into flash mode, I connected GPIO0 with a needle to ground but I couldn't flash it. same method worked with my Sonoff devices with ESP8266. Did someone have the same problem?
IMG_1407

Hi I have the same problem, i dont get if flashed, did all as per above
-removed the shield

  • soldered the serial connection
  • removed the bridge
  • while plugging in my usb in the computer i jump between GPIO0 and earth

Issue i don't know if it's in flashing mode ...? Neither with Tasmota or ESPeasy the flashing starts
Any suggestions ...

Hi,

  • Be sure you didn't invert RX and TX (take a look at the datasheet)
  • Be sure the bridge is properly desoldered (use a multimeter to check)
  • Be sure you used a USB cable that can transfert datas (a lot of cable only charge devices)
  • Use an other USB to Serial adapter (not sure, but as I remember, you need one with 3.3V, not 5V. This is something to check)
  • For the flashing part, touch GPIO0 with ground then connect the USB cable then run the flash. When flashing is progressing you can take off GPIO0 needle.

I was using esphome python module.
That's all.

Thanks for the reply, did all at least I think i did, with RX / TX you mean RX goes on TX and TX on RX ? I also tried via Tuyaconvert and a pi but did not succeed there neither although i could get it into the flashing mode like that some times.

Thanks

@mattia480
Copy link

mattia480 commented Jan 18, 2021

Hi @TheeBeginner, I found myself in your situation where I could not flash the chip despite putting the GPIO0 to ground.
I found the solution on the tasmota documentation which is to ground the GPIO0 and the RST (above the word J5).

  • Connect everything to the USB port of the computer
  • Disconnect the RST from the ground
  • Start writing via Tasmotize or other software
  • Release GPIO0 from the ground
  • Flash completed!

These are the references to the cited page (link):
Attach the GPIO0 wire to ground during initial boot to flash. You may need to also connect MCU RST to GND during initial boot to get it into programming mode as described here. A 3-pin header bridged together works great with GPIO0, GND and the GND from the USB flasher attached. (TX pin to RX pin and RX pin to TX pin on USB flash adapter). Verify that you are using 3.3volts to flash, NOT 5V!

I hope to be of help even if with a delay.

@4zoom
Copy link

4zoom commented Jan 29, 2021

Hey guys

How you managed to remove the shield from the MS-105B dimmer? Or is there another possibility meanwhile to reach the GPO0

I do have a hot air iron

Thank you

@Felipetomaz
Copy link

Felipetomaz commented Jan 29, 2021 via email

@4zoom
Copy link

4zoom commented Feb 3, 2021

Hey guys

I managed to open the shield with a hot air and also flash it with the newest Tasmota 9,.2

I compiled the version with the script option and add the script
https://gist.github.com/thxthx0/ce7f72ea75ab82be2704c9536ea77bf7#file-wifi-2way-dimmer-qs-wifi-d02-script-txt

And did the

Template:
{"NAME":"2Chan-Dimmer","GPIO":[255,148,255,149,38,43,0,0,255,42,37,255,255],"FLAG":0,"BASE":18}

Console:
SetOption68 1

Result on UI is great but no voltage on the outputs I also measured it but nothing. Also not wenn I use the hardware input for switching.

I have the MS-105B like displayed right above

Any idea what can be the problem ? GPIO's wrong configured in the template?

Thank you

Repository owner locked and limited conversation to collaborators Feb 3, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Type - Asking for Information
Projects
None yet
Development

No branches or pull requests