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

Support for Sonoff D1 Dimmer #7598

Closed
klotzma opened this issue Jan 25, 2020 · 365 comments
Closed

Support for Sonoff D1 Dimmer #7598

klotzma opened this issue Jan 25, 2020 · 365 comments
Assignees
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended good tip Type - Very useful information

Comments

@klotzma
Copy link

klotzma commented Jan 25, 2020

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)

@mikenivato
Copy link

Was wondering the same thing...

@ascillato
Copy link
Contributor

Please, provide photos of the internal board.

@ascillato2 ascillato2 added awaiting feedback Action - Waiting for response or more information question Type - Asking for Information labels Jan 25, 2020
@klotzma
Copy link
Author

klotzma commented Jan 25, 2020

20200125_195530
20200125_195548
20200125_195617
20200125_195653

@ascillato2 ascillato2 added Currently unsupported device feature request (devs?) Action - awaiting response from developers help needed Action - Asking for help from the community Requires more research (devs) Action - Issue requires more research and removed awaiting feedback Action - Waiting for response or more information question Type - Asking for Information labels Jan 25, 2020
@ascillato2
Copy link
Collaborator

Thanks. Really good photos.

This device has an ESP8285 so Tasmota can be flashed but as it has also some extra circuitry, a reverse engineering is needed to make or adapt a driver for that.

@arendst
Copy link
Owner

arendst commented Jan 25, 2020

I love the OTA switch

@digiblur
Copy link
Contributor

I have one flashed with Tasmota myself. I tried all the GPIO pins as relays and that doesn't seem to do anything. Pretty easy to flash and didn't even have to solder or mess with the stupid DIY mode. Pins were open and GPIO 0 is broken out to a pad for you to touch to ground while applying power.

@kugelkopf123
Copy link
Contributor

I have one flashed with Tasmota myself. I tried all the GPIO pins as relays and that doesn't seem to do anything. Pretty easy to flash and didn't even have to solder or mess with the stupid DIY mode. Pins were open and GPIO 0 is broken out to a pad for you to touch to ground while applying power.

There is no relay on this board. It’s just a power mosfet. That mosfet controls the voltage for the high side output. Under the mosfet is an optocoppler that is linkt to the control pin of the header. So, I think there Must Be some kind of analog signal to control this coppler.

But I ask myself, for what is this Buzzer?

@klotzma
Copy link
Author

klotzma commented Jan 26, 2020

I have one flashed with Tasmota myself. I tried all the GPIO pins as relays and that doesn't seem to do anything. Pretty easy to flash and didn't even have to solder or mess with the stupid DIY mode. Pins were open and GPIO 0 is broken out to a pad for you to touch to ground while applying power.

There is no relay on this board. It’s just a power mosfet. That mosfet controls the voltage for the high side output. Under the mosfet is an optocoppler that is linkt to the control pin of the header. So, I think there Must Be some kind of analog signal to control this coppler.

But I ask myself, for what is this Buzzer?

The dimmer can also RF 433Mhz. There is a remote control for the dimmer, the instruction manual says that if you connect the remote control to the dimmer, the dimmer beeps briefly.

@digiblur
Copy link
Contributor

@kugelkopf123 yep, that's why I tried the relay pins to see if we needed to do PWM but alas no... thinking maybe some sort of serial signal to another chip but I haven't googled the other ones yet.

@robbz23
Copy link

robbz23 commented Jan 27, 2020

I have some better pictures posted here and here. I have traced Tx and Rx from the ESP chip through a 1k resistor and to the pads that are labeled the same close to the BB10. When I grounded them it stopped being able to dim. So I think you are right that it uses serial to tell the MCU how to dim. This is similar to what Tuya does. How can I monitor the serial lines so I can see what is being sent over them while I am dimming?

@sfromis
Copy link
Contributor

sfromis commented Jan 27, 2020

How can I monitor the serial lines so I can see what is being sent over them while I am dimming?

If it is plain old serial communication, one-way sniffing should work with just a normal USB/serial adapter (like also usable for flashing), and possibly experiment to find the right bit rate.

@thxthx0
Copy link

thxthx0 commented Jan 31, 2020

