Home Assistant does great at tying all kinds of things together.
People had a habit of leaving the basement lights on here. Now they turn themselves off after a timer expires, and also whenever nobody's home. Using HA and a cheap Shelly relay (chosen for form factor), I was able to do this while retaining the existing lighting circuits, light switch, and the lights themselves.
It works perfectly, is completely local, and the end-user UI is completely natural. Toggle the same plain-Jane light switch that has always been there at the top of the basement stairs and the lights change state. (UI doesn't get more intuitive than that.)
Or: Fans. This house has a good furnace and central aircon, but the ductwork doesn't really extend upstairs. By default, this makes the upstairs-parts very hot in the summer and cooler than I'd like in the winter -- even though it's nice downstairs during all seasons.
I fixed that to my satisfaction by putting a fan on the landing that is controlled by an inexpensive smart switch, just to improve circulation. HA runs this show; the fan runs when the HVAC is doing something, and whenever people are home and it is either too hot or too cold upstairs (based on a temperature sensor). It's not a perfect solution, but it's kept the temperatures sane (and provided logging to prove it), it was cheap to implement, and it is cheap to run.
I already had the parts kicking around; it just took software and time.
(The best option for efficiency and comfort is probably installing mini-splits up there, but... sheesh, that's into the realm of orders-of-magnitude more expensive. Maybe some day.)
It just makes stuff so easy - I’ve been on an absolute spree lately, and have built out:
Ultrasonic tank & river level monitors, with temperature compensation and a battery fuel gauge - managing to make a 3000mAh battery stretch almost a year. Some of the river monitors use LoRa.
Remote control to stop/start the previously pull-start generator
Gas bottle level monitors
Made the coffee machine dangerous
And my current project is seeing if I can make solar/battery powered LED bulbs that I can hang on trees and use BLE to make them automatically turn on some distance ahead of you as you walk down the long path through the forest, and turn off once you’ve passed.
I only really got started a few months ago, and my approach is far more breadboards, DuPont cables and superglue, because I know damned well that the moment I go “ok I’m done let’s get a PCB” I’ll decide on a modification.
Anyway. I don’t have enough good things to say about ESPHome. I get to save thousands of euros, and have fun at the same time. What’s not to like.
Same, it's so nice to throw together a yaml that pretty much does exactly what you want, with the only ambiguity being knowing the ins/outs of the pins.
Just wait until Espressif gets some greedy shareholders/or some manager that needs a raise and then suddenly you're paying 30% to get your app into the ESP Store.
ESPHome is owned by the same group as Home Assistant, not Espressif. So Espressif getting greedy would just mean higher prices for their chips (or they could lock down development on their chips, but that seems very unlikely).
ESPHome isn't really Espressif exclusive, there's Beken support already, which most cheap Chinese IoT gadgets use nowadays. And there are 'made for esphome' products which is a safer bet than buying Sonoff and praying the ESP32 inside doesn't have its secure boot bits fused.
I purchased a Phillips fan in a shopping spree. It was hot outside, needed something, did not pay much attention beyond that it worked and was not noisy.
At home my eyebrows went halfway on my forehead seeing that there is a remote and the remote is supposed to be my mobile! Need to download the app for it, connect the fan to the Wifi, but it also had bluetooth for some reason. No way Jose!
Yet, it was so incredibly stupid like 4K zoom camera in a hammer that I had to try. Carefully. Data collection notice in the app shop is not promising, not at all. Location data, ID, I do not remember in full but perhaps contacts too? Unsure, but a lot. Anyway, will not enable access to most, airplane mode on, no bluetooth device in sight, so went ahead and installed the app, router disconnected from the internet, then run it.
First thing: refusing access to location. App: sorry, you cannot use me if I cannot access your location, network, and my mothership. And it stops. Big laugh, delete the whole thing. Leaving feedback for other customers about this incredibly stupid intrusion.
Then I got answer from Phillips! Something along the line: "This is for the best interest of our customers, we need your precise location so we can share personalized pollen and climate data and whatnot, we absolutely must insist this!"
For a fan!
Meanwhile the fan has physical buttons on it, can adjust speed, timer, and the cycle. Not completely useless. However some buttons need two press to register the action once. Beeps twice, does thing once. Likely some interference with The App, need to make sure that I am in the same room with the fan with a warning press and then the real press, or whothef knows what was in the head of these guys when they put this piece of thing together!? But really, are they nuts? Ruining use along pollen data?!
Are we already living the movie Idiocracy when it is about the Phillips product design department?! Did they loose all sense with reality? I am sure they already pushing through some new AI function for this very fan and are sad that mine cannot connect to the mother ship through satellite or something just so the update can be pushed to it learning my breath patterns for optimal fan speed. They are nuts! They are nuts!
> Need to download the app for it, connect the fan to the Wifi, but it also had bluetooth for some reason.
Bluetooth could be there for initial setup.
To connect the fan to WiFi you have to somehow get the WiFi credentials to the fan. There are a few ways to do that.
One of the most common is for the device when it has not yet been set up to make itself available over Bluetooth. The app can then connect to it and give it the WiFi credentials.
Another common way is for the device to create its own WiFi network with a name that the app can somehow recognize. The app can then find that network, connect to it, and use it to talk to the device.
I don't think this is as popular as the Bluetooth method, probably because it used to require that the user go to their network settings and connect to the device's WiFi network. Plus, when they are connected to the device they are not connected to their "real" WiFi which could disrupt other apps.
However, newer Apple and Android mobile operating systems provide ways for applications to change the network connection in the background or with minimal interaction, which makes this method more friendly so maybe it will become more popular.
There also are supposedly some IoT devices that use WPS (WiFi Protected Setup), where you bring the device near your router, press the WPS button on the router, then press the WPS button on the device, and magic happens to add the devide to your network. I've never actually had any device I've bought support this so it is either uncommon or I've just been unlucky.
Anyway, from what I've read Philips has used both the bluetooth method and the access point method on their WiFi products.
The location access is often needed for the app to be able to find the WiFi networks in the neighborhood. This is because that can be used to triangulate your location, so they bundle it in with the same permission (unfortunately, there isn't a very good way to separate this, since it theoretically can be used to locate you and therefore you should let the user know that).
Why does a fan app need to find the WiFi networks? The OS does this, and then serves an internet connection to the app. It doesn't need to know what the available networks are.
I don't like the notion of doing speed control by putting a digipot in series with a motor. It worked because the fan happened to be low enough power but it doesn't seem like the author gave thought to the power handling capability of the digipot. If the fan happened to be beefier he's letting the smoke out with this design.
Plus, this is more complicated than just doing PWM.
Based on the description of the wiring to the motor (24V, GND, POT1, POT2, NC), it doesn't sound like the original setup would have been drawing much power through the pot either -- there's probably something else on the other end of that wire that is doing modulation based on the sense resistance, and the motor is itself drawing power from the 24V line. So while it's true that there should be a check for the allowable limits on the digipot, I don't think it's actually being used to sink much power.
Hey, author here. That's correct. The potentiometer has 5V going through it, with a current range of 30-164μA, which fell within limits of the digipot. I opted to use the digipot instead of my own PWM because something else must be doing PWM closer to the motor, where I didn't want to go modifying.
>Everything joined up via a 2-pin and 5-pin connector on the PCB. From there, it was a straightforward matter of measuring voltages and continuity to work out what connected to what: the 2-pin connector was offering 24V DC. The 5-pin connector was what went off to the motor itself. Two of its pins were passing through the 24V DC and ground directly. Two more pins were connected to the potentiometer. The fifth pin was not connected.
> there's probably something else on the other end of that wire that is doing modulation based on the sense resistance
And it would have been great if that arbitrary assumption had been tested by the OP and the results were documented in the article so that they wouldn't come off as somewhat clueless as to the limitations of their design.. oh well.
I've been toying with a variant of this project for my Honeywell home air filters. I have one in all my "big" rooms, and I like to keep them running at a low speed most of the day.
But I also have time-of-day energy pricing, and it would be nice to automatically turn off (or at least slow) my air filters during the 5pm-8pm window. This project inspires me to at least look into the feasibility of adding that functionality myself.
Depending on your air filter you might be able to just use a smart plug, I went down a similar route this summer before realizing that mine would remember their power state and settings when powered off.
So now I just have them plugged into a few smart plugs with automations in homeassistant
I would need a device with a physical switch rather than a touch control. Sadly many devices, mine included, have "power was cycled = device is off" logic.
It's been working so well I was actually surprised one night when the dehumidifier in the bedroom turned itself on from the automation (which I have set to do after dark if humidity is higher then 70%).
It had been within tolerance for ages and I just hadn't had to even think about it.
You should, it is very DIYable! I did it and reverse engineered it myself a while back. You dont need to make a custom circuit board if you are fine with losing the touch controls
The digipot is vaguely similar to how a R2R ladder DAC works. There are two resistor values used: R and 2R. The "interesting part" of the circuit has bits x 2R resistors in parallel. One end of each resistor (let's call it input) is connected directly to the digital bit from the PWM sample.
Then there is the series bits x R resistors. The output of each 2R resistor is connected in-between the two resistors that straddle its bit position. So:
Out
|
R
+-2R-bit0
R
+-2R-bit1
...
R
+-2R-bitN
And that's it (apart from pull-up/down resistors)! Due to the way that resistors in series and parallel work, each input step in the ladder provides twice the voltage of the previous if powered: it's base 2 enshrined in a physical object.
These are relatively uncommon because they are highly sensitive to the resistor (and trace) tolerance, but this circuit is my Euler's identity of electronics: it very literally bridges the digital and analog worlds.
I saw the diagram in the original blogpost, laughed, but after a bit of sketching it out I think we're both wrong. R/2R ladders are useful in DACs (and are really cool there) but don't look like they're used in digipot applications.
It seems like actual digipot ICs use the "2^n discrete resistors" approach. The IC used in this project is a MCP4141 which explicitly states in section 5.1 of its datasheet that for 7-bit (8-bit) devices there are 128 (256) resistors in a string between the terminals.
I'm a bit surprised this seems to be the best approach, but with IC manufacturing the joint problems of "a bunch of identical components" and "wiring it all up" are much less of a problem than if you were to wire this up by hand.
My current record is $19 (including shipping!) for two assembled boards of https://github.com/xobs/soundoff which is a little device that shuts off 5V power to a USB-A port when it detects the PC it's connected to goes to sleep.
I love upgrading simple home appliances with homebrew smarts using ESPHome so that they retain their original interface. I've mostly done lights that are still correctly switched at the original wall switches but up next is my fan and toaster oven! Then to tackle the thermostats.
People had a habit of leaving the basement lights on here. Now they turn themselves off after a timer expires, and also whenever nobody's home. Using HA and a cheap Shelly relay (chosen for form factor), I was able to do this while retaining the existing lighting circuits, light switch, and the lights themselves.
It works perfectly, is completely local, and the end-user UI is completely natural. Toggle the same plain-Jane light switch that has always been there at the top of the basement stairs and the lights change state. (UI doesn't get more intuitive than that.)
Or: Fans. This house has a good furnace and central aircon, but the ductwork doesn't really extend upstairs. By default, this makes the upstairs-parts very hot in the summer and cooler than I'd like in the winter -- even though it's nice downstairs during all seasons.
I fixed that to my satisfaction by putting a fan on the landing that is controlled by an inexpensive smart switch, just to improve circulation. HA runs this show; the fan runs when the HVAC is doing something, and whenever people are home and it is either too hot or too cold upstairs (based on a temperature sensor). It's not a perfect solution, but it's kept the temperatures sane (and provided logging to prove it), it was cheap to implement, and it is cheap to run.
I already had the parts kicking around; it just took software and time.
(The best option for efficiency and comfort is probably installing mini-splits up there, but... sheesh, that's into the realm of orders-of-magnitude more expensive. Maybe some day.)
Ultrasonic tank & river level monitors, with temperature compensation and a battery fuel gauge - managing to make a 3000mAh battery stretch almost a year. Some of the river monitors use LoRa.
Remote control to stop/start the previously pull-start generator
Gas bottle level monitors
Made the coffee machine dangerous
And my current project is seeing if I can make solar/battery powered LED bulbs that I can hang on trees and use BLE to make them automatically turn on some distance ahead of you as you walk down the long path through the forest, and turn off once you’ve passed.
I only really got started a few months ago, and my approach is far more breadboards, DuPont cables and superglue, because I know damned well that the moment I go “ok I’m done let’s get a PCB” I’ll decide on a modification.
Anyway. I don’t have enough good things to say about ESPHome. I get to save thousands of euros, and have fun at the same time. What’s not to like.
I'm just hoping it stays cheap as a hobby
At home my eyebrows went halfway on my forehead seeing that there is a remote and the remote is supposed to be my mobile! Need to download the app for it, connect the fan to the Wifi, but it also had bluetooth for some reason. No way Jose!
Yet, it was so incredibly stupid like 4K zoom camera in a hammer that I had to try. Carefully. Data collection notice in the app shop is not promising, not at all. Location data, ID, I do not remember in full but perhaps contacts too? Unsure, but a lot. Anyway, will not enable access to most, airplane mode on, no bluetooth device in sight, so went ahead and installed the app, router disconnected from the internet, then run it.
First thing: refusing access to location. App: sorry, you cannot use me if I cannot access your location, network, and my mothership. And it stops. Big laugh, delete the whole thing. Leaving feedback for other customers about this incredibly stupid intrusion.
Then I got answer from Phillips! Something along the line: "This is for the best interest of our customers, we need your precise location so we can share personalized pollen and climate data and whatnot, we absolutely must insist this!"
For a fan!
Meanwhile the fan has physical buttons on it, can adjust speed, timer, and the cycle. Not completely useless. However some buttons need two press to register the action once. Beeps twice, does thing once. Likely some interference with The App, need to make sure that I am in the same room with the fan with a warning press and then the real press, or whothef knows what was in the head of these guys when they put this piece of thing together!? But really, are they nuts? Ruining use along pollen data?!
Are we already living the movie Idiocracy when it is about the Phillips product design department?! Did they loose all sense with reality? I am sure they already pushing through some new AI function for this very fan and are sad that mine cannot connect to the mother ship through satellite or something just so the update can be pushed to it learning my breath patterns for optimal fan speed. They are nuts! They are nuts!
Bluetooth could be there for initial setup.
To connect the fan to WiFi you have to somehow get the WiFi credentials to the fan. There are a few ways to do that.
One of the most common is for the device when it has not yet been set up to make itself available over Bluetooth. The app can then connect to it and give it the WiFi credentials.
Another common way is for the device to create its own WiFi network with a name that the app can somehow recognize. The app can then find that network, connect to it, and use it to talk to the device.
I don't think this is as popular as the Bluetooth method, probably because it used to require that the user go to their network settings and connect to the device's WiFi network. Plus, when they are connected to the device they are not connected to their "real" WiFi which could disrupt other apps.
However, newer Apple and Android mobile operating systems provide ways for applications to change the network connection in the background or with minimal interaction, which makes this method more friendly so maybe it will become more popular.
There also are supposedly some IoT devices that use WPS (WiFi Protected Setup), where you bring the device near your router, press the WPS button on the router, then press the WPS button on the device, and magic happens to add the devide to your network. I've never actually had any device I've bought support this so it is either uncommon or I've just been unlucky.
Anyway, from what I've read Philips has used both the bluetooth method and the access point method on their WiFi products.
Premium oscillation package, only $9.99 a month.
Plus, this is more complicated than just doing PWM.
>Everything joined up via a 2-pin and 5-pin connector on the PCB. From there, it was a straightforward matter of measuring voltages and continuity to work out what connected to what: the 2-pin connector was offering 24V DC. The 5-pin connector was what went off to the motor itself. Two of its pins were passing through the 24V DC and ground directly. Two more pins were connected to the potentiometer. The fifth pin was not connected.
And it would have been great if that arbitrary assumption had been tested by the OP and the results were documented in the article so that they wouldn't come off as somewhat clueless as to the limitations of their design.. oh well.
Deleted Comment
Deleted Comment
But I also have time-of-day energy pricing, and it would be nice to automatically turn off (or at least slow) my air filters during the 5pm-8pm window. This project inspires me to at least look into the feasibility of adding that functionality myself.
So now I just have them plugged into a few smart plugs with automations in homeassistant
Ten bucks, and completely hacker-proof: https://www.acehardware.com/departments/lighting-and-electri...
$16 if you need a remote control: https://www.acehardware.com/departments/lighting-and-electri...
Or $17 if you want to get all digital and fancy: https://www.acehardware.com/p/3001323
It's been working so well I was actually surprised one night when the dehumidifier in the bedroom turned itself on from the automation (which I have set to do after dark if humidity is higher then 70%).
It had been within tolerance for ages and I just hadn't had to even think about it.
Then there is the series bits x R resistors. The output of each 2R resistor is connected in-between the two resistors that straddle its bit position. So:
And that's it (apart from pull-up/down resistors)! Due to the way that resistors in series and parallel work, each input step in the ladder provides twice the voltage of the previous if powered: it's base 2 enshrined in a physical object.These are relatively uncommon because they are highly sensitive to the resistor (and trace) tolerance, but this circuit is my Euler's identity of electronics: it very literally bridges the digital and analog worlds.
It seems like actual digipot ICs use the "2^n discrete resistors" approach. The IC used in this project is a MCP4141 which explicitly states in section 5.1 of its datasheet that for 7-bit (8-bit) devices there are 128 (256) resistors in a string between the terminals.
I'm a bit surprised this seems to be the best approach, but with IC manufacturing the joint problems of "a bunch of identical components" and "wiring it all up" are much less of a problem than if you were to wire this up by hand.
very expensive, you are committed! :)
you should have gone Full Giertz and added a badd little robot arm that turn the pot.
esp32 are really nice: hundreds of code examples that do what you want without having to read too many pages. did you use ARDUINO IDE or idf.py SDK?
I set ESPHome to use IDF under the hood, you can check out my full ESPHome config for this: https://git.ellis.codes/e/esphome-configs/src/branch/main/vo...