diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000000000000000000000000000000000000..4bba87e2c98ba2cda3e419bcfe5095965f0937cb
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,37 @@
+[run]
+source = homeassistant
+
+omit =
+    homeassistant/external/*
+    homeassistant/__main__
+
+    # omit pieces of code that rely on external devices being present
+    homeassistant/components/wink.py
+    homeassistant/components/*/wink.py
+    homeassistant/components/zwave.py
+    homeassistant/components/*/zwave.py
+    homeassistant/components/*/tellstick.py
+    homeassistant/components/*/wemo.py
+    homeassistant/components/thermostat/nest.py
+    homeassistant/components/light/hue.py
+    homeassistant/components/sensor/systemmonitor.py
+    homeassistant/components/notify/pushbullet.py
+    homeassistant/components/media_player/cast.py
+    homeassistant/components/device_tracker/luci.py
+    homeassistant/components/device_tracker/tomato.py
+    homeassistant/components/device_tracker/netgear.py
+    homeassistant/components/device_tracker/nmap_tracker.py
+
+
+[report]
+# Regexes for lines to exclude from consideration
+exclude_lines =
+    # Have to re-enable the standard pragma
+    pragma: no cover
+
+    # Don't complain about missing debug-only code:
+    def __repr__
+
+    # Don't complain if tests don't hit defensive assertion code:
+    raise AssertionError
+    raise NotImplementedError
diff --git a/.travis.yml b/.travis.yml
index b9427d41b24aa7adaac453e587a5108627cb87a1..d8632860c2a47ce20ba2322c48cf1bc1e24feabf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,6 @@ install:
 script:
   - flake8 homeassistant --exclude bower_components,external
   - pylint homeassistant
-  - coverage run --source=homeassistant --omit "homeassistant/external/*" -m unittest discover tests
+  - coverage run -m unittest discover tests
 after_success:
   - coveralls