# Home automation - good useable products?



## PacketMan (Jul 12, 2021)

Hi all again, hope all is well with you folks.

I did some searching, found older articles, so I thought I would start a more fresh discussion.  I am interested in some home automation ("some" currently means turning some lights on/off), and although I can easily buy 'smart' stuff at big box stores, I am wanting to avoid that for various reasons, and thus am wondering what technology and products are available to use with FreeBSD.  Some points to clarify what I am thinking / wondering.

I would like:

'Switching modules' to be LAN/Wifi/IP based instead of RF based. (For various reasons).
Products to be open source based.
System works with FreeBSD ports that are actively being developed & updated.
Said port(s) provide a web page for me to monitor and control the switching modules.
An application to install on an Android device, as an alternative to web page use, to work with the FreeBSD port.
Little to no custom coding involved.
The whole complete system works wonderfully well, and the tecnically challenged folks in my house could use it easily.
So in other words, I would install various switch modules around the house, and configure them to (a) use my Wifi and (b) work with the FreeBSD port. I would configure the FreeBSD port (via http) to use those modules, and  build the automation logic/schedules, etc.

I realize X10 and other competing products have been around for ages, but they often use RF, or inject signals in your power wires, and from what I understand 'interference' issue can be common. As for the 'smart home' products, brands and technology seem to come and go like the wind.

So what options do I have folks?

As always, thanks again in advanced.


----------



## msplsh (Jul 12, 2021)

In my experience with working with these things, none of this stuff is any good, in particular, anything that uses TCP/IP.


----------



## Phishfry (Jul 12, 2021)

I was messing with GPIO's lately and the only software that stands out to me is Openhab.
misc/openhab


----------



## kpedersen (Jul 12, 2021)

For home automation I would actually recommend "prosumer" / hobbyist hardware like Arduinos and Raspberry Pi's. Mainly because the hardware is easily available and you won't be buying in bulk. It might be a little more expensive but you likely won't be buying it all at once anyway.

If you want to minimize coding, perhaps something like this: https://pibakery.org/

However if you can just about follow through with some simple Arduino hat tutorials, it really does open up a lot of possibilities.

... or at least exhaust you enough that it makes physically walking over to your light switch look much more enticing XD


----------



## Phishfry (Jul 12, 2021)

I don't like Java but I think this software is worth it.
Openhab integrates nicely with IPCams. It is not easy to setup. It encompasses alot via modules.
I do believe after a you built a HAB it would be usable to anyone in the household.
The docs are good for me.

I was messing with zones around my house exterior using a drawing I imported.
Trying to visually flash colors in zone where motion occurs on my HAB.


----------



## diizzy (Jul 12, 2021)

Home Assistant Operating System in a VM seems to be the easiest/most complete solution going forward. Pair that with a Zigbee bridge and you have a pretty solid base to play around with.
As for hardware, I found this to be pretty useful and it'll serve as my "test" setup
https://paulbanks.org/projects/lidl-zigbee/ --> https://paulbanks.org/projects/lidl-zigbee/ha.html


----------



## Phishfry (Jul 13, 2021)

I also think it would be good to take a specific area that interests you.
Home Automation can mean different things to different people.
In the past i have used x10 for indoor motion sensors. They worked well.
I like the monitoring aspect of home automation while some might want instant coffee brewing or catnip dispenser.
Take a task and try it out. Dont try to automate everything at once. That is my advice.


----------



## bobmc (Jul 14, 2021)

PacketMan said:


> some home automation


Take care if using WiFi because high-tech home gadgets, like those in the Arduino camp, require you to enter your credentials in plain-text.  They degrade security.  I like ESP32 which has WiFi and Bluetooth.
My current project is upgrade my Honeywell air conditioner from line-voltage control to wireless.  I use bluetooth for that.

The obsolete line-voltage control has a flexible metal disk that contains a gas which expands such that the disk presses a microswitch that turns on the cooler.  It is the cheapest thing that could possibly work but the temperature varies +/- 2 Cdegrees.  When warming the cooler is late to turn on and it runs too long after the temp. has dropped.  My ESP32 with DS18B20 1-wire sensor can maintain 1 degree of variance.

