The project is about Home Automation. Most of my Home automation existing devices are Arduino based, with the following limitations:
- Those devices perform well for simple tasks but they don’t collaborate. They don’t have enough crunching power to host a database, a web or a queuing server.
- They are not designed to be exposed to the Internet. No firewall is in place and no security neither.
- The devices are connected to the LAN but they are not isolated, they share the same bandwidth and other network related conditions with all other computers used by family members.
- Here are some examples: weather station, LED strip controller, door bell, water leakage detector, and smoke detector.
I have other devices that are Insteon-based
- Insteon uses a proprietary protocol to make the devices communicate wirelessly together, in a mesh topology
- Here are examples: dimmer module, on/off module, dimmer switch, on/off switch, dimmer keypad (by 8 or by 6), thermostat, and motion detector.
I plan to add the following features or roles to my existing home automation infrastructure.
Network Management- Setup VLANs to isolate home automation related traffic from family related traffic.
- Bridge wired and wireless networks: the idea is to make devices be able to “see each other’s” once they are on the same “Virtual Network”, regardless they are physically or wirelessly connected to the infrastructure.
- Bridge Insteon traffic with IP traffic to create new scenarios, like “Dim light depending on daylight”.
- Monitor network availability (LAN, Wi-Fi but also Internet access).
- Route and filter traffic from/to local virtual networks but also from/to Internet.
- Maintain a list of authorized devices, map their names and addresses, monitor them.
- Deploy software patches automatically to devices.
- Maintain a list of authorized user, grant local and web access to services.
- Aggregate sensor data from different sources: offer a basic publish/subscribe mechanism to allow devices/services to communicate in an asynchronous way.
- Store aggregated data and configurations that we want to keep for a long period.
- Deploy a basic "if this then that' engine.
- Offer a set of APIs to remote authorized users/devices.
- Manages notifications sent to users/systems regardless their location, the infrastructure and the device they use.
Once that (or those) device(s) will be deployed, I will be able to create more integrated services (i.e. services that require communication between devices from different technologies and/or communication with Internet and/or more crunching power and/or data storage/analysis.
Here are some scenarios I would like to showcase:
- Configure indoor lighting based on outdoor light level and presence: kitchen light will turn on progressively based on light level (measured by weather station), but only if there is someone in the room
- If smoke detector triggers an alarm, lights are turned on at max level to highlight the safest path to exit the home.
- Once a button is pressed on a Insteon keyboard, a motorized valve will toggle (that valve is part of one of the many DIY Arduino-based devices I designed in the past). It turns on/off the main house water supply.
Assuming all Arduino based and all Insteon based devices are already in place, I plan to add 3 items:
- A “network manager”, i.e. an ASUS router running OpenWRT.
- An “orchestrator” (I.e. a DragonBoard-410C running Debian with a lot of SW services on it).
- A “gateway to Insteon world”, built with the following components: an Insteon serial PLM, an Arduino and an Ethernet shield. See this link for more details on this project.
- Network management: the idea is to create VLANs and to isolate devices that are not designed to be secured in an almost closed environment.
Aggregation of wired and wireless LAN (bridges): once aggregated, devices are on the same subnet and it is easier to make them communicate.
- Firewall/iptables: intercept or forward traffic between WAN and the VLANs and between VLANs.
- Remote access gateway (forward calls to port on the DragonBoard).
- Devices management (i.e maintain a list of connected devices MACs and make it available through an API).
- (Roamap) aggregation of BLE and LAN.
- Security
- (Roamap) User management
- Networking (both wired and wireless)
- Queuing server (MQTT Broker)
- (Roamap) Database server
- (Roamap) Basic “If this then that” engine
- (Roamap) Infrastructure (port forwarding)
- (Roamap) Security (SSL – user authentication)
- (Roamap) Custom web pages
- Notifications
- Local display : feed a 8-RGB LED strip
- (Roamap) Remote: send notifications to SMS, smartphones
- Gather and publish statuses.
- Assuming all other Insteon devices are bound with this PLM, both as controller and as responder. Then PLM will listen to all messages sent by those devices.
- Arduino will (over serial link) get the same info, display them on the front panel, convert it to MQTT messages and send them to the PHSA gateway.
- Listen, push and execute commands. Arduino will listen to specific MQTT queues (one per targeted Insteon device), display the messages to the front panel and push those commands to the PLM (over serial). PLM will transfer those commands to the targeted Insteon devices.
I will use a plastic enclosure since it does not block wireless communication. Inside the enclosure, I plan to install the following items:
- a PSU (AC/DC - 12v, 2A): similar to the one sold by Arrow but packaged to be integrated within an enclosure
- the DragonBoard 410C
- a mezzanine board.
There are two advantages to use that mezzanine board:
- First, Dragonboard 40 pins connector is not that easy to interface (it should be great if someone could design a flat cable) Mezzanine board is designed to interface more easily and it provides standard Grove connectors.
- Second advantage is there is an Arduino on board: I will leverage it for specific features, when micro-controllers are more suited than bigger multi-tasking solutions.
On the front panel, I plan to install the following items:
- LEDs strip (8 LEDs controlled individually)
- Dragonboard connectors (HDMI, USB, with one USB with a USB-to-Ethernet external adapter.
On the rear panel, I plan to install the following items:
- AC housing connector
- Reset button: to be decided where to connect it. I would like to trigger as shutdown when button is pressed 1 sec and to trigger a cold boot when it is pressed 5 sec.
- Wi-Fi / BLE antenna (I don’t think it is needed but just in case.)
Each LED is RGB and can be controlled individually, with just one wire. See here for more info. Timing is crucial, that’s why I plan to delegate LED management to the Arduino hosted on the mezzanine board. See here for more info.
If This Then That EngineThis one is a huge topic by itself and I will for sure not find a safe path within the timeframe of the current project. There are tons of Home Automation integration SW. I considered OpenHab 2, an open-source suite with a strong and stable community. It works on Linux, there are PoC running on Raspbian. There is an annoying bug that currently blocks the Insteon “add-in”, no hope to get a fix at short term.
This project is a PoC only, but it works. Here are the Python scripts.
Comments