![]() The first one is for my WIFI and MQTT credentials (this is private and local, it is not pushed to GitHub), which are stored as variables in a file called secrets.yaml (store them in an Ansible vault, if you like). I have two Git repositories to manage my ESPHome devices. (If you want to give it a try, you can run the command esphome example.yaml wizard which will create an example.yaml file.) So, I think ultimately it’s easier to just create and manage your own files, which we’ll do below. It’s a good way to get started, however it only creates a skeleton file and you have to continue configuring the device manually to actually do anything anyway. MH-ET Live ESP32Minikit Managing configs with GitĮverything with your device revolves around your device’s YAML config file, including configuration, flashing, accessing logs, clearing out MQTT messages and more.ĮSPHome has a wizard which will prompt you to enter your device details and WiFi credentials. These days a number of commercial products are been built using ESP8266 chips which we can flash, like Sonoff power modules, Xiaomi temperature sensors, Brilliant Smart power outlets and Mirabella Genio light bulbs (I use one of these under my stairs).įor this post though, I will use one of my MH-ET Live ESP32Minikit devices as an example, which has the device name of mhetesp32minikit. It’s not just ESP modules that are supported. Therefore, specifying the exact device is good and can be helpful, but it’s not strictly necessary. Although built on similar SOC, different devices break out different pins and can have different flashing requirements. Thanks to PlatformIO, lots of ESP8266 and ESP32 devices are supported. ![]() Of course, you will need a real physical ESP device of some description. Getting started is pretty easy, just install esphome using pip. That’s a lot of things you get for just a little bit of YAML! Getting started When using MQTT, the channels are set with retain flag, so that the devices themselves and their last known states are not lost on reboots (you can disable this for testing). When combined with Home Assistant, new devices are automatically discovered and appear in the web interface. There is even an addon for Home Assistant if you prefer using a graphical interface, but I like to do things on the command line. It supports both Home Assistant API and MQTT (over TLS for ESP8266) as well as lots of common components. Once up, the devices support mDNS and unencrypted over the air updates (which is fine for my local network). Loops, initialising and managing multiple inputs and outputs, reading and writing to I/O, PWM, functions and callbacks, connecting to WiFi and MQTT, hosting an AP, logging and more is taken care of for you. In fact, no programming is necessary! You simply have to define your devices in YAML and run a single command to compile the firmware blob and flash a device. ESPHome provides simple management of ESP devicesĮSPHome is smart in making use of PlatformIO underneath, but its beauty lies in the way it abstracts away the complexities of programming for embedded devices. I have since migrated most of my devices to ESPHome. I then had a play with Micropython and really enjoyed it, but then I came across ESPHome and it blew me away. I already had experience with Arduino, so I started experimenting with this and it worked quite well. I’ve built a number of sensors and lights and been working on making my light switches smart (more on that in a later blog post). ![]() ![]() However, the vast majority of my home automation devices are ESP modules running open source firmware which connect to MQTT as the central protocol. I do have a couple of proprietary home automation products, including LIFX globes and Google Home. Home Assistant, the privacy focused, open source home automation platform I’ve previously posted about running Home Assistant in Docker and in Podman. As I’ve written about previously, the smart side of my home automation is managed by Home Assistant, which is an amazing, privacy focused open source platform. Having built the core of my own “dumb” smart home system, I have been working on making it smart these past few years.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |