Raspberry Pi 3 based home automation with Node.js and React Native
github.com
github.com
I've done two Pi projects now that I keep meaning to blog about. One was a sprinkler control system. My old system was dying, and not very flexible, so I decided to run everything off a Pi. The tricky part was driving 13 sprinkler lines with 24V AC current. I bought a 16-relay board and eventually got it wired up. For someone with little electronics experience, there was a lot to learn. [1] is an attempt before I realized I had to use the relays. Eventually I got it working and used it all summer. With cron, I can schedule things however I want!
The second is a security camera for a vacation rental home, and is not quite done yet. The hardware side was not challenging at all, but I still need to work out how to copy the images up to S3 or a Linode. I'm using MotionEyeOS and it doesn't seem to know how to do that itself. One of the big reasons I went with a Pi is I didn't want to pay or rely on someone else's servers. Also I wanted to avoid the security problems that have been in the news lately. I don't want inbound traffic to my LAN; I'd rather push the video somewhere else.
It took me a long time to figure out worthwhile uses for a Pi. A friend of mine loves using these things for media servers and CI servers and whatnot, but to me it's only satisfying if it's something where you actually need the miniature scale. Also a Pi really hits the sweet spot for me in terms of hardware-vs-software. I'm sure I could have done the first project with an Arduino, but using ssh, cron, and python was really nice.
[1] http://raspberrypi.stackexchange.com/questions/50435/driving...
Exactly my motivation. I have an mqtt broker at a heart of everything. homekit2mqtt for homekit/siri integration, lirc2mqtt so my harmony remote can join in, node-red providing some automation logic, etc.
But where it gets interesting is being able to support devices that won't otherwise. Homekit support for Philips Hue means €50 for a new hub - or mqtt-hue so I can support it myself. Belkin Wemo doesn't support homekit, and has no plans to - but I've done it via node-red regardless.
DIY looks messy from the outside. But once the ball is rolling, anywhere a vendor won't support the features I require, I'll support them myself. The ability to do so makes it all worth it.
Pretty sure the messy part isn't about writing code, it's about maintaining it. What happens if one of the APIs you're talking to changes? What happens if you want to add a new device into your ecosystem? If there's a power outage and one of your hubs doesn't come back up, how much time/energy does it take to figure out which one and to bring it back up?
Not saying that it's not a worthwhile project, just that it takes a lot of effort. That said, I have my own growing list of bots that helps me automate repetitive tasks in my life that I maintain...
This may be the biggest reason I go DIY on my automation - it gives me a chance to learn things that I wouldn't get into at work.
[1] https://www.theguardian.com/technology/2016/apr/05/revolv-de...
Catching dark hardware is really easy - just allow each component to die if it can't reach the hardware, and then catch their 'last will' messages in mqtt (mqttwarn is great for this, I can get an email whenever a 'last will' is published). Also a problem the vendors won't solve for me ..
> With cron, I can schedule things however I want!
Wait, are you not using sprinklers_pi[1]? I highly recommend it.
I have more home pi/arduino/IoT projects coming up, but I am thinking it's going to be a lot of work integrating them. I'd like one home app/page that integrates them all.
Once your hardware is integrated with Home Assistant it can handle automating things. The whole system is a big state machine so most automations will involve reacting to state changes and sending commands to other devices in response.
After I swapped it out I missed quite a few things - controlling it from my phone, from home or remote, being able to pull up a graph and see how long each zone ran. I wasn't in the mood to get up at 3am to see if the rainbird was working so I crossed my fingers and hoped it would work at least until the house sold. Setting up all my zones was a lot faster on the pi than it was with cranky dials and buttons on the rainbird. I won't miss it.
2. The UI was awful and buggy
3. It finally broke outright and replacements with halfway modern features were pricey
Can you just make the folder it copies to a link to a mounted remote filesystem, mount your server folder over SSH, for example.
> The second is a security camera for a vacation rental home, and is not quite done yet.
What is the purpose of the camera?
https://github.com/nfarina/homebridge
https://energenie4u.co.uk/catalogue/product/ENER314
https://energenie4u.co.uk/catalogue/product/ENER002-4
I wouldn't call it simple to set up, but it was cheap - about £70 (not including Alexa device, which could even be the same pi - https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry... )
Home Assistant
Custom TX board to transmit to the Etekcity sockets
https://www.amazon.com/Etekcity-Wireless-Electrical-Househol...
Using Alexa to control those outlets via Home Assistant Emulated Hue component. Then I have a couple groups defined in Home Assistant for my living room lights, so I can say "Alexa, turn off living room lights" and it'll turn off my three outlets. I can also do "Alexa, turn off living room light one" to just turn off a particular light. One thing that I've noticed with Alexa and Home Assistant is that I have an outlet labeled "Xmas Light" and I can either say "Alexa, turn on Xmas Light" or "Alexa, turn on Christmas tree light" and it seems to discern between the two.
Overall I love this combo and is working pretty dang good.
Next goal is to use PIR sensors so when I go to the basement it'll automatically turn on the basement lights.
https://home-assistant.io/getting-started/installation-raspb...
Anyone getting into this field should take a look at Peter Scargill's Tech Blog - he has published details and code for a home control system centered around a Pi using MQTT with a range of modules (mostly ESP8266). The most interesting recent stuff is on control, monitoring and dashboard design for phone and Web apps - his work on the dials and gauges is very good.
Pete also takes a regular look at other non-Pi platforms from an IoT control perspective.
It's a great solution. Most houses in the US have central heating/cooling so the IR remote isn't an option. Although I have seen that style before.
What I want to do is integrate it directly with the system. Here's an example of a Honeywell connector similar to mine.
http://diyhousehelp.com/how-to/honeywell-4-and-5-wire-thermo...
I've been wanting to do something similar with the units in my apartment (they're similar to what you'd see in a hotel window unit). The thermostat and controls are integrated and I can't disassemble to access them, so I either need to build a rig to push the buttons (hard) and turn the temperature dial or just put a relay at the mains and manually set them for AC\Heat depending on season. Adding a relay to the mains seems straightforward, but it's 220v and I don't want to mess up.
I am using one to turn on/off the mains power of a 12VDC transformer. The nice thing about an SSR with an input range of 3–30V (a common type) is that you can drive it directly (and safely!) from a Raspberry Pi GPIO pin (3.3V).
I've been trying to keep a blog of my progress, if anyone is interested, though please forgive the poor grammar / stream-of-consciousness in the posts... I've been writing quickly to get caught up.
Initially, I had planned to wire through the basement, but getting through the floor turned out to be a littler more difficult than I had hoped.
At the moment, the wires are run under carpet and behind furniture. I just ordered another Pi (and am looking at cheaper boards) to set up another 'base station' to reduce the amount of wires I need to get full coverage.
I'll be doing some similar. Couple things that I'll likely do different is push to InflexDB host in my homelab and using Pandas to help me analysis data.
Keep up the good work, it's inspiring.
I hadn't heard of InfluxDB before, looks interesting.
Looks more like monitoring and control, on which you could of course build automation, but I personally am also not sure where to head on that one.
Nevertheless: Cool project! :)
a PI, many sensors and controls. the pi to do the things the pi always does. the sensors to sense room temp. in each room. And this is the hardest one, flow control per radiator.
I want that I can set room temp schedules, and can go off schedule using the app (manual intervention) When the current temp in any room is below the set temp for that room the heater system turns on The rooms that are already above their set temp have the radiators turned down.
Why? Because I don't like to waste heat to a room I don't enter 90% of the day. And when my living room has reached the target temp there is always a room that is either still stone cold or feels like sauna.
The hardest part about this is the controllable radiator valves, the rest already exists.
If anyone knows of a good Pi-like board that runs off PoE out of the box, let me know.
I think there are 2 options,
1 you run everything on the network.
2 you use PI's io to directly control/sense.
The power either comes from pi, poe or a separate adapter (either at pi running with other wires or near radiator)
http://www.vesternet.com/smart-home/technologies/z-wave/heat...
The other commenter has a link to a product that works on battery. (though that has the temp sensor inside the device, which I don't consider reliable, being so close to the heat source)
It would be an amazing project when redoing a house, as at that point I could just run a special circuit.
So yeah check out that link, for your convenience copied here: http://www.vesternet.com/smart-home/technologies/z-wave/heat...
[1] https://www.aliexpress.com/item/Black-G1-Inch-Water-Flow-Hal...
Although, I wonder if scaling (as in hard water scale) is still going to be an issue.
1. Z-wave switches/outlets/locks - all lamps, receptacles and locks controlled by Vera Edge; 2. DSC alarm system - door/flood sensors, integrated with Vera; 3. Nest cameras - not integrated; 4. Nest thermostat - integrated with Vera and Alexa;
Currently trying to integrate Vera and Alexa to have fully voice- controlled home.
They have links between Vera and the Echo along with a TON of other things.
so: wall --> adapter --> lightbulb
Since I'm pretty familiar with javascript and its ecosystem
https://news.ycombinator.com/item?id=13491012 https://news.ycombinator.com/item?id=13485444
It's too bad that the author's Show HN wasn't the one that made it, but at least the project is getting attention now.