Wednesday, May 6, 2026

A Real Use for the Cheap Yellow Display

 So. a friend told me about the CYD (Cheap Yellow Display). Basically a nice little color display that has a processor on the same board with some inputs and an ESP32 complete with wifi. At first, I kind of shrugged because ... well wifi. For me, in a rural area prone to power outages, wifi has been pretty much a pain in the bottom. Internet in general has sucked over the years because a WAN connection had to be by wire. Dial up, DSL and such were the rule because that was all that was available. 

But, over time, that changed. The power company FINALLY decided to actually supply (mostly) reliable power. Then the various internet providers started showing up. Wifi mesh networking systems became cheap enough to actually use in the home. We caught up (almost) with the 21st century. 

Heck, I think I'll get one of these things and see how they work.Wow! these little things are really great!!


Notice I got the 4 inch model? I wanted something I could actually see and interact with. It has a resistive touch screen, and a nice color display. 


Since I didn't want to scratch up the screen playing with it, I immediately made a faceplate for it and noticed a small annoyance: the screen is off center.


Notice how the left side is wider than the right? No, that isn't because I printed the faceplate that way, it really is off center to allow for the wifi antenna that the processor has.


Never mind, that's good enough to begin; I can adjust for that when I have something real developed. For now, let's play with this thing.....

Since this was my very first ESP32 journey into code, I loaded up the latest Arduino IDE, an installed the esp32 board support and tried it. I got "blink" to work, then advanced to "Hello World;" they both worked, but it was painful. The native code was full of various calls that I really didn't understand and just seemed way to complex for something that would have to maintain for years and years. 

I looked around, even sent an AI out to find a way to simplify developing something for this board that actually did something. My answer was right there in Home Assistant, ESPHome Device Builder. They tout it as "No Code," and to some people it might be, but not for anything that I want to actually do something; more on that later.

I created my first ESPBuilder device, "Hello World," and I was impressed. I mean really impressed. I managed to get a string on the display, in any color I wanted, and actually be able to read it without squinting. I spent some time playing with the backlight, fonts, various items from home assistant like drop down menus and circular gauges. It was totally fun watching things come up on the CYD that had been limited to laptops and phone in the past. 

What to do with this? MY THERMOSTATS !!

For a decade I had used the "Super Thermostat" <link> that I created many years back. Now was a good time to replace them with new hardware. They were already ethernet devices, and a wifi device like the CYD would be a good experiment to try out. Plus, I could put that dusty 3D printer to work for a custom enclosure. 

This was a bittersweet decision. I created those thermostats back in the medieval times of home automation, and they were quite a project. At first they were wifi, but wifi didn't work too well with the Arduino platform in those days, so I switched them to wired which was a lot of work. Then, I modified them to use remote temperature sensors <link> so I could sense the temperature right where the people were; that was also a big project because they were battery powered end devices on a Digi XBee network. Plus, there was a lot of custom changes to the combination of devices over the years that I would have to reproduce under the new digital environment. Did I really want to take this on???

This is what one looks like finished, running, and controlling the AC unit on the south side of the house.


Yes, it's green. There were two main reasons I used green filament to print it. 1, I already had a spool of green filament, and 2, the wall behind it was green. No, it was not to draw attention to them so people would ask about them; nope, not at all. The two patches cover up the holes from previous thermostat work that I absolutely will cover up and paint ... someday. 

It all works, The code has provisions for my power company "Peak Demand Period;" where the price of power goes through the roof. It's animated; the little fan is black and stationary for idle, red and turning for heating, and blue and turning for cooling. It even has drop down (or in this case up) menus for selections. 


If you use your imagination, you can see the fan spinning

