arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.24k stars 4.81k forks source link

Support for Sonoff D1 Dimmer #7598

Closed klotzma closed 4 years ago

klotzma commented 4 years ago

Have you looked for this feature in other issues and in the docs?

Yes

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

I cant't find a Template for this Device.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Sonoff has released a new dimmer, the Sonoff D1 dimmer. Is Tasmota compatible with this dimmer, if not, is it possible to add it?

Thanks Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered. Only Support. Additional context
Add any other context or screenshots about the feature request here. 1579955221551916829968913932071 1579955250365492535689669968940

(Please, remember to close the issue when the problem has been addressed)

brazil83 commented 4 years ago

hi, i flashed sonoff d1 with tasmota 8.2, then i selected module type "sonoff D1 (74)"... but when i connected the dimmable bulb, its always on, even if i switch it off or on, and dimming is not doing anything... is there anything wrong, is tasmota 8.2 contains the modifications to support sonoff d1?.. am i missing any configuration other than what i mention earlier?...thanks

robbz23 commented 4 years ago

@brazil83 I am not sure that 8.2 has it yet. Checkout the dev branch and compile it. I used VS code way with PlatformIO.

FourFoot commented 4 years ago

I used Tazmotizer with the "release" option selected (8.2.0), works fine - probably the easiest sonoff device I've flashed with Tasmota - all of them worked first time. Also, been 48hrs since I removed C4 and C11, so far no ghost switching.

kugelkopf123 commented 4 years ago

@brazil83 As far as I see it in the current devbranch it is enabled by default: https://github.com/arendst/Tasmota/blob/bb1dcd95c84f466b6eb401b39cba5fb9420ecf0c/tasmota/my_user_config.h#L423

@FourFoot Great to hear! Are you able to measure the capacitance of the two capacitors? And perhaps take some photos to have a look for what, if not for the antenna, were these capacitors intended?

FourFoot commented 4 years ago

@FourFoot Great to hear! Are you able to measure the capacitance of the two capacitors? And perhaps take some photos to have a look for what, if not for the antenna, were these capacitors intended?

I've discarded the capacitors unfortunately so can't measure them, and the units are now in their final places which are annoying to get to, so can't photo the board in more detail. If I have to get them out again for some reason, I'll take some photos if someone else doesn't.

robbz23 commented 4 years ago

@FourFoot but you dont have the remote correct? i dont want to loose the function of the remotes so I am not sure this will work for me.

FourFoot commented 4 years ago

