We need to control 3 parameters. Colour (3 options) so a three position switch, brightness (so a slider) and power ON/OFF. I just feel a separate component would make it very easy for anyone to setup. Basically add component. add mqtt topic and everything comes up.
EDIT: I just saw MQTT Light component. I will play with it tomorrow and see. Yes it might be possible with just that.
Did you finally tested the mqtt light component? Just received my LEDs, will try one this weekend with their app, but honestly, I would like HA integration if posible
Thanks KmanOz for your work on the Sonoff range and greetings from a fellow Aussie.
I have used your Git Hub code for the TH16 and it is working fine.
Takes a little time to connect but once connected is very solid in Home Assistant.
The switch works consistently and the temp and humidity values report to the HA dashboard.
Initially, I used the Itead app to “get into the game” of home automation and got used to the timers.
Do you have any suggestions for a beginner like myself how setting timers might be possible?
Thanks again and it is just great to see how you have assisted us all to use these inexpensive Itead products in Home Assistant,
No worries at all. Taking long to connect can be a a number of factors from your wireless router to signal strength etc. If you notice in the code there is a line that says:
int kRetries = 10;
If you find it’s not connecting quickly and it times out a lot (flashes 4 times over and over) before it connects, you can increase that retry value to say 20 or 30. The code sits in the connect loop longer if you do that rather than timing out early.
As for timers, now that you have it running with HA, you can do anything.
@KmanOz used your code on a sonoff switch and it worked first time. I am using the switch to control aquarium lighting and would like to implement a time schedule. The sprinkler example looks good but complex for my requirements. Just need to switch on and off for a period every day. I tend to like clean and simple solutions (that’s why I used your code :).
Tried looking around for some samples but wasn’t successful. Any tips about where I can find some sample code please?
You don’t actually need an Arduino board at all. You only need the Arduino IDE (Software) installed on your computer and an FTDI adapter. Hope that helps.
Yes the blue light should be on all the time. It tells you that it’s connected to an Access Point and mqtt. Sorry no support for the DS18B20 and I haven’t actually got one here to try it. It wouldn’t take me very long at all if there was demand for it but it seems most use the DHT-22 because it also reports Humidity.
At the moment I am bilding my christmas lights. I would like to control with one board about 8 GPIO. Can you show me how I where I have to put the other GPIO’s in to your code so I get the same stability )
The dual is completely different. It has an additional processor. Haven’t started yet. It’s on the list for sure as is the Pow. On the weekend I am going to release firmware for the LED strip. Working OK and just testing fully before I release it.
Can you help me to revise your program to activate the RELAY & LED only once when the sonoff has been switch ON (230V). I tried to revise your program but there is a problem on what I did, it always activate the RELAY&LED when the connection lost to the wifi then connect again. I only want to activate the RELAY & LED one time only when it power ON (230V). please help… thanks
Inside the linked file below is everything you need to get going. Not sure how many people are interested in this product but it’s pretty good. Can easily replace the main lighting in your room because it’s VERY bright, and stays very cool at max brightness. I think for the price they are on a winner here. Anyway will release here first before I go to Github. Good luck.
I only have 1 unit and it’s on the workbench. Will definitely order some more. They’re not your typical strip of LEDS for mood lighting. These are so bright that they can literally light up a room and are designed for that exact purpose. I’ll come back with some usage (watts) in the next couple of days and see how efficient they are as well Impressed though.
Hey! I’ve been trying to make this tutorial work for just one switch, and after fiddling for way too long and not making it work, I decided to check out what the esp8266 says in serial port.
I get the “wifi failed” message periodically, so I guess my chip doesn’t even make it to my router.
Any ideas why? I quadruple checked my wifi ssid and password, and they’re fine, I had no issues with other esp devices connecting to my network before.