Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Room 3 - 4 - Lê Quang Hiếu - How to be a cool dad: Leverage DIY Home Automation with Open Infra Technologies
1. How to be a cool dad
Leverage DIY home automation with
open infra
Hieu Le - sudo@rm-rf.cloud
2. #whoami
● Founder of Vietnam OpenStack Community since 2013, then
Vietnam Open Infra since 2018.
● Now in charge of Viettel Network global operations.
● DadOps.
...
3. What i will share
● My story about transforming my “not-smart” home to smart
home
● Some personal thoughts comparing between large-scale
infra operations with home operations
● Tips and tricks to be a cool dad(ops)
4. What i will NOT focus (a.k.a I dont know)
● How to be a dad
● How to install/deploy/config some things
Stuffs like these could be googled
6. SMART THINGS
COMMUNICATE WITH EACH OTHERS
AT HOME
Home Control —> Home Automation –> Smart Home
From Micron Tech - pycon TW 2018
Location
Time based
State
8. Apple Homekit
Google Nest
Tuya
Xiaomi
… SMART THINGS
COMMUNICATE WITH EACH OTHERS
AT HOME
Home Control —> Home Automation –> Smart Home
Wifi
BLE
Zigbee
MQTT
defacto spec
…
Via their own app
(Google Home,
Apple Home, Tuya
Smartlife…)
At
their
Cloud 🤑
Control
devices in
new ways
(phone/PC..)
THE FUTURE IS NOW
10. 3 Broadlink
3 GG Home
4 Xiaomi
(1 Fan, 1
Purifier, 2
Camera)
4th Floor Real
Estate, built
from 2000
11. Challenges #1
● Each device comes with own app.
○ No single place of control.
○ No automation across different products.
→ Hubs try to solve this.
11
12. 12
Home automation
platform running on
Python 3.
Open-source, MIT
license.
Home Assistant
Host it yourself so
your data stays
yours.
Track people and
things on a map.
Responsive web app
that runs great
everywhere.
Track the state of
your house over
time.
13. 3 Broadlink
3 GG Home Mini
4 Xiaomi
(1 Fan, 1
Purifier, 2
Camera)
4th Floor Real
Estate, built
from 2000
14. Challenges #2
● Latencies
● Securities
TIL: your wife and your children are the strictest
customers.
All Operations Knowledge in large scale infra with more
than 10k nodes is zero comparing with your home (life)
automation.
14
17. Challenges #2
● Latencies
○ Good < 0.5s, Acceptable ~ 1s,
Poor > 1s.
○ Think about your current SLI/SLO.
● Power: battery, wiring?
● Securities
○ You all know about this
17
→ Protocol Battle: Zigbee, MQTT, BLE, Wifi, NFC/RFID
0.46s
0.28s
Current choice: Zigbee/MQTT → Wifi
18. Challenges #3
● Reliability
○ Network issues: Locality (Edge) vs Cloud →
○ States sync between edge and cloud
○ False positives and negatives
○ Think about your DR Plan.
● UX
○ Actuator
○ Senses
○ Visualization
18
From Vertiv
vs
19. TL;DR: HOME AUTOMATION
● YOU SHOULD NOT HAVE TO ADAPT TO TECHNOLOGY
● YOU ARE NOT THE ONLY USER OF YOUR HOME AUTOMATION (WIFE RULE THE WORLD)
● LIMIT THE IMPACT OF FALSE POSITIVES AND NEGATIVES
● THE PERFECT APP IS NO APP
● YOUR SYSTEM SHOULD RUN AT EDGE, NOT IN THE CLOUD
19
20. What’s the core of home automation?
● Rule based.
● Triggered by an event.
● Optional conditions based
on the current state of
devices.
● Action can be to control a
device or call an external
service.
20
User
Home
Automation
Commands
Rules
Information
Commands
Information
Home Control
21. Internet of Things
Lights Switches
User
Home
Automation
Smart Home
Many more…
Information
(ie. light is on)
Commands
(ie. turn light on)
Commands
Rules
Information
Commands
Information
Commands
Information
Home Control
Different levels of home automation hubs
21
22. ● Event driven system.
22
State
Machine
Event Bus
State changed
events
Timer
Time changed
events
Service
Registry
Call service
events
Service executed
events
Core Architecture
● No notion of lights or
switches. Just entities
and their state:
○ Identifier
○ State
○ Attributes
○ Last updated
(anything)
○ Last changed (state)
● Service Registry to track
available services.
● Timer to notify time
changed.
23. ● Device Types (light,
switch, etc)
● Presence Detection
● Entity Organization
● Automation
● Record History
● Third-Party Services
Integrations
● Export Data
There’s a component for that.
23
24. 3 Heater Switch
5 Smart Sockets
2 IR Repeaters
2 TV
1 Monitor
3 IR/RF Repeater
1 Fridge
2 Laundry
3 Camera
2 Hubs
14 Switches
6 Door sensors
1 Motion sensor
1 Weather sensor
1 Outlet
1 Fan + Purifier
2 Purifier
2 Fans
1 Vacuum
4 Lamps
1 Kettle
3 Weather sensor
1 Nest Hub Max
1 Nest Hub
3 Nest Mini
1 Maika Speaker
1 Smart CB
1 Dish Washer
1 Homepod
Total 72 devices
- 23 Zigbee 3.0
- 43 Wifi (local + cloud)
- 4 BLE
- 2 MQTT
Vendor Cloud
Home (Edge)
CC2652P
NUC6
Synology DS220+
DNSSEC
VPN
CURRENT SETUP