@robbz23 - that's right, I don't have the remote and don't use the 433Mhz functionality - all my control is MQTT over WiFi. If you need the 433Mhz functionality, this fix probably isn't for you :-(

Patrick-Lenz commented 4 years ago

Do I have to use a remote control with more than two buttons to control the D1?

sandeep-ma commented 4 years ago

As far as my knowledge goes, no other remote control will work. I purchased a 3 button remote where one button is for min or long press for dim and one button for max or long press to brighten and one button for on/off toggle. Unfortunately they played a trick on us and don't support on/off toggle, instead they implemented a non-standard separate button for 'off', so my remote can do everything but turn off... does not sound like a very useful remote option... unless you could reprogram the EFM8 to do whatever you want... someone here mentioned before that the RC interacts with the EFM8.

sandeep-ma commented 4 years ago

@FourFoot but you dont have the remote correct? i dont want to loose the function of the remotes so I am not sure this will work for me.

I checked the ones I had desoldered... found nothing printed on them. And furthermore, like I mentioned previously, the remote continued to work even after removing them.

cdntinker commented 4 years ago

U1 & U2 are the RF system. U1 seems to be a microcontroller. U5 (our favourite ESP chip...) is the WiFi system. U3 is a microcontroller that handles the actual work of controlling the HV side of the unit.

sandeep-ma commented 4 years ago

U1 & U2 are the RF system. U1 seems to be a microcontroller. U5 (our favourite ESP chip...) is the WiFi system. U3 is a microcontroller that handles the actual work of controlling the HV side of the unit.

That's a lot of MCUs... pretty complicated circuit, but unfortunately still does not work properly. My house is connected to the Internet over a flaky fixed wireless LTE connection, and I am pretty certain that the issues I am having are related to that. And also, they gave so much real estate to the 433 antenna and next to nothing for the WiFi antenna, so I also wonder, what is the net effect of that as far as stability goes. Maybe once the external antennas that I have ordered show up, I will know better as to how much help they are. I am an ardent believer in cloud / iot based smart homes and against this legacy 'local hub' based approach of tasmota, but maybe I will have to resort to this eventually, if nothing else works... at least for SOnOff D1. I did hub based automation in my home 20 years ago with X10, it does not make sense to me in this day and age.

But for now, I removed all the 3 D1s that were misbehaving in my living room and replaced with plain old slide dimmers. I used to have X10 dimmers even before the slide dimmers, but removed them when all my X10 switches stopped working... it seems like all the circuitry in LED lamps killed my X10 completely. It was really so cool, otherwise, with all the ladder logic capabilities that were so so ahead of IFTTT, and that too, a couple of decades ago.

cdntinker commented 4 years ago

So... you're saying (on the Tasmota github) that your cloud-based IoT is acting up with a crappy Internet connection?

sentiment-bot[bot] commented 4 years ago

Please be sure to review the code of conduct and be respectful of other users. Keep in mind, this repository uses the Contributor Covenant.

sentiment-bot[bot] commented 4 years ago

Please be sure to review the code of conduct and be respectful of other users. Keep in mind, this repository uses the Contributor Covenant.

sandeep-ma commented 4 years ago

So... you're saying (on the Tasmota github) that your cloud-based IoT is acting up with a crappy Internet connection?

Ha ha... true. But this is only with D1. The Sonoff basics are working fine and the Gosund's are simply awesome

kumy commented 4 years ago

R6 R7 R8 R9 + R11 R12 R13 R14 removed, let's see how it goes

kumy commented 4 years ago

No ghost switching for 17h now :+1: yeah!!!

BTW: the light sizzle while dimming it's annoying - I don't remember to have that with my old non connected yokis mtr500e. Also, is there a way to configure switch-on/off dimming timing to speed it up?

EDIT: > 24h still ok EDIT: > 48h still ok @kugelkopf123 solution seems to work fine https://github.com/arendst/Tasmota/issues/7598#issuecomment-602525777

kugelkopf123 commented 4 years ago

Does anyone else have the data sheets for the MCUs? U1 U2 U3? Or at least the names? They are hard to recognize on the pictures.

I suspect that it is actually due to these voltage dividers in the serial connection. It would have been smarter if they had just put a voltage translator in there. @kumy What values did the resistors have?

cdntinker commented 4 years ago

U1 | Eastsoft ES7P001FGSA GS34BFN404 | 8-bit MCU U2 | 590R 1933 | Probably the RF chip U3 | BB10 F8G A01J1J 1939 A | 8-bit MCU U5 | ESP8285

(awkwardly copied from my local lab notes wiki server...)

kumy commented 4 years ago

R11 to R14 are 330 ohms My both multimeters refuse to read R6-R9 values.

With some back light, here is the diagram at this part of the circuit. IMG_20200327_233753

kumy commented 4 years ago

@kugelkopf123 R6-R9 are 10k

kugelkopf123 commented 4 years ago

I have looked at the data sheets but I can't see the reason for this resistance orgy. The resistors do not fit as a voltage divider. Also it is not to be recognized in which kind U1 communicates with U2. This can be via UART like U3 ->U2 or i2c or SPI. Because of the 4 lines I would now simply throw SPI into the room. J4 seems to be an I2C or Uart programming or debug interface for the BB10.

I hope I am allowed a short offtopic question, I seem to have a defect in Shelly1. Obviously this second stage buck converter is defective "WBB0Q" or "W880Q" SOT23-6. 12V->3.3V. Does anyone know what model or manufacturer it is? Can't find anything on the internet. Does anybody have an idea?

IMG_5243

Patrick-Lenz commented 4 years ago

So, I've now removed the resistors. The dimmer can no longer be controlled via Alexa. The slider no longer works in the web interface. I can only switch on and off in the web interface. Everything works great via the console and also via IObroker. The RF function is no longer available, but there is no ghost switching anymore. I'm not really happy with it yet :-/

kugelkopf123 commented 4 years ago

So, I've now removed the resistors. The dimmer can no longer be controlled via Alexa. The slider no longer works in the web interface. I can only switch on and off in the web interface. Everything works great via the console and also via IObroker. The RF function is no longer available, but there is no ghost switching anymore. I'm not really happy with it yet :-/

I don't think that the operation via Alexa has anything to do with the resistors. According to the data sheet, the U1 is a data buffer for the commands received via 433mhz RF. Above all, the fact that everything works as you say via iobroker and webinterface, makes me think that the problems you have are of a different origin.

hvbommel commented 4 years ago

FYI ... I received my Sonnof DYI D1 Smart Dimmer Switch today. I put Tasmota 8.2.0 firmware on it and configured it as a "Sonoff D1" type and setup MQTT and domoticz as usual. I made NO dimmer hardware modifications. I can control it from MQTT, from Domoticz, from Node-red (MQTT) and the Tasmota Web GUI. For completeness: In Domoticz I created a new Dummy/Selector switch. I am sending commands like "http://192.168.1.8/cm?cmnd=dimmer 40" to the dimmer. From MQTT I am doing a publish "cmnd/D1_1/DIMMER 25" for example. It all works as advertised.

kugelkopf123 commented 4 years ago

FYI ... I received my Sonnof DYI D1 Smart Dimmer Switch today. I put Tasmota 8.2.0 firmware on it and configured it as a "Sonoff D1" type and setup MQTT and domoticz as usual. I made NO dimmer hardware modifications. I can control it from MQTT, from Domoticz, from Node-red (MQTT) and the Tasmota Web GUI. For completeness: In Domoticz I created a new Dummy/Selector switch. I am sending commands like "http://192.168.1.8/cm?cmnd=dimmer 40" to the dimmer. From MQTT I am doing a publish "cmnd/D1_1/DIMMER 25" for example. It all works as advertised.

Perhaps already an new reversion ?

cdntinker commented 4 years ago

hvbommel Just for curiosity sake... Look at the back of the Low-Voltage board. Version number & date?

hvbommel commented 4 years ago

Version: D1 WIFI V1.1 Date: 2019-09-27 Sonoff-D1

cdntinker commented 4 years ago

Definitely the original revision.

sandeep-ma commented 4 years ago

A new oem firmware just arrived

Drew765 commented 4 years ago

OEM as in SOnOff?

sandeep-ma commented 4 years ago

Yeah :) , and there is a major release of ewelink also, making it look more like SmartLife

