I've mentioned before that I plan to improve my home automation system using a Raspberry Pi running Home Assistant. I'll be replacing an old system which lacks connectivity. The new system will allow me to use all sorts of new technology. They list over 400 'components' for everything from wifi lights to Bitcoin price feeds.聽
My first step is to get my existing PIR sensors and door switches working with the Pi. The sensors run off at least 9V, so I was very wary of overloading the Pi inputs that only handle 3.3V. I did some playing around with resistors and opto-isolators, but it looks like it just needs a resistor on the output. Although I did a degree in electronics many years ago I've worked mostly on software and my hardware experience is limited and rusty. I was able to write a little Python program to poll the input and see when movement was detected.
Image from Wikimedia.
The next step is to get Home Assistant to use this. I'll be switching lights using old X10 technology as it's what I already have. The Pi will connect to an interface via a USB to serial adaptor. Eventually I hope to get some more modern devices, but I'm not looking to spend lots of money right now.
I've also finally tried to use the Pi Zero I got free with a magazine. I don't have adaptors to plug it into much, but I read that it was possible to get access purely over USB. I had some 2GB micro SD cards, so I flashed one of those with Raspbian Linux. My PC can see the Pi, but it looks like SSH may not be active, so I need to look further into that. I may buy some cheap add-ons for the Zero. There's a scrolling LED display that I could use to show useful alerts, e.g. when a whale votes my posts up!
Update: There's a comment on the USB post above about getting this working with Ubuntu. Just had to tweak a network setting. I've had to change the name of that Pi as the PC was getting confused about ssh keys.
I've been trying to find more time to play with this stuff. It's fun and not too expensive, but time is in short supply. I'll post further updates as I make progress. If anyone wants further details then let me know.