Learn how to setup a private smart home from scratch with Home Assistant and a Raspberry Pi. Add the OpenAI integration to give GPT-4 and ChatGPT access to your home's data. 

Get a Free ESP32 microcontroller thanks to Brydge https://bit.ly/44Nkode

#tech #iot #ai

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

Home Assistant https://www.home-assistant.io
Home Automation example https://www.reddit.com/r/homeassistant/comments/zzg0a4/our_guests_will_have_a_small_surprise_for_the/
Raspberry Pi in 100 seconds https://youtu.be/eZ74x6dVYes

🔥 Get More Content - Upgrade to PRO

Upgrade at https://fireship.io/pro
Use code YT25 for 25% off PRO access 

🎨 My Editor Settings

- Atom One Dark 
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- How to setup Home Assistant
- Can GPT-4 control a smart home?
- Smart home tips and tricks
- How to make smart home private
- Raspberry Pi Home Automation
- Home automation quick tutorial
- Smart homes of the future
2024-02-04T05:06:13.183Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
d5ae7c0d-f736-4edd-9a80-de818e5e6b31
dbaf3194a98b91858a88137004371fbca961db80b5ce9612616811f5fab01ff3
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
Today, I'm going to build a private and secure smart home from scratch, then stupidly give up my privacy by letting GPT 4 in the front door.
Here's what almost every day of my life looks like.
Wake up at 5 AM.
Turn on my lights.
Microwave a breakfast hot pocket.
Check on the baby.
Turn on computer and wait 10 minutes for Windows to update.
Write some code.
Make a YouTube video.
Microwave a lean pocket.
Open the door for friendly strangers.
Join a new religion.
Boil wash their dishes.
Turn out with lights.
Premium rocket.
Michael, it's a beautiful life, but highly inefficient.
Every time I turn on a light, it takes 500,000 microseconds out of my day.
Over the course of a year, that's like 2 weeks spent just turning on lights.
Luckily, there's a free and open source tool called Home Assistant that can automate and control all of the technology in our homes.
In today's video, We'll build a smart home from scratch, and look at all the crazy things people do with home automation.
But most importantly, we'll keep all the data private to your home work, which means hackers and feds can't spy on you.
Then we'll completely break that rule by giving our data to OpenAI to integrate it with ChatGPT, giving us a glimpse into what a next generation smart home might look like.
But first, we've got a huge giveaway thanks to our awesome sponsor, Bridge.
They're a startup that's building a protocol that enables IoT devices powered by at Bluetooth Low Energy to leverage the cloud.
What's awesome though is that these smart devices don't need to be fitted with cellular or WiFi connectivity.
Instead, they use mobile apps as an Internet gateway way to effectively bridge data between the Internet and the IoT device.
And that's huge because it means you can now build IoT products without the need for cellular or Wi Fi on your where I've been playing around with it myself with an ESP 32 microcontroller, and now you can too because Bridge is shipping out 100 of these boards for free right now.
Once you have one, you just install or firmware download the demo app, and then you can start securely storing interactions like inputs from a sensor on the back end ledger as part of the bridge protocol.
And if you manage to build something Cool.
You could even connect it to your Home Assistant, which we're going to set up right now.
But first, what is Home Assistant exactly?
It's a free and open source project in Python that allows you to control all the technology in your home locally, where your privacy can be protected.
It runs a UI on your local network, where you can manage all these devices and automate them based on different events that happen in the world.
This can all be done without writing any code, or you can write your own custom blueprints in YAML.
It has a Huge community and people do all kinds of crazy stuff with it.
It can do simple things like cook your hot pocket when you wake up or turn your entire house into a rave when the sun goes down.
The possibilities Endless, so let's go ahead and get it set up.
You'll first need a dedicated server or machine to host it.
It could be an old computer you have lying around, and Home Assistant runs on Mac, Windows, and Linux, But I think the ideal option is a Raspberry Pi.
I'm going to be using a Raspberry Pi 4, which are very hard to come by as of today, but it works just as well on a Pi free.
In addition to the Pi itself, you'll wanna make sure you have a good power supply, an ethernet cable, and a micro SD card with at least 32 gigabytes.
But the more memory you have, the better, especially if you plan on storing video data.
And then finally, you'll need a way to read an SD card like a USB micro SD reader.
And now Now we can move on to step 2, installing Home Assistant on the Pi.
Plug your SD card into your primary computer, then download the Raspberry Pi Imager program.
This is an official Raspberry Pi a tool that'll help you download the right operating system.
Click on choose OS, then go to other specific purpose, then home automation, then home assistant, and then you should see the distro for the Raspberry Pi 4 or 3.
Go ahead and select the one for your model, then click on choose storage and select your SD card.
Now click right, and it We'll download, install, and verify that operating system on the SD card.
When that's done, you can pop it out and insert it into the Pi.
And now in step 3, we can take the Pi, connect Connect it to the power supply, then use the Ethernet cable to connect it to your Wi Fi router.
It'll take a few minutes to boot up, but you should now be able to access the Home Assistant website from your local network.
And you'll also likely want to install the Home Assistant iOS or Android app to control your house from your phone.
The first time you access it, it'll take you through the onboarding process where you create a username and password.
Once that's done, it will take you to the dashboard.
Then from here, you'll likely want to go to the settings tab, and then link up any smart devices you have in your home, like Casa plugs, your Nest thermostat, Zigbee switches, Roombas, dishwashers, cameras, and so on.
Once you have a device connected, You can then control it manually.
Some devices are simple, like a smart plug you can just turn on and off with a switch, but other devices are more complex.
Like Like, my smartphone has all kinds of different sensors, and I can access them to do something in my home when something changes on my phone.
Like, maybe when the battery level gets low, I trigger a shock collar to remind myself to plug it back in.
Home Assistant is all about doing automations like this.
If we go to the automations tab, the first thing you'll need to automate something is trigger.
This could be a certain time on the calendar.
It could be an event, like when a button is clicked somewhere.
It could be a message passed from some other device using MQTT.
It could be a webhook from some external service, and a variety of other patterns.
From there, you can optionally add conditions to make sure the trigger is only activated if a if certain condition is met.
Like, maybe you don't want to run any alarms if it's the middle of the night.
And then finally, an action is the thing that should happen when the trigger occurs.
Most often, this will be something on Device, like maybe you want to switch a plug on or off, or you might want to send a push notification to your phone.
That's pretty cool, but sometimes you might have a lot of actions that you want triggered all at once.
Like In my case, I don't want my kids getting out of bed before 7 AM, so I programmed a system that lets them know when it's time.
At exactly 7 AM, their light bulbs turn green, their speaker plays Eye of the Tiger, the printer prints them a list of chores, kitchen starts making breakfast, and the Roomba follows them around to clean up any messes.
And pretty soon, I'll be able to hook up a full self driving Tesla to it to automatically drive them to school.
To Organize that more efficiently, I created a scene.
A scene allows you to organize the state of multiple devices in a single place.
That means you can reactivate that scene from multiple triggers or do do it manually with a single click.
But sometimes a scene is not enough.
With scripts, you can create an entire sequence of events.
Occasionally, I want my house to go into party mode, where The lights fade in and fade out and flash different colors, but to make that happen, we need to code in some delays and other patterns to synchronize all the lights.
We can Implement this logic entirely from the home assistant UI, or if you're more comfortable with code, everything can be represented in YAML.
But what's really awesome about the code is that it can be shared with other people.
There are all kinds of home assistant blueprints that give you preconfigured functionality so you don't have to do all this stuff manually.
Like, you just import a blueprint to manage your solar panels, make some minor changes, and you're done.
There's so much cool Stuff to do here, and I could go on and on.
But now, I want to give up my home privacy to my AI overlords at OpenAI.
If you go to the integrations tab, you'll find all kinds of different Services and APIs that you can integrate into your workflow, one of which is an open AI integration giving us access to GPT 4.
It simply takes our API key and then formats a prompt with the current data or state of our smart home.
From there, on the home assistant dashboard, you'll notice a chat icon that allows us to access chat gpt within the context of our own home.
We can ask it questions about the current state of the home, but currently it can't take control over the home.
Although, I think you can see where this is going in the near future.
Dean Koontz, an author who wrote about the Wuhan 400 virus in the eighties, also wrote a book called Demon Seed in 1977 that describes a hyperintelligent smart home That locks a lady inside and has her bear its child.
So you might wanna be a little extra cautious when inviting GPT 4 into your smart home.
Thanks for watching, and I will see you in the next one.