I can change the mode with the simple press of a fingernail or a pen on the screen (remember, it's a RESISTIVE touch screen). Same thing with the fan. The temperature is displayed as both a circular gauge and numbers in fahrenheit. The temperature setting is controlled by both a slider and two buttons.Yes, I was showing off a bit, but I couldn't control myself. 

"But, wait, how did this thing control the air handler? It doesn't have any wires going into it?," you say. Well, I cheated. The old real thermostat was still running, catching commands from Home Assistant and feeding them through the wires to the air handler. Basically, this was just a fancy display that had bells and whistles that actually worked to send commands to Home Assistant which sent them on to the old thermostat that fed the wires. The idea was to stage my conversion to new hardware one bit at a time. First the CYD because it was cool and pretty, then something to replace the old thermostat that would actually control the air handler, then a remote temperature sensor that I could place appropriately. 

Yes, this was going to turn into a huge job with parts all over the house, but any one of the pieces could be updated independently as desired. There's buzz words for this like, "distributed processing", "isolated failure tolerance," or maybe "extendable architecture," but what it really was was staging the changes while I kept the AC working. That thing is my heating and cooling, and in my unpredictable climate ---necessary. So, While this screen looks like a thermostat, it's actually just the face of a much larger system—the real work happens in the old thermostat that is ancient. For now,but that is going to change.

Power comes in the back through a USB C connector hooked to a wall wart on the opposite side of the wall. That way there are no wires visible and only a small round hole in the actual wall. Why? Well, I had a lot of trouble with heat generated by various devices when I tried taking the 24vac down to 5vdc. Those little converters are cool, but run hot and that's not a good idea over time. I thought of this going into the project, and the device is upside down compared to other projects. 

The lid is actually the mounting point of the new thermostat and is held on by screws into wall anchors, then the CYD is mounted to the case with a hole in the bottom for the display and a friction fit to the wall mounted lid. The USB C cord comes through the lid, like this:


So, if I want to work on it, I just pull it off the wall, unplug the USB C connector, and walk off with it. Slick, and I wish I had thought of that technique much sooner. It makes taking pictures of the other half easy, like this:


See how I used a commonly available right angle adapter for the USB C connector? I try to keep projects as cheap and easy to find parts for as possible. Also, notice the dead space to the right? That's because the CYD display is off center as I mentioned earlier. It makes for a larger thermostat device, but it would drive me nuts over time looking at a screen that was off center every time I walked down the hall.

Which reminds me, How does this control the actual AC units? Well, ESPhome and Home Assistant thought of that for me. Each operation like changing mode: heat, cool, off, are handled by Home assistant. The thermostat is a "device", with "entities" that can be put in a dashboard. That way, I have menus on the laptop and cell phone as well as the thermostats on the wall. I basically stole the controls I already had for the old thermostat that was routed from old code and hooked this to that. This mess of stuff made for a cool display on Home Assistant:


If you've read any of the other posts on this blog, you already know I'm a sucker for graphs. They tell me at a glance if something is wrong, and I get a feel for the behavior of the various things around the house easily. I will eventually make that menu simpler for 'normal' people to use, but for now, it's my baby, I'll show it the way I want to.

So, after building two of them and working out how to share the common code between them, I had two new thermostat devices. That was really great for a few days, but then I thought to myself, "Self, why don't you move all that logic over to another device that is right on the AC air handler? That way you can get rid of the requirement of hooking into a wire that runs through the wall to control the AC. I could put all the control logic in there, and when necessary, adapt it to a different air handler. Plus I could do things at the air handler that are not as easy with a wired system. I could measure the air flow, temperature of the incoming air vs the outgoing air, maybe use the lower speed of the fan ,,,

I'll write about that project in the future, it was a bit harder, but fun.

Wednesday, April 15, 2026

My First 'Real' Zigbee Sensor

I've made a lot of sensor devices that reported using Digi XBees. The little RF devices work quite well and set up a self healing mesh network that really does what is needed. These came before Zigbee and the devices we see now for home automation. It was the beginning of the Internet of Things (IOT), but it wasn't actually on the internet. Most of this blog is about developing these devices to serve some purpose: reporting data about or controlling something around the house. Bringing industrial controls home for a common person. 

Zigbee devices started appearing, using the same techniques I was familiar with but with a documented protocol that could make different manufacturers devices work together. However, the first implementations were crippled by the manufacturers such that anyone buying them would be stuck using a single manufacturer's equipment. Much like pool controllers that are locked into a particular manufacturer. The Iris devices promoted and sold by Lowe's were such devices. Myself and others broke into the protocols of the Iris devices and built our own controllers eliminating being locked down like that. 

That philosophy, thankfully, died in favor of a huge number of real Zigbee devices. Zigbee 2 MQTT was the crowning touch to this; it allowed any manufacturer's offering to connect and translated the protocol into MQTT topics that anyone could use to control their own house.

But, you can look up the history of IOT if you want to know more, this is about creating my first device that used the Zigbee protocol. In my last post I described how I implemented a swimming pool controller using commercially available Zigbee devices, but left something out: measuring the air temperature at the pool controller, and a contact sensor for a float in my septic tank on the same side of the house.

The ESP32C6 had been announced that supported native Zigbee and Matter. Then Seeed Studio announced a tiny Xiao device that packaged the C6 as a component similar in size to a Digi XBee. This little thing was exactly what was needed for me to get my feet wet creating a sensor to measure temperature and check the status of that float. So, I ordered one (actually a couple).

Taken right from their web site

This thing is a little bit bigger than my thumbnail.

It comes in a cool container


Yes, it's that tiny, and subsequently a bit hard to deal with, so I ordered the expansion board to play with it. 

Taken right from their web site

This was big enough to handle and work with. It has plugs for adding sensors and powering them as well as that cute little display for debugging or showing off. Plus, there were instructions on using the latest Arduino IDE to develop software for it. I'm very familiar with the Arduino IDE since I've been using it as long as it has existed. That was a real plus in my mind. 

I downloaded the IDE, installed the board specific software, and wrote my first program for the C6, "blink". Then I expanded to "Hello World,"  I was ready to dig into bringing up a Zigbee device, and then later, conquer the world.

The first thing I noted playing with the Zigbee examples supplied by the developers was that they were designed to connect a C6 controller to a C6 device. I wanted to connect a C6 device to Zigmee2mqtt and Home assistant; how does one go about that? I had to poke at it quite a bit to get my device to join, and it was really frustrating. There was a whole world of considerations that I didn't have in my development work under the Digi XBee model. At this point, I need to tell you about a way to cheat. You know how frustrating it is to look for an example of something like getting that little display on the expansion board to work, and even make it behave like a terminal and scroll information? It's really hard to search for it because you get 1.6 million hits, many of them on forums, and a huge number of youtube videos some of which are related, others that are not. Plus the usual totally unrelated hits that just drive you nuts. The answer to that for me is to use AI to search for me.

Let AI do the searching dealing with the ads, pop-ups, videos in the corner of the screen and give you back something that might actually help. I used it extensively to summarize discussions to a few real findings and translate the jargon into something I could understand. DO NOT let it write code for you. That would be great, but it puts in stuff you didn't ask for and inserts more errors than it solves, but for gathering information, it's a gem. Especially in today's ad-ridden internet.

I got the device to join with Z2M and then ran into problems with the data it was providing to Home Assistant. That led me to what's called a 'converter.' This is a piece of yaml code that describes the Zigbee clusters and what to do with the data. The documentation on these pieces of 'code' is odd and I had to prowl through it a lot to get some idea of what was going on. Also, Z2M had changed the way the converters worked and should be written, and the 'helpful' sites on the web were mostly too old, or just flat wrong. AI to the rescue, sort of. AI had the same problem I did, separating the junk from the real information. It kept suggesting things that just wouldn't work, and were a mix of the old and the new. However, it was pretty good at finding problems with the exceptionally weird combination of syntax, keywords, and indentation that plague yaml. Yaml was supposed to provide a way of creating code from a description without having to learn to code. Instead, you have to learn how to make a very elaborate description that is properly organized using specific keywords, indented to the way some programmer thought it should be. Basically, it is part of the future that one has to adapt to in order to get anything new done in the IOT field. Also, it sucks.

Net though, I got a device working. It measures the temperature using an 18B20 and looks for a contact closure. Two endpoints that show up just great in Z2M (Zigbee2mqtt) under Home assistant. And then later in any dashboard or card that I want to use. I didn't find anything that could do this particular combination anywhere on the internet. Heck, there's only a few contact sensors out there at all. Here it is as it looked while I was working on it.


The 18B20 is plugged in to one of the expansion board ports; I used the chip version at first and then changed to the waterproof version when I installed it outside. This is a picture of it installed and actually working in the same enclosure that I used for the other pool devices.



It has been VERY reliable in  the months that it has been running. I used the Seeed 'case' for the expansion board to protect it a bit. Of course, I broke the first one I used; the little crack repaired with super glue is visible in the photo. Here's a close up:


Sigh, one has to be careful with those tiny plastic parts. Hey, superglue is great stuff, might as well use it. Speaking of glue, that "Alien Tape" that used to be advertised all over the place is actually great stuff. I use it all over the place, but one has to be careful because sometime it lets loose. I used it to mount the board, and it has held up really well so far. The other stuff is that 3M double sided 'tape'; you use that to mount something and then let it set overnight, and it is there forever. Shortcuts for the various projects we develop.

If anyone is interested in the actual code for this, it will be available on github when I finally overcome my reluctance to relearn how to use it. 

Friday, April 10, 2026

The Demise (sort of) of the Pool Controller.

Once upon a time I was controlled by my swimming pool controller a Goldline P4. It was an expensive piece of hardware that I got when the pool was originally installed. That thing was said to be the pinnacle of pool control, but in about 20 minutes of working with it I saw shortcomings that were a bit annoying. But, I kept using and working with it. 

At that point I started trying to overcome the various short comings. I installed an RF remote control from the manufacturer that turned out to have limited range and was constantly having to be moved to another spot to communicate with the pool. I broke into the control system and set up my own input to the communication protocol between the pool components <Link>. I installed a fancy variable speed DC motor trying to save on power, the list went on and on and on. Search for swimming pool here on the blog to see how much work went into trying to control that device.

That's why the first line says, "controlled by."

Well, the expensive variable speed motor was a bust and got replaced by a two speed pump <Link>. The much touted chlorinator got turned off and only used to keep the pipes connected. Basically, all the frills and fluff that I succumbed to were removed and I was back to a basic pool that has a chlorine float and periodic shocks because all that fancy hardware just didn't work on high calcium well water and climate extremes of the desert. So, one day I asked myself, "Self, why are you putting up with this controller?"

The immediate answer was that if I replaced it with something else, how would I get the 24 volt power I needed and the high current relays that ran the motor and lights? When I discussed this with a friend, he looked at me like I was stupid and said, you have those already in that controller. A light went on, and a journey began.


Above is the architectural drawing of what I wound up implementing to solve all the annoyances of the Goldline controller. I just gave up on controlling the controller and disconnected its relays from the big board inside; I would use them myself some other way. The 24vac supply in the controller would provide the power for the pool valves, all I had to do was come up with a way to connect them. Plus, using Zigbee kept me from having to dig trenches or cut wall board. In my previous post I mentioned that I have an extensive Zigbee network that has a router right inside the wall where the device was going. Heck, Zigbee keeps the devices off wifi, and is really fault tolerant. Perfect way to go.  

Well, the answer was obvious to me, use a couple of those Zigbee relay devices and connect them through Zigbee2mqtt into Home Assistant where I could create dashboards, automations, etc. to my heart's content. 

I started off getting the relay devices; I used two different ones because I had one type on hand from some experiments I ran a year or two ago, and I ordered another one with a temperature sensor in it to get the water temperature. 


Now, I needed a box to put the stuff in because this was going to be outside in the sun and rain. That's a big deal in Arizona because the sun will rot almost anything over time. Plus, there had to be protection from the rodents that infest the desert. It certainly wouldn't do for a pack rat to steal all the shiny things and take them home to its den.


I picked this enclosure on Temu. It turns out they have a big selection of this kind of enclosure, and the price was way less that something similar from Home Depot. Now, how to arrange the stuff on the side of the house where the pool equipment is? I came up with this because it is really simple and wound up high enough that I wasn't sitting on the ground to work on it.

Just try to get into that you packrat !! 
\
Now, to put the parts and pieces into the box, wire it up and see if it generates magic smoke or actually works.

Plenty of room for more stuff

The beauty of a nice enclosure is that it hides the wires inside where no one knows how sloppy one is when a project is getting near to the 'live stage, you're all excited to try it out and just slap things together. Someday I'll get back to it and organize the wires better (yea, right). I did realize that I was missing something though. Yes, all the planning and ordering and waiting and I still forgot something. In the Arduino mega that this was replacing, I had the air temperature and a contact sensor for my septic tank level switch. Shucks, that means I have to look into those.

I got an Xiao ESP32C6 from Seeed Studio along with it's little expansion board, an 18B20 out of a box of them I have from something I never completed and made my very first Zigbee sensor. It has two sensors exposed in it one for the temperature and the other for the septic tank float contacts. This was a coding experience that I had never done before and was a bit of a challenge. But I got it going and even have the tiny little display scrolling with updates that I seldom look at. 

Yes, someday, I'll clean up the wiring...

A note on using the 18B20: Yes it's waterproof, and you can actually drop it into water and it will work just fine. However, how do you keep it in place? If the water is flowing, how do you keep it from leaking? If you're putting it into an environment where shiny stuff gets stolen by packrats, how do you protect it? The answer, Thermowells. 


I used them in two places for this project. One is in the picture above; it sticks out the bottom of the box in the shade to measure the air temperature, and the other is inserted into the pool water flow to measure the water temperature when the pool motor is running. 




This works great to keep leaks from driving me nuts and the rats from stealing the sensor. They solve a lot of mounting problems, and the threads allow commercial piping to work. Take a closer look at the way I did that. The T fitting and the plug are standard PVC fittings I picked up at ACE Hardware. I just threaded the thermowell into the hole with a little teflon tape. Leak free seal against the water pressure of the pool pump. I wish I had known about them years ago. Now about the wrapping I have on the wires. This stuff is new to me, and an attempt to keep the various rodents (squirrels, rabbits, rats, mice, etc) from tearing the wires apart. 





It claims it keeps cats from chewing the wires. I don't worry about cats (except the occasional bobcat or mountain lion), but I'm trying this to keep the rodents out. So far so good (months) because it's wire that wraps around the various cables exposed outside the boxes and conduit. I picked it up on Amazon. A warning though, wear gloves when you put it on, the wires can be damaging to fingertips.

But what about power to the new stuff? Well, there's 24VAC, 120VAC, probably 5VDC somewhere in the Goldline; I didn't use any of those. Instead, I used a tried and true technique (to me anyway). I used a small cell phone charger.


These little things cost roughly a dollar (US), and work fine for low current applications. They won't fast charge a cell phone, but they supply enough 5vdc to power this kind of electronics. Plus, you can get cables to adapt them to any device you happen to have. I plugged one of these into a plug on the side of the Goldline, ran it up into the new enclosure, and the split the power to each of the devices according to whatever kind of plug it had. In case you haven't run into that idea yet, there are USB power (not data) cables that split into two or more other plugs. Using the appropriate adapter, you can power anything, and not have a special buck converter. These little plugs have a wide input range 90-250, and actually work. I have them all over the place. I bought ten of them a few years back, and just used the last of them on another project (another 10 on order right now). I mean a power supply for a dollar?? Heck, I've used them to get 5vdc from a 240vac circuit and it held up well. Yes, occasionally they fail, but for a dollar, I don't care. 

Well, I had it physically constructed, and had wired the little relays in the left Zigbee relay controller to the big relays in the Goldline controller, and the right Zigbee relay controller handled the 24vac valves, so let's join this thing to Z2M and see what happens. Basically, it worked really well. Some of the usual messing around with naming the various Home Assistant devices and entities and then some dashboard work, and I had a control system for my pool that could do any darn thing I wanted. 

Victory !!


Now, if I was to do this over again with a new house, and a new pool, I would never even think about all the bells and whistles that I originally suckered into. A basic two speed motor, and some Zigbee devices hooked into Home Assistant would be all I need. Hayward could just find some other dude to sell their expensive, limited, failure prone hardware to. 

(Note: If you’re wondering why the septic sensor isn't live yet, let’s just say while I was moving gravel, I gave the local packrats a clear shot at the wires. They took it. Round one goes to the rodents.)

The little zigbee sensor using the ESPC6 was a great little project that you might be interested in; details on that project are upcoming. Stay tuned.

Thursday, April 9, 2026

I'm back ! So, Let's Revisit the Hubitat

 A long while back, I touted how nice the Hubitat device was, and it really was great. I moved my entire home control system over to it. I added devices and was quite happy with the system.

Then, they came out with new hardware that was really compelling and I upgraded to it. The system offered a nice transition path from the old hardware to the new, and greater range and capabilities. I was stoked until some of my devices refused to work with it. All my old Iris stuff quit working, and I couldn't get my expensive Enbrighten Zigbee light switches to join. I contacted Hubitat about it, and of course, no one else was having the problems I was.




I even sent the device to them and they, of course, couldn't find any problem. But, I had an expensive piece of hardware that just wouldn't do the job for me. I was pissed when I found out that they intentionally excluded the Iris devices from being able to join the network! That was the important thing to me at that time; I had a lot of them from years past. What REALLY annoyed me was the very latest (at the time) Hubitat has a button to join the old Iris devices right on the page to join Zigbee devices. Of course that button only wasted my time trying to make it work. On the Hubitat forum, I wasn't the only one that complained. See the old link to the discussion here <Link>. My complaints are in there as well where people came rushing to Hubitat's defence. You know the drill on forums, pick at the question until the person gets mad and leaves. 


So, it was set up the old Hubitat to handle this Iris devices as well as the Enbrighten switches, and use the new Hubitat to handle new stuff as I expanded. The idea of holding on to an old controller just to support devices that I was already using didn't sit well. 

There was also the possibility of replacing the devices that wouldn't join the Zigbee network, but that was expensive, and I have not found anything that worked and looked as nice as the Enbrighten wall switches. The Iris devices could be easily replaced with less expensive devices and new technology, so that wasn't a factor. 

Or, I could drop the Hubitat and continue developing software under the system I brought up originally. That didn't set well with me because "Rolling my own" is a lonely path. It was great back when I started because IOT was still in its infancy and I was plowing new ground with every project. I had a lot of fun developing my own monitoring system for house power from the power company. It was also a lot of fun to get my air conditioning system under my complete control. However, that path diverged too far from what other people were doing. 

What did I do? I took the old Hubitat and used it as a Zigbee controller and brought up Home Assistant on an Intel NUC that I picked up on Ebay for a fraction of the price of the newest Hubitat. Then started to work setting up controls and monitors all over again.

That actually worked pretty well as a system, but I had a LOT of devices that I built up using the Digi XBee that was pre-Zigbee, and I wanted them in the system also. So, I interfaced them into Home Assistant using MQTT. Eventually, I wound up with two Intel NUCs, the old network and the new all Zigbee network. 



Everything worked, and I had a new system that supported everything and anything new I wanted to try. I went a little nuts and spent many days on dashboards, automations, helpers and such until I really had the house fine tuned to what I liked and how I wanted things to work here in Arizona. Then, using the mqtt interface in Home Assistant, I moved my code to the second NUC and got rid of the Hubitat entirely.




The Hubitats are sitting on a shelf somewhere totally ignored now. I'll never go back to that route again. See, what had happened was that I had missed out on the incredible progress of Home Assistant. It has Zigbee to MQTT integrated, so new Zigbee devices can be integrated into Home Assistant with a little work, and that is an awesome feature for automation and monitoring the house. Then, I tried out the ESP32 devices; that gave me the ability to create something that didn't exist on the market, and I was back in the heaven of exploring new ideas and implementing new ways of controlling things. Different platforms, but way cheaper and much more capable than the Arduino, Raspberry Pi evolution of the IOT field.

Thus, the last four or so years has been an exploration and implementation of catching up with IOT, and doing my own thing around the house. I decided to wake this blog up again and share my exploits and failures because there is an audience out there that wants to see what the reality is and what is possible without spending their entire life pawing through a forum being insulted for asking stupid questions or watching endless out of date videos enduring ad after ad to see how something could be done under some old release. 

I hope you enjoy my experiences as much as I have. You do your own thing for your environment, and I'll keep poking and experimenting, sharing what I've already done, and what I'm working on now. 

Oh, and I'll probably throw in a tractor, excavator, skid steer or rock moving story along the way.

Dave.