Spending money vs. spending time: why choose?
Join us on this adventure as Amos describes the history of Bluetooth & co., the trials and tribulations of connecting devices in their home and how this has helped their mental well-being (yes, really).
Video
Audio
Show Notes
Episode Sponsor: CodeCrafters
- Bluetooth
- Philips smart bulb and ambient side table lamp
- Origins of the name: King Harald "Bluetooth" Gormsson
- Zigbee, Bluetooth Low Energy (BLE) (aka Wibree)
- X10
- Qualified Bluetooth mesh products, Bluetooth SIG (Special Interest Group)
- Point-to-point connection, ISM radio band
- Elgato Key light, iRobot Roomba Robot Vacuums
- r/internetofshit
- IEEE 802.11af and IEEE 802.11ah
- Thread (Google Nest), Matter
- Lower bandwidth Wi-Fi 802.15.4, 6LoWPAN
- Apple's HomeKit and Home App
- Philips Hue Bridge
- Philips Hue, Signify N. V.
- Raspberry Pi Zero 2 W
- Homebridge, plugin for Elgato Key Light thanks to derjayjay, and plugin for iRobot Roomba
- Philips Hue dimmer switch, smart plug and smart button
- Philips Hue wall switch module
- ring main or ring circuit
- Sonoff, ConBee III adapter
- Raspberry Pi 4 Model B
- Home Assistant, Aranet4
- Zigbee Home Automation (ZHA), Studio Code Server plugin, Home Assistant automation blueprints
- Amos' post on X
- Open-Sores: The Dilemma Using Open-Source Software Exclusively
- Target Wake Time in Wi-Fi
- Bluetooth Channel Sounding
Transcript
Amos Wenger: Yeah, I think so. Oh, you're seeing the window decorations. That's terrible. Are you going to complain about it? If you were me, you would.
Amanda Majorowicz I'm fine. I don't know.
Amos Wenger: I know you are, Amanda.
James Munns: It doesn't bother me.
Amos Wenger: So my presentation today is called "My Home Automation Journey." And the subtitle is, "spending money vs spending time: why choose?" If you just look at the subtitle, it could be about AV equipment, it could be about anything, Hi-Fi, it could be about model planes, I don't know.
James Munns: I'm very interested to see where you end up because I worked for IoT companies for a couple of years and my rule has basically been: nothing smart in the house that I didn't write the code for. Which has actually actively made me not get into a lot of this. So I'm very interested to hear where things are today.
No, you get up to turn off the lights
Amos Wenger: All right. I have a slide that just says, "No, you get up to turn off the lights." So I lived like a goblin for a bunch of my life, even though I had money. in the room, in in the bedroom, I only had like, a bulb at the top and no like bedside,. whatever.
So you, you go in and then you read or whatever and then it's time to go to bed and someone has to get up and turn off the lights. I was tired of doing that, alright? I would always offer because I'm nice like that and I wanted to stop.
So you get a smart bulb, ? Uh, You don't know what you're doing. It's your first smart thingy. So you get a Philips smart bulb. You don't need to buy anything else. This one is 60 euros Well, sorry, 54.99 euros. They have cheaper ones. This one has warmth, so you can make it more yellow or more blue, and then I finally got an actual bedside lamp. I added this so you wouldn't get too sad for me like, "Oh, poor Amos. They never even had a bedside lamp." This one is 110 euros. You can see why I waited to get that one.
anyway, if you look at this thing closer, . It has a little Bluetooth logo named after Harald Bluetooth. Is that true?
James Munns: Yeah, and the two runes are B and T and whatever the runes are, it's a magical rune for encanting.
Amos Wenger: King of Sweden? Is that true?
James Munns: Oh, I don't know. Something Nordic.
Amos Wenger: So, you got the Bluetooth logo and then you have another logo with a 'Z', which stands for Zigbee. And we're going to be looking at a bunch of timelines in this episode. If you're not looking at slides, you should be. Go to sdr-podcast.com/episodes and find the slides for this because, oh boy, we have a lot of slides and a lot of timelines.
History of Zigbee and Bluetooth
Amos Wenger: so, so roughly Zigbee appeared in 2003. In 2004,some Nokia engineers are like: the Bluetooth classic that we have- which is not called classic at this point, it's the only Bluetooth we have- the Bluetooth we have does not account for some scenarios. So they started experimenting with variants of it, like different things.
And in 2004, they released what they've been doing for three years as Bluetooth Low End Extensions, which has the initials BLE, but it's not Bluetooth Low Energy. Then in 2006, they actually brand it Wibree. It is customer facing and has a nice little logo that I did not include. And I regret my past decisions Then 2009, 2010, we have actual Bluetooth 4.0 LE, low energy. And in 2011, we started having the first consumer devices to support it. The first phone, I guess, was the iPhone 4S that actually supports Bluetooth Low Energy.
James Munns: have you ever heard of X10? Not X11... X10
Amos Wenger: Nn... no...
James Munns: If you were a smart home nerd in 90s and early 2000s, X10 was like the OG home automation thing. And I think it was wired, but maybe they had a wireless one later, but it was the one where you're like, "I can make my curtains open when I press a button!"
Amos Wenger: I saw it, and I decided: you know what? This is too old, even for me, and I will not go there.
So why does this thing support Bluetooth? Well, because Bluetooth is a brand. Everyone knows Bluetooth and loves to hate it. Everyone has a pair of Bluetooth headphones. People know how it works. They have mice, they have keyboards, they know you need to pair things, they don't care if it's low energy or not. It's kind of in the same device list on iOS and Mac and stuff. Also, you don't need a hub.
You screw in your bulb and then you turn it on, it's looking to pair and you go on your phone, it's like, "Some light bulb will like to read all your contacts," and you're like, "Sure, that sounds fine." And then you have a smart bulb Bluetooth is great because it got me in, right? If I bought this bulb and then it turns out that I needed this whole hub thingy, I probably would have said, "Alright, well that's not for me then."
James Munns: Yeah. That's one of those things, working in IoT stuff, this is a huge pain in the butt because there are so many engineering solutions that are objectively better, but the competitive advantage of you have the remote for this thing in your pocket already and it will work, and it's something you're vaguely familiar with,You go, "Well, it's a Bluetooth thing, how do I put it into pairing mode? Okay. I'll read the manual and it's switch it six times," or something like that. And then it goes into -
Amos Wenger: James, I have never once read the manual to put anything into pairing mode. I just long press all the things -
James Munns: Yeah. But even then, you know. It's a UX thing of like, you don't have to train someone how to use a handle. They've just seen so many handles before you can guess, even if it's a weird shape handle. It's the same with buttons and Bluetooth: if there's one button, you're going to press it or hold it or press it a bunch of -
Amos Wenger: That is the one tip I want everyone to walk away with from this podcast today, If it has one button, try holding it, Just start long pressing things and see, wait till they blink, there's only one knob. There's only so many different things you can detect from the chip.
Also, well... okay, so the downsides of Bluetooth, everybody hates it, but also it doesn't have mesh networking. It does, but it doesn't. It does in the standard, but it doesn't in my house, in any of the devices I own. And I have been looking for products that support something called Bluetooth Mesh, which was apparently conceived in 2014. The Bluetooth SIG adopted Bluetooth Mesh in 2017, and it is now 2024, for So you would assume that, like, half the devices in my house support Bluetooth Mesh. Unfortunately, I will never know, because when you go to the Qualcomm website for it, the table that should have a list of qualified products has "wpDataTable with provided ID not found!" So, like, I do not know what actually supports it.
James Munns: We should probably explain: the opposite of a mesh is a point-to-point connection. So like Bluetooth was originally designed to be a point-to-point connection and generally a hub and spoke model. So you have what's called a central, which is usually your phone or your laptop or whatever, and the peripheral, which is usually the low powered device, like your headphones or the light bulb or, whatever. It's explicitly a point-to-point communication, which you've run into before. If you have headphones that you want to pair with two devices, I don't want to ruin the punchline, but if you have two people in Amos' home that want to control the lights, that is not so very hub and spoke.
Amos Wenger: Yes. I was bringing up mesh networking for range reasons. If you're starting to have some sort of a large dwelling? You might run into range issues and then the whole mesh networking thing means that as long as two devices are close enough, then you can reach all of them.
What about Wi-Fi?
Amos Wenger: So that's it for Bluetooth. But what about Wi-Fi, right? What a good looking question. Wi-Fi is great. It's high bandwidth. So you can have connected doorbells with cameras that send footage to the cops. It's connected to the internet, which is great 'cause you can then control it when you're away from home. So you can actually look at the camera at the same time as the cops are looking into the camera. And you already have a hub for Wi-Fi in your home! Chances are, because you have a home internet connection so you have a box that your internet service provider sent you and that one does Wi-Fi, it's been doing Wi-Fi for a long time. If you still have the box they gave you 12 years ago, just ask them to send you a new one because you've been missing out on multiple years of research on radio frequency signals.
I do have a bunch of Wi-Fi devices in my home. Against my better judgment, I have Elgato Keylights, which are very nice, very powerful. They come with a little control center. The problem is, if you have a Wi-Fi device, is that they could speak anything. Usually, they just listen for HTTP on some port. So, it's nice because you can just reverse it pretty easily. But then you need to have their app installed on your phone and on your Mac. So they need to make an app for everything and they could sneak anything they want in that app.
I also have a Roomba. It's a little robot cleaning machine. It also is on the Wi-Fi and same thing: you need their app and their app is going to sell you parts way before you need to replace them and everything. So it's not great.
And then I also bought a smart plug, which is nice because you can see how much energy is consumed by something, but again: it's on the Wi-Fi. And those kind of devices are problematic.
/r/internetofshit References
Amos Wenger: And I think get featured a lot in one of my favorite subreddits, which is called Internet of Shit. Here's some headlines from the news There will be a link to the subreddit in the show notes. Definitely, producer is violently shaking her head. Uh,
"Your Cheap Android TV Streaming Box May Have a Dangerous Backdoor." I don't know if that's double entendre or something.
"Millions of hacked toothbrushes could be used in cyber attack, researchers warn." Something like 3 million toothbrushes used in distributed denial of service attacks against something. For all I know, the one time my blog got taken down, it was by toothbrushes.
James Munns: Was it really that actual attack?
Amos Wenger: No, it was not the same at all. But it would have been funny!
James Munns: That'd be fun.
Amos Wenger: Another headline, "Wyze says camera breach led 13,000 customers briefly see to other people's homes." Kind of a radical approach to dating.
James Munns: I'm feeling more and more secure in my position of: nothing I didn't write the code for gets on-
Amos Wenger: It goes on. "The security issue is being blamed on, quote, 'a third party caching library,' but the company acknowledges that it let customers down." They're just like- imagine them blaming cURL. They're like, "No, libcurl is the issue." Go get, uh, I forgot his name, the author of cURL.
James Munns: That's always those 'you can end up seeing other people's account' as someone misconfigured their caching proxy and the caching proxy returns someone else's auth key and stuff like that. I feel like that's not even just for devices, but websites, that's the one where it's like, "Oh, all of a sudden you can see everyone's DMs now."
Amos Wenger: It is a really easy mistake to make.
Okay, one last headline from ZDNet. "FBI recommends that you keep your Internet of Things devices on a separate network." Which is what I should do, but don't do, but should do. Really, you should do that. Also, don't have anything on Wi-Fi. I'm gonna quote from the article.
" The FBI says owners of Internet of Things devices should isolate this equipment on a separate Wi-Fi network, different from the one they're using for their primary devices, such as laptops, desktops, and smartphones." This pull quote is great: "'Your fridge and your laptop should not be on the same network,' the FBI's Portland office said in a weekly tech advice column."
Now, who is actually doing that? People for whom it would be hard to penetrate other devices, even if you had local access to the network? I don't know that any normal person is doing that, like non tech nerd.
James Munns: Like you're saying, a lot of people just get the box from their ISP, they plug it in, they read the password off the back, and they use that, and then they never think about it ever again.
Amos Wenger: Yeah. On that same article, it also says to change the factory set default password on devices, which is never the case. Every time I'm at someone's place, if they know they have an internet box, it's already like a victory.
Other downsides of Wi-Fi
Amos Wenger: other downsides of Wi-Fi: range is limited. Basically there's a trade off here. If you do 2.4 gigahertz, it goes through the walls better. The lower the frequency, the further it'll go basically. But then the higher the frequency, the more bandwidth you can have.
So that's why, some people run dual band so they can have very fast internet if they're downstairs near the router and if they're up in the room they still want to be able to read The Journal or whatever.
Also because it's a complicated protocol the cost of adding Wi-Fi to a product is just high ish.
I have another timeline here kind of placing the two... Af 'White-Fi' and 'Super Wi-Fi' and ah Wi-Fi HaLow. Just kind of trying to place them on the timeline, so we understand why they're not used at all, that I know. It's because 2003 Zigbee, 2012 Bluetooth 4.0 Low Energy, and then 2014, the first af thing. 2016: Bluetooth 5, 2017 802.11ah and then 2019 - 2024 we have like Thread and Bluetooth 6. Basically, that's why there's a Zigbee icon on there and not a 802.11af or 802.11ah on there. And even Zigbee is not really this consumer facing thing.
What happened was, it was a thing used internally by different manufacturers and they were trying to keep some level of compatibility between them... people didn't know what Zigbee was, unless they were weird- I mean 'enthusiasts'- basically: the overall brand is Matter. And it's an initiative that includes multiple communication protocols, including Ethernet, Wi-Fi- so the things you already have- and Thread- the thing that Google kind of pioneered with the Nest series of products.
Matter is the new name of CHIP connected to home over IP and connected to home over IP was an initiative launched by the Zigbee Alliance. So there's like lineage here.
James Munns: At their roots, Wi-Fi is 802.11. So it's an IEEE standard. The lower power ones like Zigbee use a different base protocol, which is 802.15.4. 6LoWPAN was the old school one where it was like a compressed version of IPv6 over these wireless networks. And that's where a lot of this research around mesh networks came out of.
I know the whole lineage with like Matter and CHIP and Thread and stuff like that. It seems like there's always a new consortium every two years where they've added another layer and a new group of people and they're doing more stuff over it and someone's shipping some radios. But from someone who designs these devices and sometimes contracts with people who need help designing these devices, it's always hard pressed to find anything more than a tech demo. And I feel like the only way these things are starting to get adoption is because people who have like, Alexas or Apple TVs and things like that. These vendors are starting to put the radios in all of their devices.
Amos Wenger: That is correct. The Apple TV 4k fourth generation is acting as a thread bridge, and it's very sad and alone and frightened because no device is connecting to it. But it is there as a bridge whenever I buy my first Thread thingy.
Speaking of Apple TV... When you have two lamps, Bluetooth is fine. When you have even four or five, whatever, eight, let's say, let's go crazy. But eventually, you might want to use Siri to turn on and off some things in your house. And the way to do that in the Apple ecosystem is HomeKit. And they have Home applications for iPhone, Apple Watch, iPad, and the Home app for Mac is really weird. It's really, really strange.
More elaborate home setups need bridges
Amos Wenger: But to do that, you need a bridge, which is actually a Zigbee bridge. So because I was already in the Philips Hue ecosystem, I just bought their Bridge, which is 60 bucks. All the slides are in French because I looked for English versions of their store listings, but they don't have the same products and the same things in the same prices. Yeah, you have the Bridge, you just connect it over Ethernet or Wi-Fi.
This is the Ethernet version that I have. It has an IP address. It has access to the internet. And it also, if you go to the settings of Philips Hue it has the Zigbee channel. So you know it's Zigbee even if you weren't paying attention. And you can add that hub to your Apple Home as a secondary hub.
The main hub is going to be something like an Apple TV or a HomePod. For me, it's an Apple TV 4K. And then you can add as many bridges as you want in one of them. In my case, it's a Philips Hue Bridge.
James Munns: And if you're not looking at the slides- which you can see at sdr-podcast.com/episodes- Amos has apparently named their Apple TV "Living Room brick."
Amos Wenger: Yes, because it looks like a brick! My laptop is, um, 'crepe' because you can flip it open and closed. I have a 'souffle' which is my Mac studio. It's a bigger version of the 'pancake' which is a Mac mini. My home network is delicious.
So just want to quickly note that Philips Hue is dead, long live Philips Hue, but it's Signify Netherlands. As far as I know, Signify has always been making Philips Hue stuff under the Hue brand, but depending on where you look, some of the things are going to be marked as being from Signify or from Philips Hue. So, for example, the manufacturer of the Bridge here is Signify Netherlands BV.
arp-scan on Amos' local network
Amos Wenger: But then if you do an arp-scan on my local network, you'll see a bunch of Internet of stuff, Things, including the Bridge, and it's going to show up as Philips Lighting BV. So... they're just confused.
James Munns: And this is without even getting into who actually makes them because most of these devices are just white labeled. So typically there will be like an ODM in China where they say: we want a light bulb that speaks Zigbee that can work with HomeKit that has this power usage or this lighting profile and stuff like that. Philips might be one of the exceptions. I think they still get their stuff made there, but it's less off-the-shelf. But a huge amount of these smart home things are just coming out of 4 or 5 original design manufacturers in China.
You can either have what's called a CM, which is a contract manufacturer, which is like, "We've designed it and we want you to build it." And then ODMs are sort of both. You go to them and you go, "We want a light bulb that does Zigbee that has these LEDs for this amount of money." And then they design it and they design it in a way that they can manufacture it. And a lot of times they copy and paste that design, not as a negative thing, like if you go to a company, they're going to pull off their shelf to give designs, and most of the time it's just sometimes different plastics or labels or the booklet is different.
And this is the same for a lot of things like Bluetooth headphones or smart speakers and stuff like that, if you wonder why they all work the same and they make the same beep and they do the same thing and they show up as the same thing on your phone, it's because there's like four companies that make all the Bluetooth speakers in the world. And these companies are just putting their label on it. And then eventually when they go broke five years later, it's like: okay, who supports those devices?
Amos Wenger: The slide we're looking at is a result arp-scan and it's showing IPv4 address, Mac addresses and vendor, looked up from the OUI database that you can get from the IEEE website. I did that today. And we can see a bunch of vendor names.
There's Apple Inc. of course, I have a iPhone and stuff, and Apple TV. There's FREEBOX, that's my ISP. iRobot Corporation is the cleaning robot, the Roomba, and then we have... well, Logitech, I forget what Logitech thing I have in my house that's on the Wi-Fi, so that's frightening, I should check that. Visionscape Co. Ltd. I don't know what that is. Raspberry Pi (Training) Ltd. I know what that is, we're getting to that, unfortunately. But then there's also Hon Hai Precision Ind. Co. Ltd? And I forget what that one is. I knew at some point, but I don't remember. And then some that are just not in the database. So who knows what they are.
So you buy the Philips Hue bridge, and then you add it as a secondary bridge to your HomeKit thing, and what it does is that it acts as this Zigbee bridge, and then it exports those to Apple HomeKit, so suddenly all the things you had in your Philips Hue app, you can also show them in your Apple Home app, and then you can tell Siri, "Hey..." I'm not gonna say the full sentence, because it's gonna turn off all the lights, but you can tell Siri to turn things on and off.
Which doesn't really work for my devices on Wi-Fi. My key lights and my Roomba: they're just on the Wi-Fi, they can't talk to the Philips Hue bridge.
If you give a mouse a cookie... more purchases!
Amos Wenger: So what do you do? Well, you buy a Raspberry Pi Zero 2 W And then you add an open source app called Homebridge on it and that lets you talk to a bunch of different things: it costs you 20 bucks, so pretty reasonable price point It's a third of the Philips Hue Bridge. It's a 1GHz quad core ARM Cortex A53 CPU, 64 bit CPU for 20 bucks, with 512MB of RAM. This is, like, amazing.
It does speak Wi-Fi, it does speak Bluetooth 4.2, has a mini HDMI port, so if it doesn't boot, you can actually put a screen on there, you can plug in a keyboard and everything. It's a tiny computer. I actually had mine powered by plugging the USB-C into my internet router. That was enough power to run it. So it was just like, it was hanging off of my router, this little like red cable with a Raspberry Pi Zero 2 W hanging off of it.
And then HomeBridge has a bunch of plugins. I'm showing a screenshot with a HomeBridge Hue, which I wasn't using 'cause I actually had the Philips Hue Bridge,
but I had like a plugin for my key lights from some random guy on the internet- thanks random guy! Derjayjay, big up.
and then Homebridgeroomba2, this one is actually under the homebridge-plugins organization. This is a Homebridge verified badge, I don't know what that means exactly.
And what that means is that I'm happy again, everything works. I can just buy more Philips Hue stuff, like a dimmer switch, the more recent model: 22 euros for one switch. A smart plug: 35 euros. A connected button, 22 euros. I thought this one was a thing you could turn to like dim lights, but no: it's just a button. You can take the button out of the thing if you want to take the button with you. So the round thing detaches. And then you can just have the button in your hand.
James Munns: Well, that's handy.
Amos Wenger: Who, wouldn't look at this and assume that's the thing you can turn on, like-
Amanda Majorowicz: Well, yeah, what's the point? You just go bonk and you, like, that's, you turn and boom.
James Munns: Well, I'm pretty sure I don't speak a lot of French, but 'bouton', I'm guessing means button.
Amos Wenger: I mean, yes, if I had only read the description, but I was on Amazon, I just was like, "This thing looks like you can turn it," and you can, because it's just like magnetically attached to the support. But imagine my surprise when it just came off and it was: Oh, it's by design. Like even the butt of the button looks okay, so it's meant for it to happen. It's not dysfunctional or anything.
So you buy a bunch of those and then you can attach them to the wall with 3M adhesives and then your original light switches become useless because if you actually use them, it cuts the power to the smart bulb and then they don't work anymore, you can't turn them off and on, you can't dim them, it just resets the thing. So what do you do?
Home automation makes us all electricians
Amos Wenger: You buy one of these, also Philips Hue. It's a wall switch module. It costs 45 bucks and it's tiny enough that you can actually disassemble your switches. This is the part I really wanted to talk about. I'm pretty sure I told my landlord I was doing this, so it's okay. I will still have a place to live after this episode goes live.
First of all, don't do this. Do not do this, but if you're gonna do this, be like me and actually buy electrician tools, buy a thing that tests the there's no electricity anymore. And there's no electricity because you turned off the-
James Munns: Turned off your breaker and you actually made sure that it's not still live...
Amos Wenger: Yeah, yeah, yeah, yeah, and it's not a thing with a capacitor that will shock you even though the thing is turned off, so don't do this, but if you were... if a friend were to do it, here's what they would do.
James Munns: Do it good.
Amos Wenger: They would first like, unclip. There's always a thing you can unclip around the exterior side of the switch. And then that would reveal some screws that you could unscrew, and then you would see how the switch is wired up. And that's where you would test with actual electrician equipment that there's no current in it, it's fine to keep going.
They have the most vicious little jaw things you can press somewhere and it releases the cable instead of just using screws everywhere. Screws are so much nicer. So you can remove the original set of cables and then you can put in the tiny tiny- in comparison- cables that come with the Philips Hue Wall Switch Module. And that's great...
And also give you something that makes sure that the smart bulbs get power all the time. I don't even know what to call it.It joins two cables together instead of being a switch. It's just a short circuit on purpose.
And this is fine. It's just instead of running 220 volts AC through your switch...
James Munns: You keep just saying, "This is fine." I'm starting to wonder if this is in fact, are you okay?
Amos Wenger: It is! I'm okay. This is like the reasonable part of it. Things are gonna get much more unsafe very soon.
James Munns: Oh no.
Amos Wenger: This is fine if you have smart bulbs everywhere, which is fine if you have like one ceiling bulb, you can just- I don't know- spend 60 bucks and make it something that goes warm or blue.
But if you have a series of spots, for example, if you have a whole rail of them, is that? No, rail is French... how do you say in English? A rail?
James Munns: I mean, if you have those lights that like hang over your countertops and can be positioned, usually those are called a rail of lights, but like a whole row of lights?
Amos Wenger: Exactly! Because in my mind, rail goes to coke and sundress. There's no middle- whatever.
James Munns: Jesus! Wow...
Amanda Majorowicz: Okay, we are getting explicit.
Amos Wenger: So this is fine if you have smart bulbs, but if you don't, you need something like a smart relay. It is available as a thing on Zigbee, you can turn it on and off, and it will actually act like a switch. It will either make the electricity pass, or it will cut it, just like a regular switch would do.
French electrical wiring fiasco
Amos Wenger: But the problem is, it needs to handle 220 volts AC, at least in France. And the other problem is, at least in France, there's essentially two cables you have to worry about, not counting Earth. You have neutral and you have phase. In France, neutral doesn't come all the way to the switches. We only have phase coming to the switches and it sounds weird.
James Munns: Okay.
Neutral goes all the way to all the lights. And phase comes all the way to the switches and then out of the switches into the light. which means if you buy a smart relay that expects to have neutral and phase in, it won't work because you don't have neutral all the way to the switch. And I'm not about to be running neutral wires through the walls in a rental unit. That doesn't make sense. I wish one of us was an electrician because there's a bunch of countries to save copper like during World War II and stuff like that came up with a bunch of different things. Like the UK has this thing called a ring main-
Amos Wenger: Yeah, I know!
James Munns: Instead of, having sort of like a hub and spoke thing-
Amos Wenger: They're so proud of it, too!
James Munns: Yeah, yeah- well, you're like: well, you have two paths to power, which means you can have twice as much current with half as much wire! Unless it gets disconnected in the middle, and then you just have a giant floating voltage differential in your house. I didn't know France also had its own quaint version of that.
Amos Wenger: Well, I don't know. It works. It's fewer wires.
Luckily, this Chinese brand, whatever, called Sonoff also makes smart relays that don't actually need neutral. You have live in, live out. And then you have switch one, switch two, and then you have different ways you can set it up. You can either also put the phase in the switch and then out of the switch into S2, or you can have the switch between S1 and S2 and that those both work.
And you have different settings for rocker switches. There's a bunch of combinations you can do, but this is actually what I wanted in the first place.
What I thought the Philips wall switch thing did, I want something that lets me connect the original switch to it. And then also acts as a relay so that I can toggle it remotely from my phone using Apple HomeKit
Compatibillity in the ecosystem
Amos Wenger: The problem is those do not really work with Philips Hue? Like I said, manufacturers have tried to maintain a semblance of compatibility in the Zigbee ecosystem but the thing is: it's just a bunch of payloads.
If there's a field they don't know, then they're not gonna do anything with it. And so all the Philips stuff has a hard coded database of all devices they sell, and they know what fields mean, and that's why it works with their bridge, and they translate that to stuff that Apple HomeKit can understand.
But the freaking smart relay I just got: it doesn't know what to do with it. So even if you could pair it with, it would be like, "Weird device, we don't know what it is, is it a lightbulb? Maybe?" But it's not.
James Munns: Bluetooth even tried to handle this. So they designed this whole system where every endpoint on Bluetooth is called a characteristic and it's a UUID. So you identify everything by a UUID and they have this database of well known ones and you can register them. You can say like, "Ah! I am a heart rate monitor. I am a thing!" Cause they assumed that everyone would go, "Ah! I will implement the heart rate monitor interface, and I will implement the smart band interface." And there's this whole thing where you can register this.
And what actually ended up happening is everyone just makes a custom characteristic where they just shove bytes across it, like a serial port. And then it only works with their app because it only works with whatever bytes their app expects to shove across this. So, like, I've joked with other embedded people: it's like you either will have a standard ... it's bare minimum that everyone implements it because it's so simple, but like everyone hates how simple it is. Or if you have any kind of extension ability on it or the ability to transport some other protocol on top of this one, everyone will do totally proprietary and just figure out how to make it work for their one device, and everything is terrible.
It's the carcinization of open standards is either: we'll be diluted to the simplest thing and no one can ever change it because everything will break. Or: everything just breaks day one, and it's successful because you can extend a million things over it, but nothing works together.
Amos Wenger: So we're very much getting into this.
I was like, okay, I have a thing. I have Homebridge. Maybe I can get Homebridge to speak Zigbee or whatever. The problem is my Raspberry Pi Zero 2 W- I can never remember the order of things. What the frick kind of branding is this?- doesn't speak Zigbee. So what do you get?
You get an adapter. This is the ConBee III and it speaks Zigbee, And it has this nice little USB-A port. You know what the problem is James?
Can you point me to the USB-A port on that Raspberry Pi Zero 2?
James Munns: You need a dongle for your dongle!
Amos Wenger: No, you can't!
James Munns: No, you can. You can buy an OTG to USB-A socket cable, and then you can plug your USB-A in through your USB OTG port. And if you look on the bottom of that board, there are also pogo pads. So you can buy adapters that will give you a hub on that.
Amos Wenger: Sure..
James Munns: Because there are gold contacts on the bottom that are connected to the USB port.
Amos Wenger: Okay, yeah, sure Okay, okay.
Final hardware setup
Amos Wenger: Well, what I did instead is I bought a Raspberry Pi 4
James Munns: A much- a much more reasonable choice.
Amos Wenger: Yeah, because the time it takes for them to ship one to me is smaller than the time it takes for me- and the cost is not really an issue. I think I have the listing somewhere...
James Munns: With all of the switches and light bulbs you've shown so far, I don't think the $40 Raspberry Pi is going to break the bank on this one.
Amos Wenger: I think it was more like 60, but this one actually does have USB -A ports, so you can just plug the thing in.
I got the kit, which comes with those nice little heatsinks that you have to install yourself.
I got the nice little box as well, which is kinda wonky.
And you can see a shot of my actual living room! That's the latest FREEBOX, which is actually very nice. It does Wi-Fi 7, it's the only thing in the house that can do Wi-Fi 7, it's very sad and alone, just like the Apple TV.
And then you have the Philips Hue bridge, and then you have, my own bridge, and at that point...
Full Home Assistant set up
Amos Wenger: Homebridge is a thing to bring together third party devices into the HomeKit ecosystem. And if you're replacing an existing bridge with something else, you want more something like Home Assistant. I kept hearing about it, so I installed it. It's a pile of Python... and Javascript, and whatever, and you can see a shot of it.
You can see like all the smart things I have in my home, you can see I have two different Apple TVs, I have one downstairs, one upstairs, I have a bunch of different lamps. Not all of them are smart bulbs, some have smart relays on there, and you can see it's sunny, and 10 degrees, and you can see I have the CO2 detector thingy, the Aranet4. There's a very nice E Ink display. Home Assistant is good, you can see what time I got up this morning. I said good morning to Siri at 9:19 a.m.. And it turned on all full blast, all the bulbs in my bedroom.
You can see everything. So, you know, If someone wanted to creep on you and they had access to that, they could tell a frightening amount of things about your life, which is a good reason to secure it. You can see I have two notification settings. Those are almost definitely security updates. I should go do that.
The ConBee III works.
these are all the Zigbee devices I have connected to my ConBee III adapter. I still have some things on the Philips Hue Bridge, I need to like, dissociate them, re-pair them with a new bridge, move things over. But I already had a bunch of switches from Signify Netherlands BV- which we know is Philips Hue- already connected to the new bridge. And this was interesting.
I had to add something called a quirk So the thing that bridges Home Assistant together with... well, with HomeKit is a plugin, but then there's also a bridge between Home Assistant and Zigbee, which is called ZHA. as I mentioned: there's no real standard, like, Zigbee is this minimal thing, they can just put whatever they want in there. Sometimes, you have to add knowledge of some devices, especially, in this case, the switch is like a more recent model of whatever they had in their database, so you just add a little Python file on your Home Assistant thing which runs on the Raspberry Pi 4 which is next to the Apple TV.
Yeah, you just paste in some Python code, and suddenly things start working- but how do you paste in Python code into a Raspberry Pi 4 which is not even hooked up to a display?
Code your own Smart Home
Amos Wenger: Well: there's a plugin to Home Assistant called Studio Code Server and it opens Visual Studio Code in your browser, and you get syntax highlighting and everything and it's kind of amazing.
James Munns: I am astounded and I don't ... I don't know how positive that sentiment is, but it is certainly astounded.
Amos Wenger: Once you do that, there's a "Manage Zigbee device" in the configuration thingy and you can go to Philips basic cluster and mode and write the value like 1, 2, 3, or 4 depending on how you want your switch to act because it's a double switch thingy.
Honestly, I probably should have just bought another Zigbee device that is actually supported, but I was like, "I bought the Philips thing, I will use it."
And then of course you have to create automations because you now have something that has a turn on and turn off events and you have lights that can be turned on and off, but you need to somehow 'when this happens, do that' action. And so you have to add automation to yourself, which again, you can also write as code, there's a thing called blueprints. You can click a button, it installs to your Home Assistant.
There's a whole ecosystem of things because it's like Python, because it's scripting languages, it's very accessible, so a lot of people write things. So it's hard to tell if it's high quality or not, but also almost everything has a version of something that used to work at some point in a forum.
It's like we're back in 2000s! You just have to go somewhere on a forum, find a solution for your problem. It's kind of charming really.
And so that explains the tweets from October 25 saying, "gutted to announce that python is now involved in turning on my living room lights," which is true! It is! And it works.
James Munns: Oh yeah. A lot of Python.
Amos Wenger: Yeah. Pile of it. So because it's like this very open source- I mean it in both sense of the term, have you ever heard of the 'open sores', like S O R E S expression? It's already an explicit episode cause we're keeping everything I said.Because it's all so open, it's kind of wonky sometimes, even though the onboarding is fine, honestly, but you can make anything happen. You could have an if statement based on the time of day. Things that, because they're useful are already provided by ecosystems like the Apple Home thing and the Philips Hue thing.
So in Apple Home there's a thing called Adaptive Lighting and it's going to change the color of the light as the day progresses. So in the morning it's going to be bluer and in the evening it's going to be warmer, more yellow, so that it helps you go to sleep. And then Philips has a different thing, which is depending on when you hit the switch, when you turn on the lights, it's going to go to a different scene, which has a different color, but it's the basic idea of, yeah, blue in the morning, yellow in the evening.
Smart Home as a hobby and other anecdotes
Amos Wenger: I don't really have a conclusion. My last slide is "still cheaper than therapy" because it's expensive! I thought I had- no, no, no- I've been posting on social media about anger issues. This has helped a lot. Like, the anger management classes have helped too, but just being able to say, "Hey Siri, shut down everything." I do not want to get up again to turn off the freaking switches. Just turn off everything has been great. Honestly, you should try it.
That's it.
Amanda Majorowicz: I was afraid that you saying that right then was going to turn off all your stuff and we'll be like, "Okay, bye, Amos!"
James Munns: Yeah. The computer- we just lose the video feed.
Amanda Majorowicz: Exactly. We were like, "Okay, and that's the end."
James Munns: It seems like one of those hobbies that appeals to folks who really like knowing a lot about the hobby. I say that without any derogatory connotation, because I have those too. This is not one of them, but it's like coffee or cars or wine or whatever, it's like: you do it, and then you go on forums and you talk about it and then you go to a local meetup about it... I guess, where would you have the meetup for the home automation one? It's got to be at someone's house so they can show off all of that. And then someone like crashes all the Zigbee devices in the house.
Amos Wenger: Yeah, you're not wrong, but it's also frighteningly accessible, because you can buy a relay for 20 bucks and they're like, "Yeah! Just play electrician. What could go wrong?"
I grew up with a dad. He was a bit like a DIY type. So I learned some things not to do. I always did this when at least some other person was in the house and we went over like basic safety, like: what happens if I go electrocution sounds what do you do?
James Munns: Hit me with a stick, and not a conductive one.
Amos Wenger: Exactly! but now when I'm at other people's places, I miss it. You go into a room and the light is at 100 percent and you're like, "Uh! Can you tone it down?" And they're like, "What do you mean, tone it down? It's on or off, that's it."
Amanda Majorowicz: I would love to improve all of the lighting in this apartment. I do have a funny story about Home Assistant, if I can tell it?
So we have a Google Home Pod thing in the living room. My partner is Spanish and he set it up in Spanish, obviously, cause he talks to his stuff in Spanish.
I would only be able to turn on the lights in there if I said, you know, "Okay, 'the thing,' enciende salón," so like 'turn on the lights in the living room.' And then I set up Home Assistant on my phone and it was in English, and I tried to turn on the lights in the living room in Spanish and my Google Assistant responded and said, "I don't know what you're saying."
And I was like, "Oh, that's interesting. Cool. So then I now have to talk to it in English." Then there was a time where my partner and I were in the living room and we were talking in English. And then he tried to talk to the Google Home Pod in English and tell it to "Turn off the lights." And I swear to you, the Google Assistant responded in English with a Spanish accent, "Sorry, I don't know what you're saying."
James Munns: Perfect.
Amanda Majorowicz: And I'm just like, "... what?" We both... It was crazy. It was so weird.
Amos Wenger: Yeah, but that's such a fun failure mode. This is something that they could write and in a sci-fi book a decade ago. And I would go, "That's not how computers work. They would never do that." But now with LLMs and stuff, it could! I was chatting, I was using like advanced voice mode with ChatGPT, and it started randomly responding in different languages, but switch between French and English.
And then I asked, "Why are you switching every time?" And it's like, "Okay, now when you speak French, I will respond in English. And when you speak English, I will respond in French!" I'll be like, "Ha! How did you get that idea?!" and that's the opposite of what I want.
Amanda Majorowicz: "Why are you thinking like that?" I don't know!
Well, anyways, this episode, I learned some stuff, I followed along much more than a lot of the other episodes. So thank you for entertaining me at the very least.
Amos Wenger: Yeah, I specifically made this slide deck for you. I had like eight different ideas and you were like, "This is the only one that's interesting to me."
Amanda Majorowicz: I was like, "This one! I think I know about this one!"
Amos Wenger: Yeah.
James Munns: A hilarious amount of the stuff that I've done with Postcard RPC and Postcard actually comes from projects of me trying to do home automation stuff, but my insistence was I have to design the whole protocol and all the devices from scratch, and never got far enough. I have a handful of devices, none of them talk to each other. The lights behind my couch, I have a button and it controls them and I can change the colors on them and things like that, but I've built like three or four wireless and wired control protocols before. I'd usually get like one thing working and then I'm like, "Ah, the protocol isn't good enough." Then eventually I'm like, "Ah, I want to do something else." And I get stuck on another hobby instead. It's like putting a puzzle in front of someone before they're allowed to do something.
Amos Wenger: Yeah. Honestly, like I think Zigbee is going to be around for a long time and it's not the worst solution.
James Munns: Well, it's the worst solution except for all the other ones.
Amos Wenger: No, the worst solution is Wi-Fi, cause like... People always put it on their home network and it's bad. But Zigbee is fine, it's small and innocent and, it'sencrypted with a es 128 bit, I think?
James' take on why Wi-Fi is bad
James Munns: It can be. Yeah. Yeah. I was going to say: Wi-Fi is bad for two reasons. One is that the devices have access to the internet. Like that just intrinsically is a bad thing, which is also something I'm fairly surprised and worried about with Thread and Matter because they plan to bridge to the internet as well.
The second one is that when it comes to radios, amplifiers are the expensive part, and you need amplifiers for both sending and receiving. And the problem is that Wi-Fi as a protocol expects every device to always be accessible. Which means that your device always needs to be listening if the router talks to it, which means it always has to have basically like the ear amplifier turned on.
There are some fixes to this that aren't HaLow. Like HaLow is a very big one in that it changes that, but I think Wi-Fi 7 or 7 E introduces what's called TWT or target wake time,
Like that's one of the big things that BLE does and Zigbee does because what you want are typically called sleepy devices. You want them to shut the receiver down and you want them to go to low power mode, sleep for 18 seconds, wake up, turn the receiver on for as short as possible, vomit all the data in both directions and then go back to sleep because it means that on average in an hour, your receiver's only on .01 percent of the time instead of 100 percent of the time.
Amos Wenger: I just wanted to mention that I do not mean to kink shame but Bluetooth 6.0 introduced something called Bluetooth channel sounding and that's too much even for me.
James Munns: I have to go now
Episode Sponsor
CodeCrafters is a service for learning programming skills by doing.
CodeCrafters offers a curated list of exercises for learning programming languages like Rust or learning skills like building an interpreter. Instead of just following a tutorial, you can instead clone a repo that contains all of the boilerplate already, and make progress by running tests and pushing commits that are checked by the server, allowing you to move on to the next step.
If you enjoy learning by doing, sign up today, or use the link in the show notes to start your free trial. If you decide to upgrade, you'll get a discount and a portion of the sale will support this podcast.