Speaker 0: Today, I'm going to build a private and secure smart home from scratch, then stupidly give up my privacy by letting GPT 4 in the front door. Here's what almost every day of my life looks like. Wake up at 5 AM. Turn on my lights. Microwave a breakfast hot pocket.

Check on the baby. Turn on computer and wait 10 minutes for Windows to update. Write some code. Make a YouTube video. Microwave a lean pocket.

Open the door for friendly strangers. Join a new religion. Boil wash their dishes. Turn out with lights. Premium rocket.

Michael, it's a beautiful life, but highly inefficient. Every time I turn on a light, it takes 500,000 microseconds out of my day. Over the course of a year, that's like 2 weeks spent just turning on lights. Luckily, there's a free and open source tool called Home Assistant that can automate and control all of the technology in our homes. In today's video, We'll build a smart home from scratch, and look at all the crazy things people do with home automation.

But most importantly, we'll keep all the data private to your home work, which means hackers and feds can't spy on you. Then we'll completely break that rule by giving our data to OpenAI to integrate it with ChatGPT, giving us a glimpse into what a next generation smart home might look like. But first, we've got a huge giveaway thanks to our awesome sponsor, Bridge. They're a startup that's building a protocol that enables IoT devices powered by at Bluetooth Low Energy to leverage the cloud. What's awesome though is that these smart devices don't need to be fitted with cellular or WiFi connectivity.

Instead, they use mobile apps as an Internet gateway way to effectively bridge data between the Internet and the IoT device. And that's huge because it means you can now build IoT products without the need for cellular or Wi Fi on your where I've been playing around with it myself with an ESP 32 microcontroller, and now you can too because Bridge is shipping out 100 of these boards for free right now. Once you have one, you just install or firmware download the demo app, and then you can start securely storing interactions like inputs from a sensor on the back end ledger as part of the bridge protocol. And if you manage to build something Cool. You could even connect it to your Home Assistant, which we're going to set up right now.

But first, what is Home Assistant exactly? It's a free and open source project in Python that allows you to control all the technology in your home locally, where your privacy can be protected. It runs a UI on your local network, where you can manage all these devices and automate them based on different events that happen in the world. This can all be done without writing any code, or you can write your own custom blueprints in YAML. It has a Huge community and people do all kinds of crazy stuff with it.

It can do simple things like cook your hot pocket when you wake up or turn your entire house into a rave when the sun goes down. The possibilities Endless, so let's go ahead and get it set up. You'll first need a dedicated server or machine to host it. It could be an old computer you have lying around, and Home Assistant runs on Mac, Windows, and Linux, But I think the ideal option is a Raspberry Pi. I'm going to be using a Raspberry Pi 4, which are very hard to come by as of today, but it works just as well on a Pi free.

In addition to the Pi itself, you'll wanna make sure you have a good power supply, an ethernet cable, and a micro SD card with at least 32 gigabytes. But the more memory you have, the better, especially if you plan on storing video data. And then finally, you'll need a way to read an SD card like a USB micro SD reader. And now Now we can move on to step 2, installing Home Assistant on the Pi. Plug your SD card into your primary computer, then download the Raspberry Pi Imager program.

This is an official Raspberry Pi a tool that'll help you download the right operating system. Click on choose OS, then go to other specific purpose, then home automation, then home assistant, and then you should see the distro for the Raspberry Pi 4 or 3. Go ahead and select the one for your model, then click on choose storage and select your SD card. Now click right, and it We'll download, install, and verify that operating system on the SD card. When that's done, you can pop it out and insert it into the Pi.

And now in step 3, we can take the Pi, connect Connect it to the power supply, then use the Ethernet cable to connect it to your Wi Fi router. It'll take a few minutes to boot up, but you should now be able to access the Home Assistant website from your local network. And you'll also likely want to install the Home Assistant iOS or Android app to control your house from your phone. The first time you access it, it'll take you through the onboarding process where you create a username and password. Once that's done, it will take you to the dashboard.

Then from here, you'll likely want to go to the settings tab, and then link up any smart devices you have in your home, like Casa plugs, your Nest thermostat, Zigbee switches, Roombas, dishwashers, cameras, and so on. Once you have a device connected, You can then control it manually. Some devices are simple, like a smart plug you can just turn on and off with a switch, but other devices are more complex. Like Like, my smartphone has all kinds of different sensors, and I can access them to do something in my home when something changes on my phone. Like, maybe when the battery level gets low, I trigger a shock collar to remind myself to plug it back in.

Home Assistant is all about doing automations like this. If we go to the automations tab, the first thing you'll need to automate something is trigger. This could be a certain time on the calendar. It could be an event, like when a button is clicked somewhere. It could be a message passed from some other device using MQTT.

It could be a webhook from some external service, and a variety of other patterns. From there, you can optionally add conditions to make sure the trigger is only activated if a if certain condition is met. Like, maybe you don't want to run any alarms if it's the middle of the night. And then finally, an action is the thing that should happen when the trigger occurs. Most often, this will be something on Device, like maybe you want to switch a plug on or off, or you might want to send a push notification to your phone.

That's pretty cool, but sometimes you might have a lot of actions that you want triggered all at once. Like In my case, I don't want my kids getting out of bed before 7 AM, so I programmed a system that lets them know when it's time. At exactly 7 AM, their light bulbs turn green, their speaker plays Eye of the Tiger, the printer prints them a list of chores, kitchen starts making breakfast, and the Roomba follows them around to clean up any messes. And pretty soon, I'll be able to hook up a full self driving Tesla to it to automatically drive them to school. To Organize that more efficiently, I created a scene.

A scene allows you to organize the state of multiple devices in a single place. That means you can reactivate that scene from multiple triggers or do do it manually with a single click. But sometimes a scene is not enough. With scripts, you can create an entire sequence of events. Occasionally, I want my house to go into party mode, where The lights fade in and fade out and flash different colors, but to make that happen, we need to code in some delays and other patterns to synchronize all the lights.

We can Implement this logic entirely from the home assistant UI, or if you're more comfortable with code, everything can be represented in YAML. But what's really awesome about the code is that it can be shared with other people. There are all kinds of home assistant blueprints that give you preconfigured functionality so you don't have to do all this stuff manually. Like, you just import a blueprint to manage your solar panels, make some minor changes, and you're done. There's so much cool Stuff to do here, and I could go on and on.