I am not sure of the Honeywell specs and can't tinker with the line voltage wiring so I use a HS-422 servo to press the disk which turns on the cooler.


----------



## ralphbsz (Jul 14, 2021)

I use several parts to home automation, which are somewhat related.

First: Light switches, controlling mains power (120V stuff) like attic fans and Christmas lights: For that I use UPB (Universal Powerline Bus), which is a successor to X-10. It is a set of switches (both user interfaces and actually electrical controls) that can communicate with each other, and with a computer. Communication occurs over the power line itself (at hundreds of baud), which is why it is exceedingly reliable. I have a computer interface connected via serial port to by FreeBSD home server, where several programs communicate with it. This system is expensive (every light switch is about $100), but bulletproof, meets electrical code, and is extremely reliable. Really, the only time I get communication errors is when either (a) my software breaks (happened this weekend!), or (b) a breaker trips and part of the electrical system becomes disconnected. Matter-of-fact, I now have a cron job that tries to communicate with certain UPB switches once an hour, and it's only purpose in life is to tell me when certain breakers have tripped (for a while, I had a problem with moisture and GFCI breakers).

Second: I have a somewhat complex system to control and monitor our water pumps and the well, which is built around industrial controls (float switches, level sensors, industrial controllers). That is in turn connected to two Raspberry Pi computers, and again to my home server (via a serial port and some industrial control acquisition boards). Also going in there is monitoring temperatures via Dallas/Maxim 1-wire sensors, connected both to a web-based interface and to the Raspberry Pis. All comes together in my home server.

Then there is a sprinkler controller (for garden watering, which in our case includes several large fire-fighting sprinklers), which is web-connected. I picked the RainMachine brand that has very good open-source interfaces, even if the code that runs on the controller is in and of itself not open sourced. Plus, it can be locally controlled (via IP ports), without having to go through a cloud interface (even though cloud access is also available). And a weather station, which ends up being Ethernet connected; this one is a Davis, because their sensing hardware has the best reputation among prosumer stuff. And the greatest software interface in the world doesn't help if the temperature or wind sensor is spitting out nonsense values.



PacketMan said:


> Switching modules' to be LAN/Wifi/IP based instead of RF based. (For various reasons).


LAN/Wifi/IP is not very reliable. It requires a heck of a lot of infrastructure to work (DNS servers, DHCP servers, routers, all that stuff). Even worse, hardware that requires going in and out of the cloud (like many internet-based thermostats and sprinkler controllers) are unreliable, because the local broadband needs to be up for them to work. Pieces of wire and 24V relays are very very reliable. Industrial control hardware is very reliable. Powerline interfaces (such as X-10 and derivative technologies) are reliable. But: I do share your dislike of RF. Even if it happens to work flawlessly on my Davis weatherstation.



> Products to be open source based.


Honestly, I will never do a detailed code review on the code that runs in my thermostat, light switch, or sprinkler controller. So having that code available has no value to me. It is more important that they have good, clean and documented interfaces.



> System works with FreeBSD ports that are actively being developed & updated. Said port(s) provide a web page for me to monitor and control the switching modules. Little to no custom coding involved.


Don't have that. I write all that myself, for fun. It's one of my hobbies.



> An application to install on an Android device, as an alternative to web page use, to work with the FreeBSD port.


My sprinkler controller has an Android app (and also an iOS one), which is SUPER convenient. When gardening, I can quickly check whether a sprinkler is working by pulling my phone out. I can also access it from my code, but that's not easy from a cellphone (I'm a CLI guy).


----------



## LVLouisCyphre (May 13, 2022)

Since there's an existing thread here.  Has anyone found a keypad deadbolt lock with a key backup similar to the SimpliSafe lock and a doorbell camera, perhaps R Pi based?  One of the things I'm going to do to mitigate the WiFi issue is 802.1x authentication along with a MAC or L2 ACL on my WiFi APs or gateway.  My WiFi gateway will either be running dd-wrt, openwrt or pfSense.  I strongly suspect that pFsense will be available for the R Pi 3 and 4 once FreeBSD ARM becomes a tier 1 platform.  At the bare minimum I want to implement is a camera system and environmental control with a WiFi thermostat and power monitoring of my server garden (2 Cisco switches (WS-C3550-12T and WS-C2975G-48), 2 Lenovo Thinkservers and 4 HP Microservers (G7 N54L)).

