The subject line is “Add a temperature sensor to a wifi chip”. Why would you want to do that? I can think of a few reasons.
Know what the temperature is in the attic and also use the chip to control an attic fan.
Know what the temperature of the hot tub water is and have it send you temp alerts if the water starts getting cold, or even worse, too hot.
Know the dew point which is vital when using a laser engraver which has a water cooled laser tube. Too much condensation means you’ll shorten the life expectancy or the tube or cause it to catastrophically fail.
Have a remote temp sensor for other rooms.
Monitor humidity where you store important papers, or cigars or stuff like that.
Now that we know it is useful, let’s do it. This is actually one of the simplest things you can do with an ESP8266 or ESP32 Internet of Things, wifi chip. It isn’t hard at all. Continue reading →
Found another somewhat easily Tasmota flashable Outdoor plug. It is the Etekcity ESO15-TB, (approximately $20). It can only be flashed via serial to USB and oddly enough I found no good solid guide online for flashing it. When I opened it up I saw that it had an ESP-01E chip. I also discovered that it required a complete disassembly to get to the bottom of the board.
When I first flipped it over I thought all was lost because the ESP-01E is kind of a plug in module and the solder points are SUPER close together. Closer than my 59 year old eyes can navigate, at least not without mumbling some special words I learned in the Navy. A closer inspection revealed clearly marked test points with the exception of GPIO0 which almost always has to be held to ground to put the chip into boot loader mode. The pinout in the ESP-01E doc shows that GPIO0 is pin 8.
There are no shortage of Internet Of Things (IoT) devices in the big box stores that promise that their app or Alexa and/or Google integration will make your home smart. There is no doubt you can walk into Walmart or Best Buy and walk out with a smart switch or outlet or LED strip or whatever.
Pretty soon though you end up with a multitude of apps and instead it is chaos instead of convenience. Also if you add something to Alexa, and remove it then add it again you may have two instances in your Device log with the same name which will cause problems.
Another problem I have with these devices is that they are mostly all made in China, and so is the app. A few years ago when I first started doing home automation there was a popular plug (which is still around) that one geekster used a packet sniffer and proved the device was sending your network credentials back to its server in China. I won’t dwell here too much but if someone has a back door in the software of a device that resides on your network………..THEY ARE IN YOUR WHOLE NETWORK.
My requirements for a smart device are this:
The ability to remove their firmware and flash it with Open Source firmware. This is number 1 on my list for a reason. Security. Many devices with IoT chips are now blocking the ability to reprogram their devices. Tuya, which makes about a zillion guts for smart devices has been doing this for a couple years.
The ability to incorporate the device into my Home Automation. I use a program called HomeAssistant. I don’t necessarily want the Googler or the foreign agent, Alexa running the whole show. I want a web interface, dashboard that I can control from FAR AWAY. Can’t tell Alexa to turn the thermostat down if you aren’t in the house. And again this goes back to my previous point of having multiple smart apps = chaos and confusion.
The ability to control it manually should automation break.. If it breaks 100% when the internet goes down………what good is it?
Decided to put some landscape lighting up at my new home and figured I might as well make it home automation friendly. That means I want to control it from a browser or by Alexa or Google commands.
It’s actually not very complicated, as far as home automation goes. The whole project is centered around a Sonoff 4 Channel Relay. The device I linked is actually a newer model than the one I have. I have the Sonoff 4 Channel Relay R2 Pro.
Sonoff 4CH R2 Relay
Figured I may as well use it.
It can control 4 different lighting circuits however I’ll probably only install 2 or 3 circuits, and this of course will give me room to grow.
These things come ready to roll but the device and smart app are Chinese and I don’t dig that at all.
So I flash mine with Open Source firmware called Tasmota. At least I know my information isn’t being sent to some server in China.
NOTE: These devices are rated to 10 amps only. If you use them on an AC home circuit breaker it is likely a 15 or 20 amp circuit. Translation: The Sonoff will fail catastrophically before a circuit breaker trips if something goes wrong. We are powering this device with DC power and using low voltage DC landscaping lights that are 12 volt. This will be safe.
I have an older Sonoff 4 Channel Relay (R2 Pro) which I had flashed with Tasmota firmware version 6.4.1.
In the interest of incorporating easily into my home automation I decided to upgrade the Tasmota firmware to the latest version (9.5.0 at the time of this writing). I want to use it for landscape lighting.
I uploaded the Tasmota minimal which did upload but when the relay rebooted the relay 2 light came on and the relay 1 relay began furiously clicking.
The WiFi was NOT connected as well. No problem. I’ll just put the device in boatloader mode and rewrite the flash memory. You do that by holding down this button while powering up:
Enter boot loader mode (click pic to enlarge)
Great, except it didn’t work. I was pretty sure it was bricked for all eternity and I was ready to throw it in the trash. Holding the button down is supposed to short data pin GPIO0 (zero) to ground causing the device to enter boot loader mode.
I decided I would try to manually short GPIO0 to ground by using these pins while the FTDI controller was connected.
Bought some of these plugs a few years back and never used them much because I put z-wave smart switches all over my house.
Well, I have a “new” house now which was built in the 80’s and it doesn’t have a dedicated neutral line which limits my smart switch choices a bit which leads me back to the smart outlets.
First of all, when you get switches like this that say “Compatible with Alexa or Google” just know that that means they are made in China and the controlling software and app are made in China and that your smart device is sending info to China. You can’t be sure because the software is proprietary,
Enter “Tasmota” which is a custom firmware with Open Source code which means you can see the code which makes you feel more comfortable when you say “Alexa, turn on Safe House, Safe Room lights”. That of course is an exaggerated joke.
I ran a strip of WS2811, 12 volt LED’s in my home for years with a program from Bruhautomation which has kind of long since been obsolete and the author has archived the project. Served me well for years.
The new kid on the block for controlling LED’s for effect lighting is WLED by Aircookie. Awesome project. For some reason though the hardware I’ve always used to drive the LED strip wasn’t working reliably with my new WLED setup. Weird things like having the first 3 LED’s light up uncommanded while the strip was powered off and other things like not retaining the color or brightness from the last known state.
Translation: Data corruption.
The data signal that powers the LED comes from the ESP8266 chip and is a 3.3 volt signal. For a long run of lights to keep things working correctly we may need to amplify the signal to 5 volts.
This is where something called a Logic Level Shifter comes into play.
We’ve all seen those decorative LED strips in the big box stores. They are either controlled by a remote (who needs another remote control?) or by an app. I am here to tell you that the cheap Chinese lights and their apps are essentially spyware.
So to be safe we want to use an Open Source solution to power our lights. Enter, WLED by Aircookie. Before we go down the rabbit hole I want you to realize that this isn’t the typical geek project.
It is EASY! Anyone can do this. But to make it easy you’ll need a few things that could be optional if you cannot solder or you don’t have a drawer full of electronic geek stuff.
BEFORE I TALK TOO MUCH AND SCARE YOU OFF WE ARE GOING TO DO THIS ESSENTIALLY:
PLUG IN A CHIP TO A COMPUTER
OPEN A PROGRAM AND FLASH THAT CHIP WITH ONE BUTTON CLICK
HOOK UP 5 WIRES
There are a lot of different LED strips and your selection will depend on what you are doing. Because I put a 4′ strip behind a workbench I used 5 volt strips. If you are doing a pretty long run, a 5 volt strip might not power all your lights without additional power injection. 12 volt strips MIGHT also require a level shifter on the data wires to get the signal down stream. Your ESP8266 chip will send a 3.3v data signal out. To make a long run you might need 5 volts. A level shifter turns a 3.3 volt signal into a 5 volt signal. But I digress. Let’s keep this simple.
I’ve actually blogged about this before but I bought some more of these and just think that the Sonoff S31 is the best power monitoring device going. I got mine on Amazon for about $18 each and I think you can find them a buck or two cheaper in other places. Just make sure that you don’t purchase the Sonoff S31 LITE.. The Lite version DOES NOT power monitor.
The devices work with an app called EWELink but the company that makes all this is called iTead and they are a Chinese company based in China and some people have caught their app sending back interesting information to the home server in China. In short……..I don’t trust the app. You can use them right out of the box with the app but that’s not what I’m all about here at John’s Tech Blog.
So what I do is to modify the devices firmware with something called Tasmota which works on Wifi, creates a web page that displays all your vital information and it ONLY reports to any server if you TELL IT TO. Mine reports to MY machine to machine protocol server (MQTT) so I can tie the switches into my Home Automation software so I can turn them on and off. Also you can do really cool stuff which I won’t go into here in great detail. For example, I can have it send me an email if it sees a refrigerator showing so many watts for so long a period of time. Excessive wattage would be from the light bulb being on so maybe me pulling 60 extra watts for 2 minutes means someone left the door ajar. Cool.