Hi, what about https://templates.blakadder.com/sonoff_D1.html ?
seems to work simply with TRIAC and PWM...

but TRIAC = leading edge = 🤕

@Jeffrey-Wayers
Copy link

Hi, what about https://templates.blakadder.com/sonoff_D1.html ?
seems to work simply with TRIAC and PWM...

but TRIAC = leading edge = 🤕

Does anyone know if this works? Not so experienced with templates so scared to try it before knowing if it works.

@mikenivato
Copy link

Any luck with this or outlook on it... I would help but don't know where to look.

Currently waiting to pull the trigger either on the Sonoff D1 or Shelly Dimmer

@digiblur
Copy link
Contributor

That's a negative, I figured it wouldn't work as I tried a relay output on it and nothing. I tried this PWM template and nothing comes out of it.

@sandeep-ma
Copy link

Are you using an oscilloscope to test?

@digiblur
Copy link
Contributor

Tried and true old school light bulb.

@sandeep-ma
Copy link

sandeep-ma commented Jan 31, 2020

I feel that the high voltage board is the equivalent of this
https://robotdyn.com/ac-light-dimmer-module-1-channel-3-3v-5v-logic-ac-50-60hz-220v-110v.html
There is a lot of documentation from RobotDyn on how to use it with a generic microprocessor. The low voltage board probably supplies the PWM and ZCD, so here we are talking about high frequency digital pulses, maybe not as simple as a simple switch.

Here is lib for that module with esp code, should be very similar for D1
https://github.com/RobotDynOfficial/RBDDimmer

@sandeep-ma
Copy link

sandeep-ma commented Feb 1, 2020

I confirmed that sending 3.3v to buzzer pin turns on a buzzer... cute.

I don't intend to flash it with hub based firmware as I prefer IOT mode without hub. But what I am struggling with is how to turn it on and off locally. I tried shorting each pin to 3.3v or ground, but only one pin (c2ck) turns it off when grounded and nothing turns it on. On the sonoff basic, I have been using this approach for hooking up capacitive touch sensors by sending ground pulse to the reset button. I do need a way to be able to physically turn these on and off, without remote. Really strange that they got rid of the reset button. Is there gpio that I could use as a reset button?

@cdntinker
Copy link

It's not gonna be a matter of figuring out which I/O does what.
The ESP8285 talks to a second MCU (a Silicon Labs BB10) through the serial lines.
The BB10 chip controls the high voltage board.

@Gravitate1
Copy link

It seems odd that Sonoff would make the D1 so easy to flash a DIY firmware, but then make it difficult to actually control the dimmer from that firmware.

@sfromis
Copy link
Contributor

sfromis commented Feb 2, 2020

It seems odd that Sonoff would make the D1 so easy to flash a DIY firmware

They did'nt. No DIY mode (which sucks anyway), they just did not go out of their way to make flashing hard. While it would have been nice of Itead to publish tinkering info, that is just not priority in a tiny market.

@oywino
Copy link

oywino commented Nov 2, 2023

I just bought a Sonoff D1 and it came with a 433MHz remote control.
Is it possible to control the D1 with this remote control without first registering the D1 to the Sonoff cloud at all and never use the EWLink App?

@sandeep-ma
Copy link

I just bought a Sonoff D1 and it came with a 433MHz remote control. Is it possible to control the D1 with this remote control without first registering the D1 to the Sonoff cloud at all and never use the EWLink App?

Sorry to hear that you bought Sonoff D1, it is trash. I purchased about ten of them few years back and am slowly replacing them with Moes Tuya Smart double-din dimmers that you can find on Ali

But to answer your question, yes you can use it with the remote or with other compatible smart RF learning remote hub without wifi

@420pootang69
Copy link

420pootang69 commented Nov 2, 2023 via email

@fapoo
Copy link

fapoo commented Nov 2, 2023

Never had any problems with it either. Runs absolutely flawlessly.

@sandeep-ma
Copy link

They are too bright even at 0%
They go on in the middle of the night due to no reason
Very bulky
Cannot use same login from multiple devices
Access is restricted by world regions; same user cannot access switches in north america and asia
More expensive
Higher failure rate


@fapoo
Copy link

