Skip to content
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

Dimmer #469

Closed
macpit opened this issue May 21, 2017 · 636 comments
Closed

Dimmer #469

macpit opened this issue May 21, 2017 · 636 comments
Labels
enhancement Type - Enhancement that will be worked on

Comments

@macpit
Copy link

macpit commented May 21, 2017

Hi arendt,

Great Project and many thank for your work! I love it and it's work perfect.
I know that is not project related but maybe you can help me.

I search a W-iFi dimmer for 230V/~400W for pulps. Sonoff is veyr cool but there is no dimmer :-(
Maybe you have a tip for me?

Regards,

Marc

@davidelang
Copy link
Collaborator

davidelang commented May 21, 2017 via email

@nosaj66au
Copy link

I'm currently working on a renovation and also required 240Vac dimmers. Im running trials using a push button dimmer "SAL Push Button Dimmer 350W Master Switch SDD350TCM" which has a remote switch option SDD350TCS. The remote/slave push button is just 2off, 10K resistors in series and a tactile switch. This I have replaced with a sonoff and 2 off 10K resistors. I can turn the light on off and dim. I'm currently look at way to set dim level using a sonoff POW to measure power consumption or Current but it's a bit flaky at the moment. Work is still on going.
Jaosn

@Blue407
Copy link

Blue407 commented Jul 3, 2017

I'm also looking for the same thing. The ability to dim 230v GU10 LED bulbs. (They are dimmable type)

@jbarneson
Copy link

+1 I'm hopeful sonoff releases one soon

@Amli2011
Copy link

Amli2011 commented Sep 9, 2017

Wishing for something like this:
http://www.apogeekits.com/advanced-electronic-kits/dc-light-dimmer-k8064.htm
Together with pwm out of a tasmota software in a sonoff package with CE and terminals for a wall switch, or even better, built into a sonoff touch panel.
Could we all tip sonoff/itead about it? Maybe they will make it if the interest is there?

@klaernie
Copy link

Has anyone thought about replacing the regular relay by a solid state relay? I think one of these fostek SSR should be fine with running smaller resistive loads in pwm. Could the esp8266 run pwm on the output steering the relay?

@hesich
Copy link

hesich commented Oct 1, 2017

Only in German, but google can translate
https://ex-store.de/2-Kanal-RS232-Dimmer-Modul-V4-fuer-Unterputzmontage-230V-3A
they have also the relay version (currently sold out)
https://ex-store.de/ESP8266-WiFi-Relay-V31

@Martinvdm
Copy link

Is there still no dimmer possible with tasmota and mqtt?

@davidelang
Copy link
Collaborator

davidelang commented Jan 14, 2018 via email

@Martinvdm
Copy link

https://github.com/Theb-1/ESP8266-wifi-light-dimmer

@davidelang
Copy link
Collaborator

davidelang commented Jan 15, 2018 via email

@jonas59075
Copy link

jonas59075 commented Jan 15, 2018

I have just ordered this one:

https://www.aliexpress.com/snapshot/0.html?spm=a2g0s.9042647.6.2.iGlAYq&orderId=88957336184289&productId=32562891943

It will arrive in 10-15 Days.

Perhaps it is possible to modify the tasmota firmware to get it work.

This one seem interesting too:
https://de.aliexpress.com/item/AC110V-220V-WiFi-0-10V-Touch-Panel-LED-Dimmer-output-0-10v-dimming-signal-by-ios/32799514095.html?spm=a2g0s.8937420.0.0.714a4c39LINMVF

But it only comes in black and I need it in white

@bensuffolk
Copy link

Hi @jonas59075 that link does not work (I think its a copy of your order so only works when your logged in).

Was it this you were linking to? https://www.aliexpress.com/item/Best-Sales-Wallpad-White-Glass-LED-110-250V-EU-Phone-Wifi-Wireless-Remote-Controlled-Power-Dimmer/32562891943.html

Ben

@jonas59075
Copy link

jonas59075 commented Jan 15, 2018

Oh, sorry for that. Yes ... your Link is the right one ...

Have anyone experience with that device?

@bensuffolk
Copy link

Thats pretty expensive, you have to be keen on dimming existing lamps I think rather than buying some dimmable ones like the B1.

But it will be interesting to see if its got the same esp8266 chip in. Nice to know what options are out there for when I come to do some more bits on my home.

@Martinvdm
Copy link

This looks promising:

http://www.instructables.com/id/ARMTRONIX-WIFI-SINGLE-Dimmer-Board-V02/

@nosaj66au
Copy link

Hi Guys, I think your barking up the wrong tree. If we are serious about HA we should be moving to LED, as its low power and just makes good sense. If we say YES, LED is the way to go then, everyone knows 240/110 VAC LEDs (driver and LED) are a bitch to work with and have mixed results, usually poor due to flicker etc. If we go back to electronics 101 a LED is a DC device and the best way to dim it is PWM of a suitable DC supply voltage 12/24/36 volts and the current is very low < 1-2 amps.
I recently approached Itead to provide a quotation to manufacture a T1 wall switch replacing the relay/s with Mosfet/s and a different power supply to drive the LEDs. The price was 7K USD for the proto types 1-2-3 gang and just a but to rich for an individual, but for a group ????
For the power supply we have 2 choices, power it with 240-95VAC and configure the output voltage for driving LEDs or just supply the switch with the DC voltage your LED requires. I have hacked a 3 gang T1 already by removing 3 component and install a 24vdc to 5vdc supply. Which works perfectly.
I have done many dimming trials with a H801 as it Mosfets switch the negative rail, I can remove the LED manufactures driver and power the LEDs directly using PWM giving perfect dimming 1 to 100%.
In short by combining these 2 products T1 and H801 you could end up with a great solution
What do you guys think?
Jason

@madjam002
Copy link

A dimmer would still be useful for some applications. I’d like to wire up my salt lamp which has a manual dimmer at the moment, and the bulbs for a salt lamp cannot be LED.

@jonathanschneider
Copy link

A dimmer would still be useful for some applications. I’d like to wire up my salt lamp which has a manual dimmer at the moment, and the bulbs for a salt lamp cannot be LED.

The same goes for Edison light bulbs.

This looks promising:

http://www.instructables.com/id/ARMTRONIX-WIFI-SINGLE-Dimmer-Board-V02/

I happened to order this before stumbling upon this thread. I'll let you know about it once I received it.

@checksummaster
Copy link

@nosaj66au
Copy link

Agree let me know how it goes.

@stanvv
Copy link

stanvv commented Apr 13, 2018

Any updates? I just ordered this one, since the seller told me there's an ESP8266 inside.

https://www.aliexpress.com/item/WiFi-LED-Dimmer-Switch-220V-110V-Dimming-Panel-Switch-Connected-To-Alexa-Google-Home-Voice-Control/32859257784.html?spm=2114

@reeso3000
Copy link

I ordered one like Stanvv and it arrived today. This is what it looks like inside if anyone is interested.

img_4201
img_4202
img_4203

@qingz2004
Copy link

Does it work without changing the firmware?

@reeso3000
Copy link

Yes it works without changing the firmware - Uses Smart Life app that is compatible with Alexa. The results are a bit mixed - it dims ok but the lights seem to flicker, I purchased dimmable leds (Gu10) to use in my kitchen and this is the result. Going to try it in my living room with B22 bulb to see if its any bettter.

@qingz2004
Copy link

qingz2004 commented Apr 30, 2018

I bought the same one from Aliexpress, but a US version.
https://www.aliexpress.com/item/WiFi-Light-Dimmer-Switch-Stepless-Dimming-Touch-Panel-Dimmer-Work-with-Alexa-Google-Assistant-IFTTT-White/32857809626.html
It did not response or dim to the +/- touch button on the plate, but it did (some how, but not smooth) with Smart Life app. The bulb flickers a lot once dimmed. I tried with both dimmable LED and incandescent bulb.
Even worse, after I tried a few times with phone app, the dimmer is completely dead. No response to anything. Only power cycle can fix it.
I believe the MCU STM8S103F3P6 does not work or is not properly programmed, since all the touch button signals and the cross zero interrupt signal go to the MCU, and the MCU generates the PWM.
I checked with a oscilloscope, the signals go into the MCU are perfect, but the PWM generated from the MCU is not.
ESP8266 here is to communicate with the phone, and transmit the command to the MCU through the serial port.
We might be able to bypass the MCU and use the ESP8266 to do everything.

@epicality85
Copy link

epicality85 commented May 7, 2018

I have the same one as @reeso3000. Im looking into modifying :D let us know if solve the issue.

They are available on Amazon UK for a fair price.

@stanvv
Copy link

stanvv commented May 11, 2018

Mine works fine with the standard app, but I'm trying to flash Tasmota. No success so far:

Got this schema of the ESP8266 by Hysiry, which is placed in the dimmer: https://fccid.io/2AKBPESP8266/User-Manual/User-Manual-3192780
I assume the schema at page 6 (3. Pin description) is flipped, see also page 13 (7. Minimum System Requirements).
I think I got it in programming mode by connecting ground with IO0, cause the left dimmer button lights up, while it doesn't light up when only connecting the programmer.
I soldered 4 pins to the board as follows. When switching 3v3 and ground it didn't power up, so I assume that is connected correctly.
wifi_module

But I get the 'standard' error:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I also tried to switch TX and RX, but that didn't work.

Anyone who can help?

@qingz2004
Copy link

qingz2004 commented May 11, 2018

On my US version, there is no pin hole for Tx Rx, but anyway the serial port from ESP8266 is connected to the MCU STM8S103F3P6 which I think also drives the bus. You may have to cut the trace (at least the Rx) between ESP8266 and MCU before you can flash the ESP8266.
I haven't tried that.
You may want to backup the image from the original ESP8266 before you flash it in case you want to go back, since Tasmota does not support it yet.

@qingz2004
Copy link

qingz2004 commented Nov 28, 2018

The Wiki for PS-16-DZ dimmer is created. Please feel free to modify and correct my bad English!

@chaosmaster
Copy link
Contributor

Thanks, I've just added the baudrate.
Looking at your description it looks like the ESPs reset-pin is connected to the MCU as well:

pin1 RST -> N76E003 P0.5/PWM2
pin2 TXD -> N76E003 P0.7/RXD
pin3 RXD -> N76E003 P0.6/TXD
pin4 GPIO13/MTCK -> LED
pin5 3.3V
pin6 GND

I still believe it should be possible to flash the ESP without desoldering. (which is also supported by the fact that you were able to dump the firmware before).

Could you try connecting the ESPs reset to 3.3v and the MCUs reset to GND (as well as the usual GPIO0 to GND) and see if that works?

@chaosmaster
Copy link
Contributor

@qingz2004, were you able to take a look?

@qingz2004
Copy link

qingz2004 commented Nov 29, 2018

I didn't try, but I measured the ESP reset is 3.3v when MCU reset is low. Will try to flash the other one tonight.
EDIT: Just tried, it actually works.

@chaosmaster
Copy link
Contributor

@qingz2004 Just now saw your edit. Could you please add the information to the flashing-instructions in the wiki?

@qingz2004
Copy link

It's not reliable. It didn't work with my third dimmer. Still need to remove the ESP8285 card from the main PCB.

@chaosmaster
Copy link
Contributor

That's interesting, I wonder, what else could cause it not being flashable.

@qingz2004
Copy link

And I am pretty sure the esp8285 was in flash mode, or the led would blink.

@chaosmaster
Copy link
Contributor

chaosmaster commented Dec 6, 2018

I suppose the issue must be with the serial lines then.
Maybe the MCU isn't in reset properly for some reason.
EDIT: or a power issue

@bigcookie
Copy link

bigcookie commented Mar 28, 2019

Hi, I found a new nice looking dimmer, which I would like to get supported. I tried the Tuya module, but it is not working. Original firmware was backed up. Issues described here:
#5541
Any help is appreciated...

@qingz2004
Copy link

qingz2004 commented Mar 28, 2019

@bigcookie Tried different pair of Rx/Tx as in the wiki. If that doesn't work, you have to capture the UART frames with stock firmware.

@bigcookie
Copy link

Is there any good software to capture UART packages?

I checked the circuitboard and the original RX/TX pins from ESP module are used to connect to MCU... Thus the configuration regarding the serial interface should be the same. Will check again to be sure.

@bigcookie
Copy link

bigcookie commented Mar 28, 2019

Hello @qingz2004 , I took a look and found the following:

  • Tuya smart app is being used also for this dimmer and it works (assumes that this is somehow Tuya based or copied)
  • ESP module is not listed on Tuya as it is HYLE2S - though the naming is similar
  • the backup firmware works fine (attached in the next post), but requires the MCU to be present as the MCU needs to send a command to bring the ESP into a pairing mode or something similar... Otherwise I cannot get it connected to the app.
  • I checked the protocol from Tuya: https://docs.tuya.com/en/mcu/mcu-protocol.html
    -> a similar(!) protocol is used, but not(!) the same. The header is different, but it looks similar and checksum is calculated the same way (sum all bytes, divide by 256 and keep the rest in the last byte).
  • Ah - before I forget: Standard RX/TX used for flashing is used for communication with the MCU...

Grabbing some of the commands, I see the different format - the following is switching on/off and dimming, initiated by the app and captured - if I remember, switching 0ff, then dimming up and down and switching off.:

65AA000105000000000015 -> switching off
65AA000105000000740089
65AA00010500000075008A
65AA00010500000077008C
65AA0001050000007A008F
65AA0001050000007C0091
65AA0001050000007F0094
65AA000105000000810096
65AA000105000000830098
65AA000105000000840099
65AA00010500000085009A
65AA00010500000086009B
65AA00010500000087009C
65AA00010500000089009E
65AA0001050000008B00A0
65AA0001050000008D00A2
65AA0001050000008E00A3
65AA0001050000008F00A4
65AA0001050000009100A6
65AA0001050000009200A7
65AA0001050000009300A8
65AA0001050000009300A8
65AA0001050000009500AA
65AA0001050000009600AB
65AA0001050000009700AC
65AA0001050000009800AD
65AA0001050000009900AE
65AA0001050000009A00AF
65AA0001050000009A00AF
65AA0001050000009B00B0
65AA0001050000009B00B0
65AA0001050000009D00B2
65AA0001050000009E00B3
65AA000105000000A000B5
65AA000105000000A100B6
65AA000105000000A200B7
65AA000105000000A400B9
65AA000105000000A400B9
65AA000105000000A500BA
65AA000105000000A600BB
65AA000105000000A800BD
65AA000105000000A900BE
65AA000105000000A900BE
65AA000105000000A900BE
65AA000105000000AA00BF
65AA000105000000AC00C1
65AA000105000000AD00C2
65AA000105000000AE00C3
65AA000105000000B000C5
65AA000105000000B100C6
65AA000105000000B200C7 -> full brightness
65AA000105000000B000C5
65AA000105000000AE00C3
65AA000105000000AD00C2
65AA000105000000AC00C1
65AA000105000000AC00C1
65AA000105000000AA00BF
65AA000105000000A900BE
65AA000105000000A800BD
65AA000105000000A600BB
65AA000105000000A500BA
65AA000105000000A400B9
65AA000105000000A200B7
65AA000105000000A100B6
65AA000105000000A000B5
65AA0001050000009E00B3
65AA0001050000009D00B2
65AA0001050000009B00B0
65AA0001050000009A00AF
65AA0001050000009900AE
65AA0001050000009700AC
65AA0001050000009600AB
65AA0001050000009500AA
65AA0001050000009300A8
65AA0001050000009200A7
65AA0001050000009100A6
65AA0001050000008F00A4
65AA0001050000008E00A3
65AA0001050000008D00A2
65AA0001050000008B00A0
65AA00010500000089009E
65AA00010500000086009B
65AA000105000000840099
65AA000105000000810096
65AA0001050000007F0094
65AA0001050000007C0091
65AA0001050000007A008F
65AA00010500000077008C
65AA00010500000075008A
65AA000105000000720087
65AA0001050000006F0084
65AA0001050000006D0082
65AA0001050000006A007F
65AA00010500000068007D
65AA00010500000065007A
65AA000105000000630078
65AA000105000000600075
65AA0001050000005E0073
65AA0001050000005B0070
65AA00010500000059006E
65AA00010500000056006B
65AA000105000000540069
65AA000105000000510066
65AA0001050000004E0063
65AA0001050000004C0061
65AA00010500000049005E
65AA00010500000047005C
65AA000105000000440059
65AA000105000000420057
65AA000105000000440059
65AA000105000000440059
65AA000105000000000015 -> switching off

As it seems there is only one command, which is used to set brightness as well as switching all off...

It would be great, if we could add this support to Tasmota. I didnt succeed in capturing the full command/response exchange.
Would somebody be willing to implement the different protocol, if I get the commands?

thanks...

@qingz2004
Copy link

@bigcookie Ask @chaosmaster to include your dimmer in his code.

@bigcookie
Copy link

In case people are interested:
The above the control protocol. You just have to send the values to the MCU and brightness is adjusted - there is no confirmation coming from the MCU. It is the "dumb dimmer circuit".
Actually the values for dimming work from 0-256.

Downside: The ESP is handling everything else including the faceplate. I am not sure how this is done with Tuya. I will figure this out more.
What I found until now:
-GPIO12 is the main button and will be pulled to ground on press. This turns the dimmer on/off, whereby "on" means switch back to latest known brightness - which is kept within the ESP8266.

I will check further on reading and setting the LEDs on the faceplate. For now I know that an HC164 is used to set the LEDs and the serial input I will check.
The faceplate driver is connected via one line to the ESP, which I assume is using the ADC at the moment.

@bigcookie
Copy link

A few more findings:

brightness value:
0x00= 0 => off
0x44= 68 => min brightness, default (limit in original firmware)
0xB2=178 => max brightness, default (limit in original firmware)
0xFF=256 => works, max

Enlight the LEDs on the faceplate. There are 8 LEDs, powered by a HC164 shifting register IC. Minimal 1 is on always, all off, when bulb is off:
GPIO13 -> Clock HC164
GPIO14 - Serial A input for Faceplate LEDs.
-> when I unplug = all lights on.

Touch input from faceplate to ESP... I dont know how this works. The IC to drive the capacitive reading as no imprint on it. It seems that two GPIOs are mainly used to get the reading:
GPIO04 & GPIO5 - Input from touch faceplate
-> unplug one, no more readings from faceplate, but dimming etc still works

Main Switch button. Turns on/off the light. When holding it 5s, the device goes into pairing mode in which the app is sending the Wifi credentials via (I guess) some Wifi packages...
GPIO12 - button, on/off and Wifi setup (5s push)

The ESP module has 2 more pins, marked as AD and RST.
AD - disconnecting it seems to have no impact
RST - disconnecting it seems to have no impact

@chaosmaster : Can you help with some insights on the Tuya faceplate? Is this powered by the MCU? Based on the information I assume so.
If I provide more details, would you be able to help coding this into Tasmota?

@digiblur
Copy link
Contributor

digiblur commented Apr 7, 2019

@chaosmaster or anyone else that might see this. I ran into a new upgraded version of a dimmer I've used in the past. It uses the same modules as this dimmer along with the RX/TX pins this one has: https://github.com/arendst/Sonoff-Tasmota/wiki/Tuya-Dimmer#charging-essentials-from-costco

One odd thing was the red LED would pulse on and off every 5-10 seconds. I did a few live streams of tearing it down and sniffing the RX/TX lines to see what the communications were on the stock firmware. Long story short the secondary MCU just needs to know the ESP8266 is alive with the heartbeat packet every so often. The stock firmware sends it every 10 seconds and the secondary MCU will be happy as long as it is sent every 17-18 seconds. I do remember the other dimmers also sending this heartbeat packet with stock firmware. I have this running on 3 different dimmers without any adverse affects on the older dimmers.

I was wondering if any of you could try this on different versions of Tuya Dimmers. I do have a precompiled bin with it based on 2.3.0 core and 6.5.0 Tasmota.

Changes done: digiblur@3dcea9d

and bin: https://github.com/digiblur/Sonoff-Tasmota/blob/development/bins/Tasmota_6.5.0(digiDIMv6).bin

@blapplications
Copy link

Only in German, but google can translate
https://ex-store.de/2-Kanal-RS232-Dimmer-Modul-V4-fuer-Unterputzmontage-230V-3A
they have also the relay version (currently sold out)
https://ex-store.de/ESP8266-WiFi-Relay-V31

Which module type do I have to use?

@phatina
Copy link

phatina commented Sep 11, 2019

Shelly Dimmer! Looking forward to seeing a support for this device.

@adhossain
Copy link

I ordered one like Stanvv and it arrived today. This is what it looks like inside if anyone is interested.

img_4201
img_4202
img_4203

I got a same device for my fan speed controller, however It says it is not compatible for light.
Anyway, I was not able to configure it with the app. The device does not go into pairing mode. (in pairing mode the led supposed to blink rapidly). The led always blinks slowly. The touch buttons work properly.
So I decided, if I can flash a custom firmware and use it.

Eagerly waiting if there is any solution.

@froido
Copy link

froido commented Nov 16, 2019

Shelly Dimmer! Looking forward to seeing a support for this device.

Is there a tasmota module / template for Shelly Dimmer?

@phatina
Copy link

phatina commented Nov 17, 2019

Shelly Dimmer! Looking forward to seeing a support for this device.

Is there a tasmota module / template for Shelly Dimmer?

Dunno, I would like more experienced guys to help here :)

@kovaga
Copy link

kovaga commented Nov 26, 2019

I've ordered couple of Shelly Dimmers recently, so looking forward to having Tasmota installed on both of them. I would gladly help with testing.

@SwedishChef
Copy link

please see also #6914

@Jeffrey-Wayers
Copy link

Jeffrey-Wayers commented Jan 14, 2020

Sonoff released a dimmer, finally. Does anyone knows if this is Tasmota compatible? And if so, could you still use the RF remote control?

https://www.itead.cc/smart-home/sonoff-d1-smart-dimmer-switch.html

@qingz2004
Copy link

@chaosmaster The WiFi LED shows wrong state after one or two days. I have to reset the device to get it corrected. Is it ok to set it periodically instead of setting it only before the ack is recevied? Or can I manually set the LED so I can have it set in a rule once a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on
Projects
None yet
Development

No branches or pull requests