I wanted to create a new topic dedicated specifically to the new Sonoff Mini as it has done my head in for the last 2 weeks.
I have been playing around with Sonoffs for a little while now, and I quickly got drawn to @erocm1231’s firmware and DTHs and have been using a couple of basics and a couple of THs and they work brilliantly.
I’ve just recently seen the new Sonoff Mini and thought it looks amazing for a requirement I have.
I want to use this in a light switch, this is different to the basic in that it has 2 terminals that you can connect to a rocker switch and change the state manually as well.
I bought a mini, have flashed it (not fun, I soldered some leads and did it that way!) with Eric’s firmware and it works but I lost the ability to use the switch terminals.
So for the first time, I decided to use Tasmota. I knew nothing about it but had read a little in Eric’s topic and figured it was worth a go.
Because I had put Eric’s firmware on the device, it made it very easy to flash it again with Tasmota through the OTA feature. ( I know the mini does have this feature out of the box but it looked a PITA)
with a little googling etc I found that Tasmota was able to utilise the switch terminals by setting GPIO4 to Switch1 (9).
Now I thought it was all sorted except I did not know how to get this integrated into Smartthings.
With a little more googling, I found @brettsheleski’s DTH and I thought I was nearly there. But, the instructions left me a little confused and I could not get it to work.
Following Brett’s instructions I had installed the 2 DTHs and had put in my IP address in the parent device but it would not spawn a child device so I kept trying and trying but couldn’t really get anywhere.
At this point I gave up. I reached out to erocm1231 to see if he could suggest a way of changing that GPIO on his firmware but unfortunately he doesn’t really support that firmware anymore (although he still seems happy to try and help people) so he suggested I try his forked Tasmota firmware but I would need a DTH.
I’m not really sure what the difference is between his firmware and Arendst’s original but I still could not work anything out.
I have created a DTH before but only something very basic, I certainly am not a programmer!
At this point I gave up again!
Today I picked it up again. I still have Eric’s forked Tasmota firmware on the device but in ST I started again.
I created Brett’s 2 DTHs in IDE again, created a new device and picked the Tasmota device type. In the app, I added the IP address and hoped!
I ten thought I’d try and be clever. I started looking at the code on the Tasmota DTH and eventually worked out that the module that shows in the app for my device was 0 yet this was not listed in the DTH code. So I added 1 line at line 202 and typed “case 0: // Sonoff Mini”
In the app, I then opened the device again opened the preferences, hit save and found the child device had been created!
YAY it works!
I now have a child device in ST that controls the mini!
The only issue is that if I use the switch then it does not update the status of the device. Luckily Brett has a SmartApp for that. I will play with that tomorrow.
Now what I would like to do is create a new DTH that can do this all as one and not need to create a child device or have a SmartApp but to be honest this is probably well beyond me.
For now, it works and I am happy.
But I thought I would share my findings in case anyone else is thinking about using these devices or is currently struggling with them.
If anyone has any questions or I have not explained well then please let me know.