fapoo commented Nov 2, 2023

I concretize. I have flashed it with tasmota and no problems at all. Ghost switching was already discussed in detail.
Is there any statistics about the failure rate?

@420pootang69
Copy link

420pootang69 commented Nov 2, 2023 via email

@sandeep-ma
Copy link

I concretize. I have flashed it with tasmota and no problems at all. Ghost switching was already discussed in detail. Is there any statistics about the failure rate?

I did not mean to imply an industry wide failure rate analysis. Just my own experience with about 10 of these and about 10 of the other one.

Regarding ghost switching, I am aware that it starts occuring after a power outage. And can be fixed by resetting the RF remote. In my case, there is one that is not getting reset at all. Moreover, why take on that headache when you can get something better for less.

@oywino
Copy link

oywino commented Nov 3, 2023

Well, whether the D1 is crap or not - I just got mine and I intend to put to the test before giving up.
I managed to put it into LAN mode (DIY) and so far it works well using the accompanying Sonoff remote.
However, I am unable to see (catch) the remote 433MHz commands with my Sonoff 433 Bridge which is set up with Tazmota+Portisch in RfRaw 166 mode.
Why isn't the RFBridge able to see the 433MHz commands sent by the remote?

@Littlesloths
Copy link

I removed the resistors and had no issues whatsoever... full functional

@fapoo
Copy link

fapoo commented Nov 5, 2023

Well, Sandeep-ma obviously took the wrong turn and never changed the firmware on his D1. No idea why he posted about it on a Tasmota forum.

@ssiillvvyyaannaa
Copy link

Good night
The power stage, is it a TRIAC...?
I need to change it for one with higher power, to control 1,500W.
Does anyone know the reference of the component.
Thank you

Buenas noches
La etapa de potencia, ¿Es un TRIAC...?
Necesito cambiarlo por uno de mayor potencia, para controlar 1.500W.
Alguien sabe la referencia del componente.
Gracias

@ssiillvvyyaannaa
Copy link

ssiillvvyyaannaa commented Dec 19, 2023

1st part solved.
1ª parte solucionado.

JST12Serie 12A TRIACs  IMG_4385

ST12Serie 12A TRIACs 02

@dbrand666
Copy link

I removed the resistors and had no issues whatsoever... full functional

The 433MHz RF remote still works without the resistors?

I had ghost switching with Tasmota. The module was installed in an inconvenient location so I didn't want to remove it for hardware mods. Instead, I switched to ESPHome and haven't had any problems with ghost switching since.

Disclaimer: I do not use the RF remote.

@oywino
Copy link

oywino commented Dec 20, 2023

Disclaimer: I do not use the RF remote.

Can you please elaborate on that statement?

@Littlesloths
Copy link

The resistors completely cut the connection from the RF part. So the remote will not work anymore.

@dbrand666
Copy link

Right. That's what I thought. I mentioned that I don't use the remote because even though I haven't removed the resistors, I did set the ESPHome configuration use_rm433_remote: False. It's likely that setting it to True to enable the remote would bring back ghost switching.

@therobveiller
Copy link

therobveiller commented Dec 21, 2023

I have just bought a couple of these D1 dimmer devices to try, but I am wary of the ghost switching mentioned. Looking at the ESPHome code, they appear to detect a dimmer state/level change, and revert the value back to the last “stored” value that was sent via native ESPHome commands.

This means in Tasmota terms, to implement an equivalent of use_rm433_remote: False :

  • If a state/level change is sent via MQTT or the GUI, then those changes would be deemed to be a valid level/state change - values should be stored.
  • If the level/state read back from the dimming chip changes without a corresponding MQTT or GUI command, then the change must have been a spurious command from the RF unit, and the setting should be reverted immediately to the last know valid stored state.

If you wanted to retain the use of the RF remote (use_rm433_remote: True - equivalent), then you would not perform the above state/level change checking.

Whilst I can read and understand code, I’m not very good at programming it, so have no idea where to start to implement an equivalent for Tasmota. I cannot see any such implimentation in the Tasmota code, so forgive me if there is something already in there. I have not as yet seen any spurious switching with a physically unmodified device - all ICs and resistors are still in place, and I don't have any RF control devices paired or otherwise linked to the the D1. I am using Tasmota 13.3.0, not ESPHome.