tasbarba commented 4 years ago

Hi everbody. I just got my D1 today but I'm not being able to flash the Sonoff. I think all the soldering and connections are fine (3.3V, TX, RX, GND and GPIO 0 to GND). The led doesn't blink when I power up the device, but when I run the esptool.py command, not happens. It stays trying to connect until timeout. Any clues? Thank you!

hvbommel commented 4 years ago

Did you Connect GPIO-0 to GND for just 2 seconds or so when you apply power and then open GPIO-0 after that? Also do yopu have crossed tx-rx connections? (I did receive my second D1 last week, it works fine. So I have 2 now, both are fine)

tasbarba commented 4 years ago

Yes, I connected GPIO-0 to my serial GND adapter, and crossed tx-rx connections (D1 TX -> RX Serial Adapter and D1 RX -> TX Serial Adapter). I'm also holding GPIO-0 for a couple of seconds when applying power.

kugelkopf123 commented 4 years ago

Shure your power supply/FTDI adapter has enough power?

Many cheap adapter haven’t enough power.

hvbommel commented 4 years ago

When I programmed mine I took the highvoltageboard off and programmed it with just the logicboard connected to my FTDI adapter.

oederp1 commented 4 years ago

Where is the GPIO on this device?

rengaboy commented 4 years ago

@oederp1 a little pogo pad numbered “0” near the chip. 24570BD8-E860-4EE7-8E32-02D152496E25

ghost commented 4 years ago

Hi all

I also have an issue flashing my 3 units.

In which position must the OTA switch be when flashing ? Does it matter ? What is the baudrate used for flashing ?

I use NodeMCU PyFlasher, 115200, DOUT, WIPE ALL. Am I doing something wrong ?

When I apply power with GPIO0 grounded, LED does not light up. When I start the sonoff normally, I'm not able to read the serial (I only get garbage), and not output at all at 115200 bps.

I'm using a MEGA 2560 with RESET to GND to flash. On 2560, when D1 is "normally" on, the TX led flashes. When trying to flash, the RX led flashes. 2560 RX is connected to D1 RX.

The orange breadboard wire is the wire I use to ground GPIO0 when applying 3.3v.

20200418_132533

NO luck so far...

kugelkopf123 commented 4 years ago

Hi all

I also have an issue flashing my 3 units.

In which position must the OTA switch be when flashing ? Does it matter ? What is the baudrate used for flashing ?

I use NodeMCU PyFlasher, 115200, DOUT, WIPE ALL. Am I doing something wrong ?

When I apply power with GPIO0 grounded, LED does not light up. When I start the sonoff normally, I'm not able to read the serial (I only get garbage), and not output at all at 115200 bps.

I'm using a MEGA 2560 with RESET to GND to flash. On 2560, when D1 is "normally" on, the TX led flashes. When trying to flash, the RX led flashes. 2560 RX is connected to D1 RX.

The orange breadboard wire is the wire I use to ground GPIO0 when applying 3.3v.

20200418_132533

NO luck so far...