But now, I want to give up my home privacy to my AI overlords at OpenAI. If you go to the integrations tab, you'll find all kinds of different Services and APIs that you can integrate into your workflow, one of which is an open AI integration giving us access to GPT 4. It simply takes our API key and then formats a prompt with the current data or state of our smart home. From there, on the home assistant dashboard, you'll notice a chat icon that allows us to access chat gpt within the context of our own home. We can ask it questions about the current state of the home, but currently it can't take control over the home.

Although, I think you can see where this is going in the near future. Dean Koontz, an author who wrote about the Wuhan 400 virus in the eighties, also wrote a book called Demon Seed in 1977 that describes a hyperintelligent smart home That locks a lady inside and has her bear its child. So you might wanna be a little extra cautious when inviting GPT 4 into your smart home. Thanks for watching, and I will see you in the next one.
Today, I'm going to build a private and secure smart home from scratch, then stupidly give up my privacy by letting GPT 4 in the front door. Here's what almost every day of my life looks like. Wake up at 5 AM. Turn on my lights. Microwave a breakfast hot pocket. Check on the baby. Turn on computer and wait 10 minutes for Windows to update. Write some code. Make a YouTube video. Microwave a lean pocket. Open the door for friendly strangers.
Join a new religion. Boil wash their dishes. Turn out with lights. Premium rocket. Michael, it's a beautiful life, but highly inefficient. Every time I turn on a light, it takes 500,000 microseconds out of my day. Over the course of a year, that's like 2 weeks spent just turning on lights. Luckily, there's a free and open source tool called Home Assistant that can automate and control all of the technology in our homes. In today's video, We'll build a smart home from scratch, and look at all the crazy things people do with home automation. But most importantly, we'll keep all the data private to your home work, which means hackers and feds can't spy on you. Then we'll completely break that rule by giving our data to OpenAI to integrate it with ChatGPT, giving us a glimpse into what a next generation smart home might look like. But first, we've got a huge giveaway thanks to our awesome sponsor, Bridge. They're a startup that's building a protocol that enables IoT devices powered by at Bluetooth Low Energy to leverage the cloud. What's awesome though is that these smart devices don't need to be fitted with cellular or WiFi connectivity. Instead, they use mobile apps as an Internet gateway way to effectively bridge data between the Internet and the IoT device. And that's huge because it means you can now build IoT products without the need for cellular or Wi Fi on your where I've been playing around with it myself with an ESP 32 microcontroller, and now you can too because Bridge is shipping out 100 of these boards for free right now. Once you have one, you just install or firmware download the demo app, and then you can start securely storing interactions like inputs from a sensor on the back end ledger as part of the bridge protocol. And if you manage to build something Cool. You could even connect it to your Home Assistant, which we're going to set up right now. But first, what is Home Assistant exactly? It's a free and open source project in Python that allows you to control all the technology in your home locally, where your privacy can be protected. It runs a UI on your local network, where you can manage all these devices and automate them based on different events that happen in the world.
home improvement
phones
infrastructure
technology
internet
telecommunications
religion
computers
software
electronics
renewable energy
This can all be done without writing any code, or you can write your own custom blueprints in YAML. It has a Huge community and people do all kinds of crazy stuff with it.
It can do simple things like cook your hot pocket when you wake up or turn your entire house into a rave when the sun goes down. The possibilities Endless, so let's go ahead and get it set up. You'll first need a dedicated server or machine to host it. It could be an old computer you have lying around, and Home Assistant runs on Mac, Windows, and Linux, But I think the ideal option is a Raspberry Pi.
computers
cooking
I'm going to be using a Raspberry Pi 4, which are very hard to come by as of today, but it works just as well on a Pi free. In addition to the Pi itself, you'll wanna make sure you have a good power supply, an ethernet cable, and a micro SD card with at least 32 gigabytes. But the more memory you have, the better, especially if you plan on storing video data. And then finally, you'll need a way to read an SD card like a USB micro SD reader. And now Now we can move on to step 2, installing Home Assistant on the Pi. Plug your SD card into your primary computer, then download the Raspberry Pi Imager program.
This is an official Raspberry Pi a tool that'll help you download the right operating system. Click on choose OS, then go to other specific purpose, then home automation, then home assistant, and then you should see the distro for the Raspberry Pi 4 or 3. Go ahead and select the one for your model, then click on choose storage and select your SD card.
software
Now click right, and it We'll download, install, and verify that operating system on the SD card. When that's done, you can pop it out and insert it into the Pi. And now in step 3, we can take the Pi, connect Connect it to the power supply, then use the Ethernet cable to connect it to your Wi Fi router. It'll take a few minutes to boot up, but you should now be able to access the Home Assistant website from your local network. And you'll also likely want to install the Home Assistant iOS or Android app to control your house from your phone. The first time you access it, it'll take you through the onboarding process where you create a username and password. Once that's done, it will take you to the dashboard.
Then from here, you'll likely want to go to the settings tab, and then link up any smart devices you have in your home, like Casa plugs, your Nest thermostat, Zigbee switches, Roombas, dishwashers, cameras, and so on. Once you have a device connected, You can then control it manually. Some devices are simple, like a smart plug you can just turn on and off with a switch, but other devices are more complex. Like Like, my smartphone has all kinds of different sensors, and I can access them to do something in my home when something changes on my phone. Like, maybe when the battery level gets low, I trigger a shock collar to remind myself to plug it back in. Home Assistant is all about doing automations like this.
electronics
phones
telecommunications
If we go to the automations tab, the first thing you'll need to automate something is trigger. This could be a certain time on the calendar. It could be an event, like when a button is clicked somewhere. It could be a message passed from some other device using MQTT. It could be a webhook from some external service, and a variety of other patterns. From there, you can optionally add conditions to make sure the trigger is only activated if a if certain condition is met. Like, maybe you don't want to run any alarms if it's the middle of the night. And then finally, an action is the thing that should happen when the trigger occurs. Most often, this will be something on Device, like maybe you want to switch a plug on or off, or you might want to send a push notification to your phone. That's pretty cool, but sometimes you might have a lot of actions that you want triggered all at once. Like In my case, I don't want my kids getting out of bed before 7 AM, so I programmed a system that lets them know when it's time. At exactly 7 AM, their light bulbs turn green, their speaker plays Eye of the Tiger, the printer prints them a list of chores, kitchen starts making breakfast, and the Roomba follows them around to clean up any messes. And pretty soon, I'll be able to hook up a full self driving Tesla to it to automatically drive them to school. To Organize that more efficiently, I created a scene.
A scene allows you to organize the state of multiple devices in a single place. That means you can reactivate that scene from multiple triggers or do do it manually with a single click. But sometimes a scene is not enough. With scripts, you can create an entire sequence of events.
animation
Occasionally, I want my house to go into party mode, where The lights fade in and fade out and flash different colors, but to make that happen, we need to code in some delays and other patterns to synchronize all the lights.
We can Implement this logic entirely from the home assistant UI, or if you're more comfortable with code, everything can be represented in YAML. But what's really awesome about the code is that it can be shared with other people. There are all kinds of home assistant blueprints that give you preconfigured functionality so you don't have to do all this stuff manually. Like, you just import a blueprint to manage your solar panels, make some minor changes, and you're done. There's so much cool Stuff to do here, and I could go on and on. But now, I want to give up my home privacy to my AI overlords at OpenAI. If you go to the integrations tab, you'll find all kinds of different Services and APIs that you can integrate into your workflow, one of which is an open AI integration giving us access to GPT 4. It simply takes our API key and then formats a prompt with the current data or state of our smart home.
software
home improvement
software development
databases
security
From there, on the home assistant dashboard, you'll notice a chat icon that allows us to access chat gpt within the context of our own home. We can ask it questions about the current state of the home, but currently it can't take control over the home. Although, I think you can see where this is going in the near future. Dean Koontz, an author who wrote about the Wuhan 400 virus in the eighties, also wrote a book called Demon Seed in 1977 that describes a hyperintelligent smart home That locks a lady inside and has her bear its child. So you might wanna be a little extra cautious when inviting GPT 4 into your smart home. Thanks for watching, and I will see you in the next one.
Today, I'm going to build a private and secure smart home from scratch, then stupidly give up my privacy by letting GPT 4 in the front door. Here's what almost every day of my life looks like. Wake up at 5 AM. Turn on my lights. Microwave a breakfast hot pocket. Check on the baby. Turn on computer and wait 10 minutes for Windows to update. Write some code. Make a YouTube video. Microwave a lean pocket. Open the door for friendly strangers. Join a new religion. Boil wash their dishes. Turn out with lights. Premium rocket. Michael, it's a beautiful life, but highly inefficient. Every time I turn on a light, it takes 500,000 microseconds out of my day. Over the course of a year, that's like 2 weeks spent just turning on lights. Luckily, there's a free and open source tool called Home Assistant that can automate and control all of the technology in our homes. In today's video, We'll build a smart home from scratch, and look at all the crazy things people do with home automation. But most importantly, we'll keep all the data private to your home work, which means hackers and feds can't spy on you. Then we'll completely break that rule by giving our data to OpenAI to integrate it with ChatGPT, giving us a glimpse into what a next generation smart home might look like. But first, we've got a huge giveaway thanks to our awesome sponsor, Bridge. They're a startup that's building a protocol that enables IoT devices powered by at Bluetooth Low Energy to leverage the cloud. What's awesome though is that these smart devices don't need to be fitted with cellular or WiFi connectivity. Instead, they use mobile apps as an Internet gateway way to effectively bridge data between the Internet and the IoT device. And that's huge because it means you can now build IoT products without the need for cellular or Wi Fi on your where I've been playing around with it myself with an ESP 32 microcontroller, and now you can too because Bridge is shipping out 100 of these boards for free right now. Once you have one, you just install or firmware download the demo app, and then you can start securely storing interactions like inputs from a sensor on the back end ledger as part of the bridge protocol. And if you manage to build something Cool. You could even connect it to your Home Assistant, which we're going to set up right now. But first, what is Home Assistant exactly? It's a free and open source project in Python that allows you to control all the technology in your home locally, where your privacy can be protected. It runs a UI on your local network, where you can manage all these devices and automate them based on different events that happen in the world. This can all be done without writing any code, or you can write your own custom blueprints in YAML. It has a Huge community and people do all kinds of crazy stuff with it. It can do simple things like cook your hot pocket when you wake up or turn your entire house into a rave when the sun goes down. The possibilities Endless, so let's go ahead and get it set up. You'll first need a dedicated server or machine to host it. It could be an old computer you have lying around, and Home Assistant runs on Mac, Windows, and Linux, But I think the ideal option is a Raspberry Pi. I'm going to be using a Raspberry Pi 4, which are very hard to come by as of today, but it works just as well on a Pi free. In addition to the Pi itself, you'll wanna make sure you have a good power supply, an ethernet cable, and a micro SD card with at least 32 gigabytes. But the more memory you have, the better, especially if you plan on storing video data. And then finally, you'll need a way to read an SD card like a USB micro SD reader. And now Now we can move on to step 2, installing Home Assistant on the Pi. Plug your SD card into your primary computer, then download the Raspberry Pi Imager program. This is an official Raspberry Pi a tool that'll help you download the right operating system. Click on choose OS, then go to other specific purpose, then home automation, then home assistant, and then you should see the distro for the Raspberry Pi 4 or 3. Go ahead and select the one for your model, then click on choose storage and select your SD card. Now click right, and it We'll download, install, and verify that operating system on the SD card. When that's done, you can pop it out and insert it into the Pi. And now in step 3, we can take the Pi, connect Connect it to the power supply, then use the Ethernet cable to connect it to your Wi Fi router. It'll take a few minutes to boot up, but you should now be able to access the Home Assistant website from your local network. And you'll also likely want to install the Home Assistant iOS or Android app to control your house from your phone. The first time you access it, it'll take you through the onboarding process where you create a username and password. Once that's done, it will take you to the dashboard. Then from here, you'll likely want to go to the settings tab, and then link up any smart devices you have in your home, like Casa plugs, your Nest thermostat, Zigbee switches, Roombas, dishwashers, cameras, and so on. Once you have a device connected, You can then control it manually. Some devices are simple, like a smart plug you can just turn on and off with a switch, but other devices are more complex. Like Like, my smartphone has all kinds of different sensors, and I can access them to do something in my home when something changes on my phone. Like, maybe when the battery level gets low, I trigger a shock collar to remind myself to plug it back in. Home Assistant is all about doing automations like this. If we go to the automations tab, the first thing you'll need to automate something is trigger. This could be a certain time on the calendar. It could be an event, like when a button is clicked somewhere. It could be a message passed from some other device using MQTT. It could be a webhook from some external service, and a variety of other patterns. From there, you can optionally add conditions to make sure the trigger is only activated if a if certain condition is met. Like, maybe you don't want to run any alarms if it's the middle of the night. And then finally, an action is the thing that should happen when the trigger occurs. Most often, this will be something on Device, like maybe you want to switch a plug on or off, or you might want to send a push notification to your phone. That's pretty cool, but sometimes you might have a lot of actions that you want triggered all at once. Like In my case, I don't want my kids getting out of bed before 7 AM, so I programmed a system that lets them know when it's time. At exactly 7 AM, their light bulbs turn green, their speaker plays Eye of the Tiger, the printer prints them a list of chores, kitchen starts making breakfast, and the Roomba follows them around to clean up any messes. And pretty soon, I'll be able to hook up a full self driving Tesla to it to automatically drive them to school. To Organize that more efficiently, I created a scene. A scene allows you to organize the state of multiple devices in a single place. That means you can reactivate that scene from multiple triggers or do do it manually with a single click. But sometimes a scene is not enough. With scripts, you can create an entire sequence of events. Occasionally, I want my house to go into party mode, where The lights fade in and fade out and flash different colors, but to make that happen, we need to code in some delays and other patterns to synchronize all the lights. We can Implement this logic entirely from the home assistant UI, or if you're more comfortable with code, everything can be represented in YAML. But what's really awesome about the code is that it can be shared with other people. There are all kinds of home assistant blueprints that give you preconfigured functionality so you don't have to do all this stuff manually. Like, you just import a blueprint to manage your solar panels, make some minor changes, and you're done. There's so much cool Stuff to do here, and I could go on and on. But now, I want to give up my home privacy to my AI overlords at OpenAI. If you go to the integrations tab, you'll find all kinds of different Services and APIs that you can integrate into your workflow, one of which is an open AI integration giving us access to GPT 4. It simply takes our API key and then formats a prompt with the current data or state of our smart home. From there, on the home assistant dashboard, you'll notice a chat icon that allows us to access chat gpt within the context of our own home. We can ask it questions about the current state of the home, but currently it can't take control over the home. Although, I think you can see where this is going in the near future. Dean Koontz, an author who wrote about the Wuhan 400 virus in the eighties, also wrote a book called Demon Seed in 1977 that describes a hyperintelligent smart home That locks a lady inside and has her bear its child. So you might wanna be a little extra cautious when inviting GPT 4 into your smart home. Thanks for watching, and I will see you in the next one.
Today,
today
I'm
i'm
going
going
to
to
build
build
a
a
private
private
and
and
secure
secure
smart
smart
home
home
from
from
scratch,
scratch
then
then
stupidly
stupidly
give
give
up
up
my
my
privacy
privacy
by
by
letting
letting
GPT
gpt
4
4
in
in
the
the
front
front
door.
door
Here's
here's
what
what
almost
almost
every
every
day
day
of
of
my
my
life
life
looks
looks
like.
like
Wake
wake
up
up
at
at
5
5
AM.
am
Turn
turn
on
on
my
my
lights.
lights
Microwave
microwave
a
a
breakfast
breakfast
hot
hot
pocket.
pocket
Check
check
on
on
the
the
baby.
baby
Turn
turn
on
on
computer
computer
and
and
wait
wait
10
10
minutes
minutes
for
for
Windows
windows
to
to
update.
update
Write
write
some
some
code.
code
Make
make
a
a
YouTube
youtube
video.
video
Microwave
microwave
a
a
lean
lean
pocket.
pocket
Open
open
the
the
door
door
for
for
friendly
friendly
strangers.
strangers
Join
join
a
a
new
new
religion.
religion
Boil
boil
wash
wash
their
their
dishes.
dishes
Turn
turn
out
out
with
with
lights.
lights
Premium
premium
rocket.
rocket
Michael,
michael
it's
it's
a
a
beautiful
beautiful
life,
life
but
but
highly
highly
inefficient.
inefficient
Every
every
time
time
I
i
turn
turn
on
on
a
a
light,
light
it
it
takes
takes
500,000
500,000
microseconds
microseconds
out
out
of
of
my
my
day.
day
Over
over
the
the
course
course
of
of
a
a
year,
year
that's
that's
like
like
2
2
weeks
weeks
spent
spent
just
just
turning
turning
on
on
lights.
lights
Luckily,
luckily
there's
there's
a
a
free
free
and
and
open
open
source
source
tool
tool
called
called
Home
home
Assistant
assistant
that
that
can
can
automate
automate
and
and
control
control
all
all
of
of
the
the
technology
technology
in
in
our
our
homes.
homes
In
in
today's
today's
video,
video
We'll
we'll
build
build
a
a
smart
smart
home
home
from
from
scratch,
scratch
and
and
look
look
at
at
all
all
the
the
crazy
crazy
things
things
people
people
do
do
with
with
home
home
automation.
automation
But
but
most
most
importantly,
importantly
we'll
we'll
keep
keep
all
all
the
the
data
data
private
private
to
to
your
your
home
home
work,
work
which
which
means
means
hackers
hackers
and
and
feds
feds
can't
can't
spy
spy
on
on
you.
you
Then
then
we'll
we'll
completely
completely
break
break
that
that
rule
rule
by
by
giving
giving
our
our
data
data
to
to
OpenAI
openai
to
to
integrate
integrate
it
it
with
with
ChatGPT,
chatgpt
giving
giving
us
us
a
a
glimpse
glimpse
into
into
what
what
a
a
next
next
generation
generation
smart
smart
home
home
might
might
look
look
like.
like
But
but
first,
first
we've
we've
got
got
a
a
huge
huge
giveaway
giveaway
thanks
thanks
to
to
our
our
awesome
awesome
sponsor,
sponsor
Bridge.
bridge
They're
they're
a
a
startup
startup
that's
that's
building
building
a
a
protocol
protocol
that
that
enables
enables
IoT
iot
devices
devices
powered
powered
by
by
at
at
Bluetooth
bluetooth
Low
low
Energy
energy
to
to
leverage
leverage
the
the
cloud.
cloud
What's
what's
awesome
awesome
though
though
is
is
that
that
these
these
smart
smart
devices
devices
don't
don't
need
need
to
to
be
be
fitted
fitted
with
with
cellular
cellular
or
or
WiFi
wifi
connectivity.
connectivity
Instead,
instead
they
they
use
use
mobile
mobile
apps
apps
as
as
an
an
Internet
internet
gateway
gateway
way
way
to
to
effectively
effectively
bridge
bridge
data
data
between
between
the
the
Internet
internet
and
and
the
the
IoT
iot
device.
device
And
and
that's
that's
huge
huge
because
because
it
it
means
means
you
you
can
can
now
now
build
build
IoT
iot
products
products
without
without
the
the
need
need
for
for
cellular
cellular
or
or
Wi
wi
Fi
fi
on
on
your
your
where
where
I've
i've
been
been
playing
playing
around
around
with
with
it
it
myself
myself
with
with
an
an
ESP
esp
32
32
microcontroller,
microcontroller
and
and
now
now
you
you
can
can
too
too
because
because
Bridge
bridge
is
is
shipping
shipping
out
out
100
100
of
of
these
these
boards
boards
for
for
free
free
right
right
now.
now
Once
once
you
you
have
have
one,
one
you
you
just
just
install
install
or
or
firmware
firmware
download
download
the
the
demo
demo
app,
app
and
and
then
then
you
you
can
can
start
start
securely
securely
storing
storing
interactions
interactions
like
like
inputs
inputs
from
from
a
a
sensor
sensor
on
on
the
the
back
back
end
end
ledger
ledger
as
as
part
part
of
of
the
the
bridge
bridge
protocol.
protocol
And
and
if
if
you
you
manage
manage
to
to
build
build
something
something
Cool.
cool
You
you
could
could
even
even
connect
connect
it
it
to
to
your
your
Home
home
Assistant,
assistant
which
which
we're
we're
going
going
to
to
set
set
up
up
right
right
now.
now
But
but
first,
first
what
what
is
is
Home
home
Assistant
assistant
exactly?
exactly
It's
it's
a
a
free
free
and
and
open
open
source
source
project
project
in
in
Python
python
that
that
allows
allows
you
you
to
to
control
control
all
all
the
the
technology
technology
in
in
your
your
home
home
locally,
locally
where
where
your
your
privacy
privacy
can
can
be
be
protected.
protected
It
it
runs
runs
a
a
UI
ui
on
on
your
your
local
local
network,
network
where
where
you
you
can
can
manage
manage
all
all
these
these
devices
devices
and
and
automate
automate
them
them
based
based
on
on
different
different
events
events
that
that
happen
happen
in
in
the
the
world.
world
This
this
can
can
all
all
be
be
done
done
without
without
writing
writing
any
any
code,
code
or
or
you
you
can
can
write
write
your
your
own
own
custom
custom
blueprints
blueprints
in
in
YAML.
yaml
It
it
has
has
a
a
Huge
huge
community
community
and
and
people
people
do
do
all
all
kinds
kinds
of
of
crazy
crazy
stuff
stuff
with
with
it.
it
It
it
can
can
do
do
simple
simple
things
things
like
like
cook
cook
your
your
hot
hot
pocket
pocket
when
when
you
you
wake
wake
up
up
or
or
turn
turn
your
your
entire
entire
house
house
into
into
a
a
rave
rave
when
when
the
the
sun
sun
goes
goes
down.
down
The
the
possibilities
possibilities
Endless,
endless
so
so
let's
let's
go
go
ahead
ahead
and
and
get
get
it
it
set
set
up.
up
You'll
you'll
first
first
need
need
a
a
dedicated
dedicated
server
server
or
or
machine
machine
to
to
host
host
it.
it
It
it
could
could
be
be
an
an
old
old
computer
computer
you
you
have
have
lying
lying
around,
around
and
and
Home
home
Assistant
assistant
runs
runs
on
on
Mac,
mac
Windows,
windows
and
and
Linux,
linux
But
but
I
i
think
think
the
the
ideal
ideal
option
option
is
is
a
a
Raspberry
raspberry
Pi.
pi
I'm
i'm
going
going
to
to
be
be
using
using
a
a
Raspberry
raspberry
Pi
pi
4,
4
which
which
are
are
very
very
hard
hard
to
to
come
come
by
by
as
as
of
of
today,
today
but
but
it
it
works
works
just
just
as
as
well
well
on
on
a
a
Pi
pi
free.
free
In
in
addition
addition
to
to
the
the
Pi
pi
itself,
itself
you'll
you'll
wanna
wanna
make
make
sure
sure
you
you
have
have
a
a
good
good
power
power
supply,
supply
an
an
ethernet
ethernet
cable,
cable
and
and
a
a
micro
micro
SD
sd
card
card
with
with
at
at
least
least
32
32
gigabytes.
gigabytes
But
but
the
the
more
more
memory
memory
you
you
have,
have
the
the
better,
better
especially
especially
if
if
you
you
plan
plan
on
on
storing
storing
video
video
data.
data
And
and
then
then
finally,
finally
you'll
you'll
need
need
a
a
way
way
to
to
read
read
an
an
SD
sd
card
card
like
like
a
a
USB
usb
micro
micro
SD
sd
reader.
reader
And
and
now
now
Now
now
we
we
can
can
move
move
on
on
to
to
step
step
2,
2
installing
installing
Home
home
Assistant
assistant
on
on
the
the
Pi.
pi
Plug
plug
your
your
SD
sd
card
card
into
into
your
your
primary
primary
computer,
computer
then
then
download
download
the
the
Raspberry
raspberry
Pi
pi
Imager
imager
program.
program
This
this
is
is
an
an
official
official
Raspberry
raspberry
Pi
pi
a
a
tool
tool
that'll
that'll
help
help
you
you
download
download
the
the
right
right
operating
operating
system.
system
Click
click
on
on
choose
choose
OS,
os
then
then
go
go
to
to
other
other
specific
specific
purpose,
purpose
then
then
home
home
automation,
automation
then
then
home
home
assistant,
assistant
and
and
then
then
you
you
should
should
see
see
the
the
distro
distro
for
for
the
the
Raspberry
raspberry
Pi
pi
4
4
or
or
3.
3
Go
go
ahead
ahead
and
and
select
select
the
the
one
one
for
for
your
your
model,
model
then
then
click
click
on
on
choose
choose
storage
storage
and
and
select
select
your
your
SD
sd
card.
card
Now
now
click
click
right,
right
and
and
it
it
We'll
we'll
download,
download
install,
install
and
and
verify
verify
that
that
operating
operating
system
system
on
on
the
the
SD
sd
card.
card
When
when
that's
that's
done,
done
you
you
can
can
pop
pop
it
it
out
out
and
and
insert
insert
it
it
into
into
the
the
Pi.
pi
And
and
now
now
in
in
step
step
3,
3
we
we
can
can
take
take
the
the
Pi,
pi
connect
connect
Connect
connect
it
it
to
to
the
the
power
power
supply,
supply
then
then
use
use
the
the
Ethernet
ethernet
cable
cable
to
to
connect
connect
it
it
to
to
your
your
Wi
wi
Fi
fi
router.
router
It'll
it'll
take
take
a
a
few
few
minutes
minutes
to
to
boot
boot
up,
up
but
but
you
you
should
should
now
now
be
be
able
able
to
to
access
access
the
the
Home
home
Assistant
assistant
website
website
from
from
your
your
local
local
network.
network
And
and
you'll
you'll
also
also
likely
likely
want
want
to
to
install
install
the
the
Home
home
Assistant
assistant
iOS
ios
or
or
Android
android
app
app
to
to
control
control
your
your
house
house
from
from
your
your
phone.
phone
The
the
first
first
time
time
you
you
access
access
it,
it
it'll
it'll
take
take
you
you
through
through
the
the
onboarding
onboarding
process
process
where
where
you
you
create
create
a
a
username
username
and
and
password.
password
Once
once
that's
that's
done,
done
it
it
will
will
take
take
you
you
to
to
the
the
dashboard.
dashboard
Then
then
from
from
here,
here
you'll
you'll
likely
likely
want
want
to
to
go
go
to
to
the
the
settings
settings
tab,
tab
and
and
then
then
link
link
up
up
any
any
smart
smart
devices
devices
you
you
have
have
in
in
your
your
home,
home
like
like
Casa
casa
plugs,
plugs
your
your
Nest
nest
thermostat,
thermostat
Zigbee
zigbee
switches,
switches
Roombas,
roombas
dishwashers,
dishwashers
cameras,
cameras
and
and
so
so
on.
on
Once
once
you
you
have
have
a
a
device
device
connected,
connected
You
you
can
can
then
then
control
control
it
it
manually.
manually
Some
some
devices
devices
are
are
simple,
simple
like
like
a
a
smart
smart
plug
plug
you
you
can
can
just
just
turn
turn
on
on
and
and
off
off
with
with
a
a
switch,
switch
but
but
other
other
devices
devices
are
are
more
more
complex.
complex
Like
like
Like,
like
my
my
smartphone
smartphone
has
has
all
all
kinds
kinds
of
of
different
different
sensors,
sensors
and
and
I
i
can
can
access
access
them
them
to
to
do
do
something
something
in
in
my
my
home
home
when
when
something
something
changes
changes
on
on
my
my
phone.
phone
Like,
like
maybe
maybe
when
when
the
the
battery
battery
level
level
gets
gets
low,
low
I
i
trigger
trigger
a
a
shock
shock
collar
collar
to
to
remind
remind
myself
myself
to
to
plug
plug
it
it
back
back
in.
in
Home
home
Assistant
assistant
is
is
all
all
about
about
doing
doing
automations
automations
like
like
this.
this
If
if
we
we
go
go
to
to
the
the
automations
automations
tab,
tab
the
the
first
first
thing
thing
you'll
you'll
need
need
to
to
automate
automate
something
something
is
is
trigger.
trigger
This
this
could
could
be
be
a
a
certain
certain
time
time
on
on
the
the
calendar.
calendar
It
it
could
could
be
be
an
an
event,
event
like
like
when
when
a
a
button
button
is
is
clicked
clicked
somewhere.
somewhere
It
it
could
could
be
be
a
a
message
message
passed
passed
from
from
some
some
other
other
device
device
using
using
MQTT.
mqtt
It
it
could
could
be
be
a
a
webhook
webhook
from
from
some
some
external
external
service,
service
and
and
a
a
variety
variety
of
of
other
other
patterns.
patterns
From
from
there,
there
you
you
can
can
optionally
optionally
add
add
conditions
conditions
to
to
make
make
sure
sure
the
the
trigger
trigger
is
is
only
only
activated
activated
if
if
a
a
if
if
certain
certain
condition
condition
is
is
met.
met
Like,
like
maybe
maybe
you
you
don't
don't
want
want
to
to
run
run
any
any
alarms
alarms
if
if
it's
it's
the
the
middle
middle
of
of
the
the
night.
night
And
and
then
then
finally,
finally
an
an
action
action
is
is
the
the
thing
thing
that
that
should
should
happen
happen
when
when
the
the
trigger
trigger
occurs.
occurs
Most
most
often,
often
this
this
will
will
be
be
something
something
on
on
Device,
device
like
like
maybe
maybe
you
you
want
want
to
to
switch
switch
a
a
plug
plug
on
on
or
or
off,
off
or
or
you
you
might
might
want
want
to
to
send
send
a
a
push
push
notification
notification
to
to
your
your
phone.
phone
That's
that's
pretty
pretty
cool,
cool
but
but
sometimes
sometimes
you
you
might
might
have
have
a
a
lot
lot
of
of
actions
actions
that
that
you
you
want
want
triggered
triggered
all
all
at
at
once.
once
Like
like
In
in
my
my
case,
case
I
i
don't
don't
want
want
my
my
kids
kids
getting
getting
out
out
of
of
bed
bed
before
before
7
7
AM,
am
so
so
I
i
programmed
programmed
a
a
system
system
that
that
lets
lets
them
them
know
know
when
when
it's
it's
time.
time
At
at
exactly
exactly
7
7
AM,
am
their
their
light
light
bulbs
bulbs
turn
turn
green,
green
their
their
speaker
speaker
plays
plays
Eye
eye
of
of
the
the
Tiger,
tiger
the
the
printer
printer
prints
prints
them
them
a
a
list
list
of
of
chores,
chores
kitchen
kitchen
starts
starts
making
making
breakfast,
breakfast
and
and
the
the
Roomba
roomba
follows
follows
them
them
around
around
to
to
clean
clean
up
up
any
any
messes.
messes
And
and
pretty
pretty
soon,
soon
I'll
i'll
be
be
able
able
to
to
hook
hook
up
up
a
a
full
full
self
self
driving
driving
Tesla
tesla
to
to
it
it
to
to
automatically
automatically
drive
drive
them
them
to
to
school.
school
To
to
Organize
organize
that
that
more
more
efficiently,
efficiently
I
i
created
created
a
a
scene.
scene
A
a
scene
scene
allows
allows
you
you
to
to
organize
organize
the
the
state
state
of
of
multiple
multiple
devices
devices
in
in
a
a
single
single
place.
place
That
that
means
means
you
you
can
can
reactivate
reactivate
that
that
scene
scene
from
from
multiple
multiple
triggers
triggers
or
or
do
do
do
do
it
it
manually
manually
with
with
a
a
single
single
click.
click
But
but
sometimes
sometimes
a
a
scene
scene
is
is
not
not
enough.
enough
With
with
scripts,
scripts
you
you
can
can
create
create
an
an
entire
entire
sequence
sequence
of
of
events.
events
Occasionally,
occasionally
I
i
want
want
my
my
house
house
to
to
go
go
into
into
party
party
mode,
mode
where
where
The
the
lights
lights
fade
fade
in
in
and
and
fade
fade
out
out
and
and
flash
flash
different
different
colors,
colors
but
but
to
to
make
make
that
that
happen,
happen
we
we
need
need
to
to
code
code
in
in
some
some
delays
delays
and
and
other
other
patterns
patterns
to
to
synchronize
synchronize
all
all
the
the
lights.
lights
We
we
can
can
Implement
implement
this
this
logic
logic
entirely
entirely
from
from
the
the
home
home
assistant
assistant
UI,
ui
or
or
if
if
you're
you're
more
more
comfortable
comfortable
with
with
code,
code
everything
everything
can
can
be
be
represented
represented
in
in
YAML.
yaml
But
but
what's
what's
really
really
awesome
awesome
about
about
the
the
code
code
is
is
that
that
it
it
can
can
be
be
shared
shared
with
with
other
other
people.
people
There
there
are
are
all
all
kinds
kinds
of
of
home
home
assistant
assistant
blueprints
blueprints
that
that
give
give
you
you
preconfigured
preconfigured
functionality
functionality
so
so
you
you
don't
don't
have
have
to
to
do
do
all
all
this
this
stuff
stuff
manually.
manually
Like,
like
you
you
just
just
import
import
a
a
blueprint
blueprint
to
to
manage
manage
your
your
solar
solar
panels,
panels
make
make
some
some
minor
minor
changes,
changes
and
and
you're
you're
done.
done
There's
there's
so
so
much
much
cool
cool
Stuff
stuff
to
to
do
do
here,
here
and
and
I
i
could
could
go
go
on
on
and
and
on.
on
But
but
now,
now
I
i
want
want
to
to
give
give
up
up
my
my
home
home
privacy
privacy
to
to
my
my
AI
ai
overlords
overlords
at
at
OpenAI.
openai
If
if
you
you
go
go
to
to
the
the
integrations
integrations
tab,
tab
you'll
you'll
find
find
all
all
kinds
kinds
of
of
different
different
Services
services
and
and
APIs
apis
that
that
you
you
can
can
integrate
integrate
into
into
your
your
workflow,
workflow
one
one
of
of
which
which
is
is
an
an
open
open
AI
ai
integration
integration
giving
giving
us
us
access
access
to
to
GPT
gpt
4.
4
It
it
simply
simply
takes
takes
our
our
API
api
key
key
and
and
then
then
formats
formats
a
a
prompt
prompt
with
with
the
the
current
current
data
data
or
or
state
state
of
of
our
our
smart
smart
home.
home
From
from
there,
there
on
on
the
the
home
home
assistant
assistant
dashboard,
dashboard
you'll
you'll
notice
notice
a
a
chat
chat
icon
icon
that
that
allows
allows
us
us
to
to
access
access
chat
chat
gpt
gpt
within
within
the
the
context
context
of
of
our
our
own
own
home.
home
We
we
can
can
ask
ask
it
it
questions
questions
about
about
the
the
current
current
state
state
of
of
the
the
home,
home
but
but
currently
currently
it
it
can't
can't
take
take
control
control
over
over
the
the
home.
home
Although,
although
I
i
think
think
you
you
can
can
see
see
where
where
this
this
is
is
going
going
in
in
the
the
near
near
future.
future
Dean
dean
Koontz,
koontz
an
an
author
author
who
who
wrote
wrote
about
about
the
the
Wuhan
wuhan
400
400
virus
virus
in
in
the
the
eighties,
eighties
also
also
wrote
wrote
a
a
book
book
called
called
Demon
demon
Seed
seed
in
in
1977
1977
that
that
describes
describes
a
a
hyperintelligent
hyperintelligent
smart
smart
home
home
That
that
locks
locks
a
a
lady
lady
inside
inside
and
and
has
has
her
her
bear
bear
its
its
child.
child
So
so
you
you
might
might
wanna
wanna
be
be
a
a
little
little
extra
extra
cautious
cautious
when
when
inviting
inviting
GPT
gpt
4
4
into
into
your
your
smart
smart
home.
home
Thanks
thanks
for
for
watching,
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
The speakers discuss a new private and secure smart home program using mobile apps and a free and open source tool called Home Assistant. They recommend using a Pi and recommend using a Raspberry Pi 4 or 3 as it is easier to use. The process of installing Home Assistant on a Pi involves a dedicated server, a programmable computer, and a backup network, and includes setting up the Home Assistant app and automating devices. The speakers also explain how to use the Home Assistant app on a phone, including setting up devices and automations, and provide information on managing smart homes through home assistant blueprints and Google Maps. Viewers are encouraged to be cautious with inviting GPT 4 into the smart home.
I built a smarter smart home
Today, I'm going to build a private and secure smart home from scratch, then stupidly give up my privacy by letting GPT 4 in the front door. Here's what almost every day of my life looks like. Wake up at 5 AM. Turn on my lights. Microwave a breakfast hot pocket. Check on the baby. Turn on computer and wait 10 minutes for Windows to update. Write some code. Make a YouTube video. Microwave a lean pocket. Open the door for friendly strangers. Join a new religion. Boil wash their dishes. Turn out with lights. Premium rocket. Michael, it's a beautiful life, but highly inefficient. Every time I turn on a light, it takes 500,000 microseconds out of my day. Over the course of a year, that's like 2 weeks spent just turning on lights. Luckily, there's a free and open source tool called Home Assistant that can automate and control all of the technology in our homes. In today's video, We'll build a smart home from scratch, and look at all the crazy things people do with home automation. But most importantly, we'll keep all the data private to your home work, which means hackers and feds can't spy on you. Then we'll completely break that rule by giving our data to OpenAI to integrate it with ChatGPT, giving us a glimpse into what a next generation smart home might look like. But first, we've got a huge giveaway thanks to our awesome sponsor, Bridge. They're a startup that's building a protocol that enables IoT devices powered by at Bluetooth Low Energy to leverage the cloud. What's awesome though is that these smart devices don't need to be fitted with cellular or WiFi connectivity. Instead, they use mobile apps as an Internet gateway way to effectively bridge data between the Internet and the IoT device. And that's huge because it means you can now build IoT products without the need for cellular or Wi Fi on your where I've been playing around with it myself with an ESP 32 microcontroller, and now you can too because Bridge is shipping out 100 of these boards for free right now. Once you have one, you just install or firmware download the demo app, and then you can start securely storing interactions like inputs from a sensor on the back end ledger as part of the bridge protocol. And if you manage to build something Cool. You could even connect it to your Home Assistant, which we're going to set up right now. But first, what is Home Assistant exactly? It's a free and open source project in Python that allows you to control all the technology in your home locally, where your privacy can be protected. It runs a UI on your local network, where you can manage all these devices and automate them based on different events that happen in the world. This can all be done without writing any code, or you can write your own custom blueprints in YAML. It has a Huge community and people do all kinds of crazy stuff with it. It can do simple things like cook your hot pocket when you wake up or turn your entire house into a rave when the sun goes down. The possibilities Endless, so let's go ahead and get it set up. You'll first need a dedicated server or machine to host it. It could be an old computer you have lying around, and Home Assistant runs on Mac, Windows, and Linux, But I think the ideal option is a Raspberry Pi. I'm going to be using a Raspberry Pi 4, which are very hard to come by as of today, but it works just as well on a Pi free. In addition to the Pi itself, you'll wanna make sure you have a good power supply, an ethernet cable, and a micro SD card with at least 32 gigabytes. But the more memory you have, the better, especially if you plan on storing video data. And then finally, you'll need a way to read an SD card like a USB micro SD reader. And now Now we can move on to step 2, installing Home Assistant on the Pi. Plug your SD card into your primary computer, then download the Raspberry Pi Imager program. This is an official Raspberry Pi a tool that'll help you download the right operating system. Click on choose OS, then go to other specific purpose, then home automation, then home assistant, and then you should see the distro for the Raspberry Pi 4 or 3. Go ahead and select the one for your model, then click on choose storage and select your SD card. Now click right, and it We'll download, install, and verify that operating system on the SD card. When that's done, you can pop it out and insert it into the Pi. And now in step 3, we can take the Pi, connect Connect it to the power supply, then use the Ethernet cable to connect it to your Wi Fi router. It'll take a few minutes to boot up, but you should now be able to access the Home Assistant website from your local network. And you'll also likely want to install the Home Assistant iOS or Android app to control your house from your phone. The first time you access it, it'll take you through the onboarding process where you create a username and password. Once that's done, it will take you to the dashboard. Then from here, you'll likely want to go to the settings tab, and then link up any smart devices you have in your home, like Casa plugs, your Nest thermostat, Zigbee switches, Roombas, dishwashers, cameras, and so on. Once you have a device connected, You can then control it manually. Some devices are simple, like a smart plug you can just turn on and off with a switch, but other devices are more complex. Like Like, my smartphone has all kinds of different sensors, and I can access them to do something in my home when something changes on my phone. Like, maybe when the battery level gets low, I trigger a shock collar to remind myself to plug it back in. Home Assistant is all about doing automations like this. If we go to the automations tab, the first thing you'll need to automate something is trigger. This could be a certain time on the calendar. It could be an event, like when a button is clicked somewhere. It could be a message passed from some other device using MQTT. It could be a webhook from some external service, and a variety of other patterns. From there, you can optionally add conditions to make sure the trigger is only activated if a if certain condition is met. Like, maybe you don't want to run any alarms if it's the middle of the night. And then finally, an action is the thing that should happen when the trigger occurs. Most often, this will be something on Device, like maybe you want to switch a plug on or off, or you might want to send a push notification to your phone. That's pretty cool, but sometimes you might have a lot of actions that you want triggered all at once. Like In my case, I don't want my kids getting out of bed before 7 AM, so I programmed a system that lets them know when it's time. At exactly 7 AM, their light bulbs turn green, their speaker plays Eye of the Tiger, the printer prints them a list of chores, kitchen starts making breakfast, and the Roomba follows them around to clean up any messes. And pretty soon, I'll be able to hook up a full self driving Tesla to it to automatically drive them to school. To Organize that more efficiently, I created a scene. A scene allows you to organize the state of multiple devices in a single place. That means you can reactivate that scene from multiple triggers or do do it manually with a single click. But sometimes a scene is not enough. With scripts, you can create an entire sequence of events. Occasionally, I want my house to go into party mode, where The lights fade in and fade out and flash different colors, but to make that happen, we need to code in some delays and other patterns to synchronize all the lights. We can Implement this logic entirely from the home assistant UI, or if you're more comfortable with code, everything can be represented in YAML. But what's really awesome about the code is that it can be shared with other people. There are all kinds of home assistant blueprints that give you preconfigured functionality so you don't have to do all this stuff manually. Like, you just import a blueprint to manage your solar panels, make some minor changes, and you're done. There's so much cool Stuff to do here, and I could go on and on. But now, I want to give up my home privacy to my AI overlords at OpenAI. If you go to the integrations tab, you'll find all kinds of different Services and APIs that you can integrate into your workflow, one of which is an open AI integration giving us access to GPT 4. It simply takes our API key and then formats a prompt with the current data or state of our smart home. From there, on the home assistant dashboard, you'll notice a chat icon that allows us to access chat gpt within the context of our own home. We can ask it questions about the current state of the home, but currently it can't take control over the home. Although, I think you can see where this is going in the near future. Dean Koontz, an author who wrote about the Wuhan 400 virus in the eighties, also wrote a book called Demon Seed in 1977 that describes a hyperintelligent smart home That locks a lady inside and has her bear its child. So you might wanna be a little extra cautious when inviting GPT 4 into your smart home. Thanks for watching, and I will see you in the next one.
The speakers discuss a new private and secure smart home program using mobile apps and a free and open source tool called Home Assistant. They recommend using a Pi and recommend using a Raspberry Pi 4 or 3 as it is easier to use. The process of installing Home Assistant on a Pi involves a dedicated server, a programmable computer, and a backup network, and includes setting up the Home Assistant app and automating devices. The speakers also explain how to use the Home Assistant app on a phone, including setting up devices and automations, and provide information on managing smart homes through home assistant blueprints and Google Maps. Viewers are encouraged to be cautious with inviting GPT 4 into the smart home.