Any pointers or linkage to help speed my due diligence in this project is appreciated.


----------



## SirDice (May 13, 2022)

LVLouisCyphre said:


> once FreeBSD ARM becomes a tier 1 platform.





> The 64-bit ARM architecture known as arm64 or AArch64 is promoted to Tier-1 status for FreeBSD 13. Announcement











						FreeBSD 13.0-RELEASE Release Notes
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org


----------



## astyle (May 13, 2022)

diizzy said:


> Home Assistant Operating System in a VM seems to be the easiest/most complete solution going forward. Pair that with a Zigbee bridge and you have a pretty solid base to play around with.
> As for hardware, I found this to be pretty useful and it'll serve as my "test" setup
> https://paulbanks.org/projects/lidl-zigbee/ --> https://paulbanks.org/projects/lidl-zigbee/ha.html


I disagree with when to use the VM part... The way I imagine it, a VM is good for spinning up a FreeBSD base from scratch (basic networking/security and GPIO), but I'd want to export an ISO to transfer to a dedicated physical host that has the compatible hardware for the home automation.


----------



## LVLouisCyphre (May 13, 2022)

Phishfry said:


> You don't want to mix a Firewall Distro with GPIO. Two opposite ends of the task spectrum. Setup a seperate hab server and wap


I didn't say I was doing that did I?  The WiFi/router may be strictly used as a WAP or I may be using as a backup router via OSPF or CARP.  I'd do EIGRP, but there's no official support for it in Quagga as of yet.  Also there's something out there called VLANs.  Can you say VLAN boys and girls?  Do you really think I'm going to put GPIO on the same SSID and VLAN as everything else?  That's a trap for the stupid.


Phishfry said:


> I don't think MAC ACL is worth it. They are too easy to spoof.


We used them at my former employer which by the way was the one of the top five school districts in the USA by student population consisting of over three hundred sites during our early WiFi deployment.  The one PC in a portable classroom was connected to an ethernet converter.  We eventually ran a four strand of multimode fiber to the portables plus now students have their own laptops and tablets so it's not feasible to do MAC ACLs because of the pain of administration and scalability.  I'm also going to be having a guest SSID and VLAN set up plus a honeypot/tarpit that will rival a combination of H.H. Holmes murder castle and a mausoleum from the Phantasm franchise.  I then get the subject's license plate number or suspected apartment with a Wireshark trace to a detective I know at the LVMPD Cyber Investigative Group.  I've  done some consulting work for law enforcement.  I know what's needed to at least get a warrant.  The detective gets an arrest and I get to point and laugh.  If I really want to be helpful with this poor misguided soul's rehabilitation while in prison, I could send the convicted con a postcard with this on it with NAMBLA or Jerry Sandusky's return address on it.  I'm sure that will result in some good quality time and socialization with their other inmates or they end up in a nice private cell in AdSeg. 


Phishfry said:


> Used APC Netbotz and AP7901 PDU for monitoring


I didn't ask what to use for environment monitoring.  I mentioned I'm going to do environmental monitoring.  I specifically asked about specific devices; cameras, door locks, door bells and thermostats and preferably can be controlled by a R Pi.  I believe the APC SMX1500RM2UC I'm looking at does environmental monitoring but what do I know?  I've only been supporting APC devices for years.  My former employer's server room had Netbotz.  I know the capabilities of APC smart PDUs as I had to configure one to reboot a 3G router at a remote site to reset the 3G radio at a scheduled time prior to school opening for the day.   The copper running up the mountain was all used up by the Division of Forestry's fire station for the frac T-1.  None of the utility providers were going to run additional copper or fiber up the mountain because of how sparsely populated it is.  I want to use a R Pi based camera and stick it to my windows with suction cups.  It'll be a bit more discreet than having 1U devices in my window, ya think?  I've also have racked and replaced more than my share of APC SmartUPSes and replaced battery packs on Symmetras.  I suspect all of dealing with all of the heavy equipment is what caused me to take a disability retirement.  Servicing all of the heavy equipment contributed to the degenerative disc disease in my spine resulting in me getting fused C3-T4 and subsequently ending my IT career because failed back surgery syndrome.  This also happened to a former coworker of mine.  He was also put out to pasture.  He ended up with a bad case of sciatica.  