Never done it with an Arduino so far. Hope you are using the 3,3V not 5V And doesnt it need a capatiator between GND-RST for flashing? Another question is: is it an Arduino clone? On the picture there is a LDO (i think) right between the brown and purple wire. It looks a bit like this case: Reddit Link So, perhaps thats the cheap chip, it could be, that the chip doesnt deliver enogh power for both PCBs. Not just in this case, also with all other things to flash, like sonoffs, shelly etc. I recommend a good FTDI or USB2Serial Adapter with a dedicated powersupply on the Adapter. Just a LDO like an original ME6211c or AMS1117.

ghost commented 4 years ago

I was able to flash 10 Sonoff Basic with that board, using this procedure, so I think I'm doing something wrong with GPIO0.. Power supply is ok since it works correctly when booted normally (I get a SSID and can connect to it, no http tho)

hvbommel commented 4 years ago

I just did it again on one of my Sonoff dimmer D1's so that I am sure I give you proper instructions. 1. I am using the tasmotizer-1.1.exe windows tool. 2. You can not set the baudtrate so that is the default: 115200. 3. I connected GND to GPIO-0 as usual until 1 second after powerup. (the middle test-pad on the board in the corner of the chip) 4. I selected the port (com3: in my case) and the firmware.bin file. 5. I then clicked "Tasmotize!" 5. I configured the firmware afterwards to select the "Sonoff D1 (74)" and other settings as usual after connecting to the ip address of the dimmer. 6. That is all, it just works, no tricks. Sonnof D1 setup

ghost commented 4 years ago

What is the LED behavior when you start your D1 in flash mode?

kugelkopf123 commented 4 years ago

I was able to flash 10 Sonoff Basic with that board, using this procedure, so I think I'm doing something wrong with GPIO0.. Power supply is ok since it works correctly when booted normally (I get a SSID and can connect to it, no http tho)

One does not exclude the other. The WemosD1Mini Clones work most of the time. Until you connect something on the 3,3V. I have wemos d1 mini boards (>10) with the fake LDO that work great and I have boards that look identical, but produce garbage. But all of them have one thing in common, as soon as I unsolder the fake LDO and swap it with the original one they all work fine. The bad thing about the bugs that the clones with the cheap chip produce, are very different. Some of them don't start at all, others have problems with WIFI, others work fine at first and after a few hours they are no longer accessible or restart sporadically. Still others have a stable WIFI connection but problems with MQTT. In general you can't just dismiss the problem. It exists and many of the problems that are described in the issues have their origin there.

hvbommel commented 4 years ago

@JeanneD4RK you asked: "What is the LED behavior when you start your D1 in flash mode?" Answer: I dont remember & I can not easilly try again now.

ghost commented 4 years ago

I was able to flash 10 Sonoff Basic with that board, using this procedure, so I think I'm doing something wrong with GPIO0.. Power supply is ok since it works correctly when booted normally (I get a SSID and can connect to it, no http tho)

One does not exclude the other. The WemosD1Mini Clones work most of the time. Until you connect something on the 3,3V. I have wemos d1 mini boards (>10) with the fake LDO that work great and I have boards that look identical, but produce garbage. But all of them have one thing in common, as soon as I unsolder the fake LDO and swap it with the original one they all work fine. The bad thing about the bugs that the clones with the cheap chip produce, are very different. Some of them don't start at all, others have problems with WIFI, others work fine at first and after a few hours they are no longer accessible or restart sporadically. Still others have a stable WIFI connection but problems with MQTT. In general you can't just dismiss the problem. It exists and many of the problems that are described in the issues have their origin there.

This is an LN1134 (4A2D), which sould provide 300mA, more than enough isn't it ?

ghost commented 4 years ago

Ok I was able to flash the 1st one, using a nocemdu clone (CH340G), with the same process : Reset to GND, RX on RX, TX on TX and using the board 3v3. Maybe the serial signal were in 5v on the 2560, wich was not pleasing the D1.

(Thanks for showing me the rubber band technique !!)

20200418_181803

jkimmel commented 4 years ago

FYI ... I received my Sonnof DYI D1 Smart Dimmer Switch today. I put Tasmota 8.2.0 firmware on it and configured it as a "Sonoff D1" type and setup MQTT and domoticz as usual. I made NO dimmer hardware modifications. I can control it from MQTT, from Domoticz, from Node-red (MQTT) and the Tasmota Web GUI. For completeness: In Domoticz I created a new Dummy/Selector switch. I am sending commands like "http://192.168.1.8/cm?cmnd=dimmer 40" to the dimmer. From MQTT I am doing a publish "cmnd/D1_1/DIMMER 25" for example. It all works as advertised.

Just flashed my first D1. How did you setup Domoticz as well as MQTT?