Hacker News new | ask | show | jobs
by nucleardog 2047 days ago
For me it started with a single wifi lightbulb.

My wife often gets into bed with the baby. If the baby falls asleep before the light is off, she doesn't want to get up to have to turn the light off since it will wake the baby. Now she can just turn it off from her phone.

Kinda just expanded from there.

Now a good chunk of the regularly used bulbs in the house are "smart".

Basically what it means is that if you turn a light on, it turns on like a normal bulb (or you can do a quick flick off/on again to turn it on at a dimmer brightness) but you can pull your phone out and dim it / change the temperature / etc. Closer to bed time? Easy to dim the lights and make them super warm.

So that right there is already kinda useful for <$5/bulb. My workspace is a normal warm temperature at a reasonable brightness until I'm trying to do some soldering or something then I can instantly make it bright and white.

From there I expanded out into adding a few basic sensors. Combination motion/temperature/humidity/brightness sensors. So now when I get up for a piss in the middle of the night as soon as I walk out of the bedroom the hallway sensor sees that someone's there and that the hallway is pitch black and turns the hall light on as a red light at ~5% brightness.

When you walk into the baby's room in the middle of the night, same deal. Dim red light. If you go in in the daytime, bright warm light.

Did a similar thing with some of the basement too. Now as soon as I walk into one end of the basement to take the dog outside, do laundry, grab a tool, etc... the lights just come on. They stay on for a couple minutes after the last time motion is sensed and then automatically turn back off. Especially since half the basement is on a single light switch, this results in a lot less wasted power.

The lights in my office come on when I walk in if it's dark, and when I unlock my computer it shoots a message out over a MQTT broker which my automation takes as "someone is occupying this space now" and leaves them on. When I lock my computer, two minutes later if no motion is sensed it'll turn them off.

I don't know that I'd ever add 500 different controls to my house (not sure what I'd even use that many for...), but as far as I've taken it so far it's super convenient.

In the future I fully intend to get a smart thermostat (or replace my thermostat with some controlled relays) and use some "smart" air registers so I the temperature sensors I have can create a loop integrating the temperature sensing integrated in the motion/luminance sensors in most rooms with the heating to more precisely control the temperature throughout the house--if one room is already warm enough but the rest of the house is cold, can automatically close the vent to keep the temperature pretty consistent throughout the house.

1 comments

> The lights in my office come on when I walk in if it's dark, and when I unlock my computer it shoots a message out over a MQTT broker which my automation takes as "someone is occupying this space now" and leaves them on. When I lock my computer, two minutes later if no motion is sensed it'll turn them off.

What did you do to send the message when the computer locks/unlocks? This is an exact use case I could make use of

IOTLink could be used for this: https://iotlink.gitlab.io/

As far as I'm aware it doesn't report locked/unlocked status, but it does report system idle time which you could use for a similar automation.

So, short answer: an MQTT client. On lock/unlock I have a MQTT client called to publish a message to a topic. I think I'm using HiveMQ's mqtt-cli because it was the most immediately obvious option for my OS.

Working out from there:

* I use Windows as the host OS for my desktop. You can use Task Scheduler to set a task to run on lock/unlock. I have jobs set that mute/unmute my audio and call a MQTT client to publish the messages to the broker.

* Those messages are picked up by Node-RED. It's a ladder-logic-ish environment for automation. It has flows that control all the bits of logic based off of all the various data sources including MQTT.

* Node-RED calls Home Assistant, which handles providing a UI as well as actual integration with all the various bits of hardware (light bulbs, z-wave controller, etc)

I quite enjoy this stuff (which is probably half of how I got here), so feel free to ask if you've got follow-up questions.

Indo the same idea but use a ZWave smart plug with power use monitoring with my monitors plugged into that. Watts > some number = I'm working.

Via zWave2MQTT and NodeRed it triggers other logic like throttling RClone uploads.