@arvageo
Copy link

arvageo commented Dec 27, 2023

Hello! I want to install the Sonoff D1 Dimmer inside a floor lamp. So I will not know witch is going to be Neutral or Line. Is it going to work?

@420pootang69
Copy link

Why wouldn't it? Also what country and specification are we talking about? Would have been helpful to include that.

@ssiillvvyyaannaa
Copy link

Hello! I want to install the Sonoff D1 Dimmer inside a floor lamp. So I will not know witch is going to be Neutral or Line. Is it going to work?

Cables inside the lamp:
Blue = Neutral
Grey, Brown or Black = phase
No matter how you plug the lamp into the wall, it will always work, but wire the colors into the D1R1 respecting the colors.
If you put the D1R1 on the wall and you don't have colored cables, use a pole finder, they are very cheap.
.
.
Cables del interior de la lampara:
Azul = Neutro
Gris, Marrón o Negro = fase
Enchufes cómo enchufes la lampara a la pared, siempre va a funcionar, pero cablea los colores en el D1R1 respetando los colores.
Si pones el D1R1 en la pared y no tienes cables con colores, usa un busca-polos, son muy baratos.

@arvageo
Copy link

arvageo commented Dec 27, 2023

Hello! I want to install the Sonoff D1 Dimmer inside a floor lamp. So I will not know witch is going to be Neutral or Line. Is it going to work?

Cables inside the lamp: Blue = Neutral Grey, Brown or Black = phase No matter how you plug the lamp into the wall, it will always work, but wire the colors into the D1R1 respecting the colors. If you put the D1R1 on the wall and you don't have colored cables, use a pole finder, they are very cheap. . . Cables del interior de la lampara: Azul = Neutro Gris, Marrón o Negro = fase Enchufes cómo enchufes la lampara a la pared, siempre va a funcionar, pero cablea los colores en el D1R1 respetando los colores. Si pones el D1R1 en la pared y no tienes cables con colores, usa un busca-polos, son muy baratos.

Thank you for your answer! I live in Greece, so we use EU standards. Blue = Neutral, Brown = phase. I will connect the D1 inside the floor lamp with the respecting colors. So, as you say, I will not have any problem how I'll plug the floor lamp to the wall outlet as I understand. It will work both ways! Right?

@sfromis
Copy link
Contributor

sfromis commented Dec 27, 2023

Yeah, you generally do not need to be very exact about phase/neutral, unless maybe if you have protective earth too. Still, I do like to do it "right", like when having a relay cutting off phase instead of neutral. While both works, having the phase go directly to the consumer does mean having live on more wire than needed. But it still works.

@Ciberyan
Copy link

Ciberyan commented Feb 12, 2024

Hello All
Sorry to come back on this old subject
Someone could it be so glad to tell me wich version of Tasmota should I get for flashing the D1 dimmer ?
There are so many ...
Thanks for your help !

@oywino
Copy link

oywino commented Feb 12, 2024

Why do you want to flash Tasmota on the D1 ?

@fapoo
Copy link

fapoo commented Feb 12, 2024

You can use the normal Release binary of version 13.3.0.
Works Fine for me.

http://ota.tasmota.com/tasmota/release/tasmota.bin.gz

This one or any other in your language.

@Ciberyan
Copy link

Ciberyan commented Feb 12, 2024 via email

@sfromis
Copy link
Contributor

sfromis commented Feb 13, 2024

Recommended template: https://templates.blakadder.com/sonoff_D1.html

@Ciberyan
Copy link

Ciberyan commented Feb 13, 2024 via email

@Ciberyan
Copy link

Flashed and works perfectly thanks ! but ... there is a but
I am blocked on the power on state configuration
I set PowerOnState 1 to have it lite at powerup
I set Dimmer 100
I cut the power few moment and power up again
on the web UI it says ON and dimming slider is full right (100)
But no light ....
I have to change the dimmer value to have it lite again
Do I miss something ??
Thanks for your help

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 fixed Result - The work on the issue has ended good tip Type - Very useful information
Projects
None yet
Development

No branches or pull requests