A word to the wise.  Do everything you can to avoid spine surgery because if it goes wrong it can end your career.

Are there any more assumptions you want to make?








SirDice said:


> FreeBSD 13.0-RELEASE Release Notes
> 
> 
> FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.
> ...


I'm aware of that.  I learned in my long IT career (1989-2013)  is to avoid all .0 versions of anything, deploy a version of Windows until it's had at least service pack 1 or buy the first model year of a motor vehicle unless you're a masochist or enjoy being a beta tester.  Once 13.1 is released and stable then I'll buy a R Pi 4 (8 GB RAM) and start tinkering with it.


----------



## astyle (May 13, 2022)

LVLouisCyphre said:


> the way was the one of the top five school districts in the USA by student population consisting of over three hundred sites during our early WiFi deployment. The one PC in a portable classroom was connected to an ethernet converter. We eventually ran a four strand of multimode fiber to the portables plus now students have their own laptops and tablets so it's not feasible to do MAC ACLs because of the pain of administration and scalability. I'm also going to be having a guest SSID and VLAN set up plus a honeypot/tarpit that will rival a combination of H.H. Holmes murder castle and a mausoleum from the Phantasm franchise. I then get the subject's license plate number or suspected apartment with a Wireshark trace to a detective I know at the LVMPD Cyber Investigative Group. I've done some consulting work for law enforcement. I know what's needed to at least get a warrant. The detective gets an arrest and I get to point and laugh. If I really want to be helpful with this poor misguided soul's rehabilitation while in prison, I could send the convicted con a postcard with this on it with NAMBLA or Jerry Sandusky's return address on it. I'm sure that will result in some good quality time and socialization with their other inmates or they end up in a nice private cell in AdSeg.


Are you referring to the 2013 LA School district hacking? That falls within your timeline, BTW 



LVLouisCyphre said:


> I'm aware of that. I learned in my long IT career (1989-2013) is to avoid all .0 versions of anything, deploy a version of Windows until it's had at least service pack 1 or buy the first model year of a motor vehicle unless you're a masochist or enjoy being a beta tester


I use FreeBSD 13.0-RELEASE, it's solid. Looking at 13.1, it does offer some improvements, but not enough to be completely sold on upgrading.


----------



## LVLouisCyphre (May 13, 2022)

astyle said:


> Are you referring to the 2013 LA School district hacking? That falls within your timeline, BTW


I left the cesspool of CA on September 1, 1992, forced out to pasture on July 11, 2013 once my disability retirement was approved.   I'm looking forward to the day that everything west of the San Andreas fault falls into the Pacific Ocean.

I handled network design, security, infrastructure and running the NOC.  Another department in the IT division handled desktop support.   I cut my teeth in the business when the Sun SPARCstation 1 made it's debut in 1989.  A majority of the Suns from 1990-1 in Qualcomm Building C were bought from my former employer.  I configured and QA tested them prior to delivery.  I also connected NOAA to UCSD in La Jolla.  One of  their SPARCstations was functioning as a router with two NICS.  The UCSD network admin specified that routed be run in quiet mode.  Not surprising consider we didn't have switched networks back then.  One of my biggest headaches was getting sendmail to route mail over DECnet.  I also maintained the company UUCP site and had my own personal UUCP site running ISC Unix 2.2.

Yes, I'm carbon dating myself.


astyle said:


> I use FreeBSD 13.0-RELEASE, it's solid. Looking at 13.1, it does offer some improvements, but not enough to be completely sold on upgrading.


I don't care what you use.  My standard practice is avoid .0 versions many of my colleagues in the business agree with me that's a best practice.  I'm using 12.3 along with pFsense.  When 13.1 is stable, I'll get it for use in R Pis.


----------



## rootbert (May 13, 2022)

attention, this is massive ;-) https://www.home-assistant.io/


----------

