Automate Your Life

Home-Assistant.io

Teagan Glenn

that@teagantotally.rocks

Teagan42

Denver Devs Slack: Teagan42

Part 2

My Background

  • Been coding for 19 years, 11 professionally
  • Completed Bachelors Programs in
    • Physics
    • Mathematics
    • Computer Science
    • (Incomplete) Electrical Engineering
  • Self-Proclaimed Engineer of Laziness

My Home

  • Presence Detection
    • GPS
    • Router
    • Motion
    • Facial Recognition
  • Alarm
    • Windows/Door
    • Locks
  • Music and Movies
  • Voice Control (WIP)
    • Kaldi Speech to Text
    • FA-TTS
  • Irrigation
  • IoT
    • Z-Wave
    • Zigbee
    • Insteon
    • WiFi

Let's Recap

Internet of Things

  • Devices
    • Switches
    • Lights
    • Thermostats
    • Trashcans
    • Garage Doors
  • Cloud Services
    • Wink
    • Insteon
    • Nest

Protocols

Home-Assistant.io

Integrations

Open Source

Installation

Configuration

pip3 install homeassistant
hass --open-ui
homeassistant:
  name: Home Assistant
  latitude: 39.6323225
  longitude: -105.131914
  temperature_unit: F
  time_zone: America/Denver

sun:

frontend:

Modern UX

  • Material Design
    • Reactive
    • Polymer
  • Development Mode
  • Voice Control!

History

And now...

For the Good Stuff

IoT Security

or, the Lack There-of

LiFX Bulb Leaks

  • Discovered mid 2014
  • Leaked
    • WiFi SSIDs and Passwords
    • User credentials
  • Firmware has since been updated

Marai Botnet

  • October 21, 2016
  • Targeted Dyn (Domain Name Service)
  • Effected Twitter, Github, Box, The Verge, Playstation Network
  • Devices Infected
    • Routers
    • IP Web Cameras
  • https://github.com/jgamblin/Mirai-Source-Code

Hue Worm

  • November, 2016
  • Weizmann Institute of Science, Israel 
  • Proof of Concept for Zigbee protocol
  • Researchers flickered lights on an off
  • Who cares about lights flickering?
    • Epileptics
  • They were able to access the 2.4Ghz test mode and interfere with nearby WiFi networks

Leet Botnet

  • December 21, 2016
  • Targeted Imperva (Cyber Security Company)
  • First Wave: 400 Gbps, 20 minutes
  • Second Wave: 650 Gbps, 17 minutes

Why??

Device Manufacturers

The Users

Minimizing Risk

Say no to WiFi IoT

PROS

  • Attackers must be located physically near your devices
  • Wired protocols require attackers to be physically plugged in to your house
  • No app to set up the device

CONS

  • RF protocols are still vulnerable to attacks
  • Requires a hub or special antennae
  • No app to set up the device

But, I need my WiFi Iot

  • Firewall
    • OpenWRT, DD-WRT, PFSense
    • Block ALL traffic in or out
    • Explicitly allow only necessary
      • Ports
      • Source/Destination IPs
  • VLAN or Separate Network
    • Infected devices are isolated
    • No sensitive data to get
  • Do nothing and hope for the best

Home-Assistant.io

What's New?

BUTT LOADS!

  • Image Processing
    • License Plate Readers
    • Facial Detection
    • Facial Recognition
    • Custom Classifiers
  • Built in Zigbee Support
  • Spotify
  • Ikea Tradfri
  • UI Themes
  • Python Scripts
  • UI Trigger Editor
  • HASS.io
  • Android Webcams
    • Motion Sensor
    • Sound Sensor
    • Light Sensor
  • Vacuums
    • Neato
    • Xiaomi
  • Voice Assistants
    • Google Home
    • Snips.AI
  • Persistent States

Appdaemon

Automation Your Way

The Appdaemon

  • Runs next to Home Assistant
  • Coded entirely in Python
  • Import any library you want
  • Built in dashboards

Notify When Door is Open

import appdaemon.appapi as appapi


class DoorNotification(appapi.AppDaemon):

  def initialize(self):
    if "sensor" in self.args:
      for sensor in self.split_device_list(self.args["sensor"]):
        self.listen_state(self.state_change, sensor)
    else:
      self.listen_state(self.motion, "binary_sensor")   
    
  def state_change(self, entity, attribute, old, new, kwargs):
    if new == "on" or new == "open":
      state = "open"
    else:
      state = "closed"
    self.log("{} is {}".format(self.friendly_name(entity), state))
    self.notify("{} is {}".format(self.friendly_name(entity), state),
                                  name="ios")

Dashboards

Voice Assistants

Your Choice

Mycroft.ai

Open Source Voice Assistant

Skills

Built-in

  • Weather
  • Wikipedia
  • Wolfram Alpha
  • NPR
  • Alarms
  • Reminders
  • Recording
  • Parroting

Home Assistant

  • Lights
  • Switches
  • Sensors
  • Device Trackers
  • Automations
  • Scripts

https://github.com/MycroftAI/mycroft-skills

Benefits Over Others

  • Plug into numerous speech engines
  • Can be run completely offline with right speech engines (Kaldi and FA-TTS)
  • Change the wake word
  • Add your own improvements (Example Ideas)
    • Add a server to send say commands to create an intercom system
    • Implement integrations with new devices
    • Network them together to create an immersive assistant

Snips.ai

Private-by-Design

Skills

Built-in

  • Weather
  • Movies
  • Business Search
  • Song Identification
  • Music Playback
  • IoT Control

Home Assistant

  • ALL THE THINGS!

https://github.com/snipsco

Benefits Over Others

  • Designed for off-line use and privacy first
  • Improved NLU and Intent parsing (sorta)
  • Intent builder similar to Alexa and Google Home
  • International language support
    • English
    • French
    • Spanish
    • German
    • Korean

MQTT Push Notifications

Why?

  • Avoid 3rd Parties
  • Own your delivery
  • Add any number of actions you want
  • Respond actions can be handled immediately by their respective devices, no need for extra HA code
  • Hide your HA instance behind your firewall

How

  • Create a REST notification in Home-Assistant
  • Notification calls /api/mqtt/publish
    • Retain - Sticky Message or Temporary
    • QOS - Quality of Service
    • Topic - Topic to publish to
    • Payload - Payload to send
  • Client
    • Prebuilt MQTT client apps
    • Modify existing app
    • Build your own

Questions

Resources

Home Assitant

http://home-assistant.io

Home Assistant Help Chat Room

https://discord.gg/c5DvZ4e

Mycroft.ai Docs

https://docs.mycroft.ai/

Firewall Setup

https://www.dd-wrt.com/wiki/index.php/Firewall

https://wiki.openwrt.org/doc/uci/firewall

PFSense Docs

https://doc.pfsense.org/index.php/Main_Page

Made with Slides.com