diff --git a/atom.xml b/atom.xml index a48ac3c69b..fa9c5f9c72 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ @@ -13,6 +13,183 @@ Octopress + + <![CDATA[ESP8266 and MicroPython - Part 1]]> + + 2016-07-28T04:00:00+00:00 + https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1 +
+The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The documentation covers a lot of ground. This post is providing only a little summary which should get you started.

+ +

Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for download.

+ + + +

The easiest way is to use esptool.py for firmware handling tasks. First erase the flash:

+ +
+
$ sudo python esptool.py --port /dev/ttyUSB0 erase_flash
+esptool.py v1.0.2-dev
+Connecting...
+Erasing flash (this may take a while)...
+
+
+
+ +

and then load the firmware. You may adjust the file name of the firmware binary.

+ +
+
$ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin
+esptool.py v1.2-dev
+Connecting...
+Running Cesanta flasher stub...
+Flash params set to 0x0020
+Writing 540672 @ 0x0... 540672 (100 %)
+Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)...
+Leaving...
+
+
+
+ +

Now reset the device. You should then be able to use the REPL (Read Evaluate Print Loop). On Linux there is minicom or picocom, on a Mac you can use screen (eg. screen /dev/tty.SLAB_USBtoUART 115200), and on Windows there is Putty to open a serial connection and get the REPL prompt.

+ +

The WebREPL work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at http://micropython.org/webrepl. Alternatively, you can create a local clone of their GitHub repository. This is neccessary if your want to use the command-line tool webrepl_cli.py which is mentionend later in this post.

+ +
+
$ sudo minicom -D /dev/ttyUSB0
+#4 ets_task(4020e374, 29, 3fff70e8, 10)                                                          
+WebREPL daemon started on ws://192.168.4.1:8266
+Started webrepl in setup mode
+could not open file 'main.py' for reading
+
+#5 ets_task(4010035c, 3, 3fff6360, 4)
+MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266
+Type "help()" for more information.
+>>> 
+
+
+
+ +

+The public build of the firmware may be different than the firmware distributed to the backers of the campaign. Especially in regard of the available modules, turned on debug messages, and alike. Also, the WebREPL may not be started by default. +

+ +

Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.

+ +
+
>>> import machine
+>>> pin = machine.Pin(5, machine.Pin.OUT)
+>>> pin.high()
+
+
+
+ +

You can toogle the LED by changing its state with pin.high() and pin.low().

+ +

Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.

+ +
+
>>> import machine
+>>> brightness = machine.ADC(0)
+>>> brightness.read()
+
+
+
+ +

Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.

+ +

Read the instructions about how to setup your wireless connection. Basically you need to upload a boot.py file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the documentation.

+ +
+
def do_connect():
+    import network
+
+    SSID = 'SSID'
+    PASSWORD = 'PASSWORD'
+
+    sta_if = network.WLAN(network.STA_IF)
+    ap_if = network.WLAN(network.AP_IF)
+    if ap_if.active():
+        ap_if.active(False)
+    if not sta_if.isconnected():
+        print('connecting to network...')
+        sta_if.active(True)
+        sta_if.connect(SSID, PASSWORD)
+        while not sta_if.isconnected():
+            pass
+    print('Network configuration:', sta_if.ifconfig())
+
+
+
+ +

Upload this file with webrepl_cli.py or the WebREPL:

+ +
+
$ python webrepl_cli.py boot.py 192.168.4.1:/boot.py
+
+
+
+ +

If you reboot, you should see your current IP address in the terminal.

+ +
+
>>> Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1')
+
+
+
+ +

First let’s create a little consumer for Home Assistant sensor’s state. The code to place in main.py is a mixture of code from above and the RESTful API of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.

+ +

+If a module is missing then you need to download is it from MicroPython Library overview and upload it to the ESP8266 with webrepl_cli.py manually. +

+ +
+
# Sample code to request the state of a Home Assistant entity.
+
+API_PASSWORD = 'YOUR_PASSWORD'
+URL = 'http://10.100.0.197:8123/api/states/'
+ENTITY = 'sensor.kitchen_temperature'
+TIMEOUT = 30
+PIN = 5
+
+def get_data():
+    import urequests
+    url = '{}{}'.format(URL, ENTITY)
+    headers = {'x-ha-access': API_PASSWORD,
+               'content-type': 'application/json'}
+    resp = urequests.get(URL, headers=headers)
+    return resp.json()['state']
+
+def main():
+    import machine
+    import time
+
+    pin = machine.Pin(PIN, machine.Pin.OUT)
+    while True:
+        try:
+            if int(get_data()) >= 20:
+                pin.high()
+            else:
+                pin.low()
+        except TypeError:
+            pass
+        time.sleep(TIMEOUT)
+
+if __name__ == '__main__':
+    print('Get the state of {}'.format(ENTITY))
+    main()
+
+
+
+ +

Upload main.py the same way as boot.py. After a reboot (>>> import machine and >>> machine.reboot()) or power-cycling your physical notifier is ready.

+ +

If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter >>> import webrepl and >>> webrepl.start(), and upload your fixed file.

+ +]]>
+
+ <![CDATA[IoT Data Exploration with Jupyter Notebooks]]> @@ -235,10 +412,10 @@ $ hass --script db_migrator --config /path/to/config
  • Media Player: Plex will no longer spam the logs if server goes offline (@dale3h)
  • Sensor: APCUPSd Sensor now supports names, icons and units (@dale3h)
  • Lock: Verisure entities will now use name instead of serial number for entity id (@turbokongen)
  • -
  • [StatsD] can now also export attributes (@bah2830)
  • +
  • StatsD can now also export attributes (@bah2830)
  • Support for KNX added (@usul27)
  • Switch: TPLink HS100/HS110 now supported (@GadgetReactor)
  • -
  • Stability fixes for [RFXTRX] ([@Danielhiversen])
  • +
  • Stability fixes for RFXtrx (@Danielhiversen)
  • Tweaks to Z-Wave (@turbokongen)
  • Light: Brightness now clamped to 0-255 (@keatontaylor)
  • Thermostat: Radiotherm HVAC mode now supported (@danieljkemp)
  • @@ -1317,41 +1494,6 @@ For example, my wife works next door - and I couldn’t detect whether she’s a -]]> -
    - - - <![CDATA[To Infinity and Beyond 🚀]]> - - 2016-04-19T05:44:00+00:00 - https://home-assistant.io/blog/2016/04/19/to-infinity-and-beyond - After 2.5 years I think we can proudly say: Home Assistant is a success. I write we because Home Assistant is no longer a one-person side project. It has become the side project of many people who spend countless hours on making Home Assistant the best home automation software out there. To acknowledge this we migrated the repositories from being under my name to be under our own organisation on GitHub.

    - -

    On our journey we’ve reached many noteworthy milestones:

    - -
      -
    • #1 on HackerNews
    • -
    • Featured on ProductHunt
    • -
    • Trending repository on GitHub
    • -
    • 3000 stars on GitHub
    • -
    • 1.5 million page views on our website
    • -
    • Speaker at OpenIoT Summit 2016
    • -
    - -

    All these accomplishments are a nice pat on the back but our journey is far from over. There are a lot of challenges ahead if we want to become the go to solution for home automation for everyone.

    - -

    Until now the focus has been on making a platform that developers love to use. A platform that is simple but customizable. A platform that is both powerful and reliable. But most important: a platform that is local and open. Home Assistant does a great job at all these things.

    - -

    There will be some major challenges ahead of us to target groups other than developers. Easy installation and easy configuration being the #1. I’m sure that we’ll be able to eventually achieve these goals. I can’t say yet how or when. As with everything Home Assistant, we’ll take tiny steps, gathering feedback along the way to make sure we’re solving the right problems.

    - -

    I am confident that we will get there because we are set up for success: we have a robust architecture, high test coverage and an active community of world class developers and users. On top of that, we use Python which allows us to move fast and tackle complex problems in elegant ways. It is so easy to learn that it allows any programmer, experienced or not, to contribute support for devices and services. It’s as simple as filling in the blanks.

    - -

    I would like to put out a big thank you to all our contributors who make Home Assistant what it is today. It doesn’t matter if it is form of code, documentation or giving support in our chat room or forums. You. all. rock.

    - -

    Cheers to the future!

    - -

    Paulus

    - ]]>
    diff --git a/blog/2014/12/18/website-launched/index.html b/blog/2014/12/18/website-launched/index.html index 61f2bf3ff2..5510f89fb5 100644 --- a/blog/2014/12/18/website-launched/index.html +++ b/blog/2014/12/18/website-launched/index.html @@ -179,6 +179,12 @@ diff --git a/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html b/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html index 57b00b547d..deff14b799 100644 --- a/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html +++ b/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html @@ -234,6 +234,12 @@ This article will try to explain how they all relate.

    diff --git a/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html b/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html index 2f44e4ae01..d6725ab489 100644 --- a/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html +++ b/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html @@ -218,6 +218,12 @@ api_key=ABCDEFGHJKLMNOPQRSTUVXYZ diff --git a/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html b/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html index 532b0c05c2..ea8d33e87e 100644 --- a/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html +++ b/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html @@ -193,6 +193,12 @@ diff --git a/blog/2015/01/13/nest-in-da-house/index.html b/blog/2015/01/13/nest-in-da-house/index.html index 859717fafc..f5ca76ea53 100644 --- a/blog/2015/01/13/nest-in-da-house/index.html +++ b/blog/2015/01/13/nest-in-da-house/index.html @@ -196,6 +196,12 @@ password=YOUR_PASSWORD diff --git a/blog/2015/01/24/release-notes/index.html b/blog/2015/01/24/release-notes/index.html index 5683d8e55d..45fe717fba 100644 --- a/blog/2015/01/24/release-notes/index.html +++ b/blog/2015/01/24/release-notes/index.html @@ -202,6 +202,12 @@ Home Assistant now supports --open-ui and --demo-mode diff --git a/blog/2015/02/08/looking-at-the-past/index.html b/blog/2015/02/08/looking-at-the-past/index.html index 4a6ea426bc..3bfaee60bc 100644 --- a/blog/2015/02/08/looking-at-the-past/index.html +++ b/blog/2015/02/08/looking-at-the-past/index.html @@ -210,6 +210,12 @@ Events are saved in a local database. Google Graphs is used to draw the graph. D diff --git a/blog/2015/02/24/streaming-updates/index.html b/blog/2015/02/24/streaming-updates/index.html index 99e85a2ec3..2ea939c6ca 100644 --- a/blog/2015/02/24/streaming-updates/index.html +++ b/blog/2015/02/24/streaming-updates/index.html @@ -195,6 +195,12 @@ diff --git a/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html b/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html index 6777f380a5..46cce257e8 100644 --- a/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html +++ b/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html @@ -185,6 +185,12 @@ diff --git a/blog/2015/03/08/new-logo/index.html b/blog/2015/03/08/new-logo/index.html index d79bb69564..c82d4122b0 100644 --- a/blog/2015/03/08/new-logo/index.html +++ b/blog/2015/03/08/new-logo/index.html @@ -186,6 +186,12 @@ The old logo, the new detailed logo and the new simple logo. diff --git a/blog/2015/03/11/release-notes/index.html b/blog/2015/03/11/release-notes/index.html index 217aec2318..cec21e0429 100644 --- a/blog/2015/03/11/release-notes/index.html +++ b/blog/2015/03/11/release-notes/index.html @@ -225,6 +225,12 @@ An initial version of voice control for Home Assistant has landed. The current i diff --git a/blog/2015/03/22/release-notes/index.html b/blog/2015/03/22/release-notes/index.html index d4b0994a8b..65ab69b676 100644 --- a/blog/2015/03/22/release-notes/index.html +++ b/blog/2015/03/22/release-notes/index.html @@ -262,6 +262,12 @@ I (Paulus) have contributed a scene component. A user can create scenes that cap diff --git a/blog/2015/04/25/release-notes/index.html b/blog/2015/04/25/release-notes/index.html index 3ba2fc71f3..80cfdb575d 100644 --- a/blog/2015/04/25/release-notes/index.html +++ b/blog/2015/04/25/release-notes/index.html @@ -273,6 +273,12 @@ diff --git a/blog/2015/05/09/utc-time-zone-awareness/index.html b/blog/2015/05/09/utc-time-zone-awareness/index.html index be87074570..2a18a2f0b2 100644 --- a/blog/2015/05/09/utc-time-zone-awareness/index.html +++ b/blog/2015/05/09/utc-time-zone-awareness/index.html @@ -208,6 +208,12 @@ diff --git a/blog/2015/05/14/release-notes/index.html b/blog/2015/05/14/release-notes/index.html index 0986039c19..014f1c1e94 100644 --- a/blog/2015/05/14/release-notes/index.html +++ b/blog/2015/05/14/release-notes/index.html @@ -300,6 +300,12 @@ Before diving into the newly supported devices and services, I want to highlight diff --git a/blog/2015/06/10/release-notes/index.html b/blog/2015/06/10/release-notes/index.html index 51a3226491..55904b54aa 100644 --- a/blog/2015/06/10/release-notes/index.html +++ b/blog/2015/06/10/release-notes/index.html @@ -353,6 +353,12 @@ This switch platform allows you to control your motion detection setting on your diff --git a/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html b/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html index 3978afc124..5f432530da 100644 --- a/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html +++ b/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html @@ -305,6 +305,12 @@ Fabian has added support for Forecast.io to g diff --git a/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html b/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html index 72693a2aa9..572be35b6d 100644 --- a/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html +++ b/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html @@ -294,6 +294,12 @@ Support for Temper temperature sensors has been contributed by +
  • + ESP8266 and MicroPython - Part 1 +
  • + + +
  • IoT Data Exploration with Jupyter Notebooks
  • @@ -317,12 +323,6 @@ Support for Temper temperature sensors has been contributed by - 0.23: Envisalink, Homematic, HDMI-CEC and Sony Bravia TV - - - diff --git a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html index 8b019ef49e..f15713336e 100644 --- a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html +++ b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html @@ -204,6 +204,12 @@ diff --git a/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html b/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html index 20bc4274a4..1fa9911e61 100644 --- a/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html +++ b/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html @@ -317,6 +317,12 @@ The automation and script syntax here is using a deprecated and no longer suppor diff --git a/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html b/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html index 02f4b67aec..f8f98b121f 100644 --- a/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html +++ b/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html @@ -291,6 +291,12 @@ diff --git a/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html b/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html index 54daf32d8a..30e682ec68 100644 --- a/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html +++ b/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html @@ -494,6 +494,12 @@ PubSubClient client(ethClient); diff --git a/blog/2015/09/13/home-assistant-meets-ifttt/index.html b/blog/2015/09/13/home-assistant-meets-ifttt/index.html index dfe7e62b7f..c81f24484d 100644 --- a/blog/2015/09/13/home-assistant-meets-ifttt/index.html +++ b/blog/2015/09/13/home-assistant-meets-ifttt/index.html @@ -353,6 +353,12 @@ diff --git a/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html b/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html index 191e89917c..23a9d97413 100644 --- a/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html +++ b/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html @@ -254,6 +254,12 @@ Glances web server started on http://0.0.0.0:61208/ diff --git a/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html b/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html index 3616732ef7..3c60925123 100644 --- a/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html +++ b/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html @@ -233,6 +233,12 @@ Automation has gotten a lot of love. It now supports conditions, multiple trigge diff --git a/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html b/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html index 01077fa906..0c54230128 100644 --- a/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html +++ b/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html @@ -209,6 +209,12 @@ Map in Home Assistant showing two people and three zones (home, school, work) diff --git a/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html b/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html index d16b0d53ea..78dc4bbf04 100644 --- a/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html +++ b/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html @@ -553,6 +553,12 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000(); diff --git a/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html b/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html index 6811d3f0e6..f6dda5f18b 100644 --- a/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html +++ b/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html @@ -198,6 +198,12 @@ diff --git a/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html b/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html index c5ff4ade3f..c261675b36 100644 --- a/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html +++ b/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html @@ -220,6 +220,12 @@ This makes more sense as most people run Home Assistant as a daemon

    diff --git a/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html b/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html index ec38ea4cc7..160776f1d9 100644 --- a/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html +++ b/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html @@ -216,6 +216,12 @@ diff --git a/blog/2015/11/22/survey-november-2015/index.html b/blog/2015/11/22/survey-november-2015/index.html index 944f490cf5..50ab9c6f7a 100644 --- a/blog/2015/11/22/survey-november-2015/index.html +++ b/blog/2015/11/22/survey-november-2015/index.html @@ -256,6 +256,12 @@ diff --git a/blog/2015/12/05/community-highlights/index.html b/blog/2015/12/05/community-highlights/index.html index 17c56412bf..9d494f67cf 100644 --- a/blog/2015/12/05/community-highlights/index.html +++ b/blog/2015/12/05/community-highlights/index.html @@ -191,6 +191,12 @@ diff --git a/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html b/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html index 3bc297fa04..07597acd54 100644 --- a/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html +++ b/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html @@ -198,6 +198,12 @@ diff --git a/blog/2015/12/07/influxdb-and-grafana/index.html b/blog/2015/12/07/influxdb-and-grafana/index.html index fe08d54461..cae9e02841 100644 --- a/blog/2015/12/07/influxdb-and-grafana/index.html +++ b/blog/2015/12/07/influxdb-and-grafana/index.html @@ -289,6 +289,12 @@ $ sudo systemctl status grafana-server diff --git a/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html b/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html index 8d84385808..91061bb95f 100644 --- a/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html +++ b/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html @@ -239,6 +239,12 @@ requests.get(' +
  • + ESP8266 and MicroPython - Part 1 +
  • + + +
  • IoT Data Exploration with Jupyter Notebooks
  • @@ -262,12 +268,6 @@ requests.get(' - 0.23: Envisalink, Homematic, HDMI-CEC and Sony Bravia TV - - - diff --git a/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html b/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html index 917a75e2f1..6399cb6810 100644 --- a/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html +++ b/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html @@ -211,6 +211,12 @@ Philips Hue FAQ entries regarding 3rd party light bulbs. diff --git a/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html b/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html index 4f9995ddb3..353eacde61 100644 --- a/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html +++ b/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html @@ -278,6 +278,12 @@ sudo docker run -it --rm -p 80:80 --name certbot \ diff --git a/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html b/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html index d5b2f6231e..4387a7e262 100644 --- a/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html +++ b/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html @@ -232,6 +232,12 @@ diff --git a/blog/2016/01/17/extended-support-for-diy-solutions/index.html b/blog/2016/01/17/extended-support-for-diy-solutions/index.html index 3da6046650..9dbfed7b55 100644 --- a/blog/2016/01/17/extended-support-for-diy-solutions/index.html +++ b/blog/2016/01/17/extended-support-for-diy-solutions/index.html @@ -212,6 +212,12 @@ diff --git a/blog/2016/01/19/perfect-home-automation/index.html b/blog/2016/01/19/perfect-home-automation/index.html index cdd048736c..ec37fb80ef 100644 --- a/blog/2016/01/19/perfect-home-automation/index.html +++ b/blog/2016/01/19/perfect-home-automation/index.html @@ -216,6 +216,12 @@ diff --git a/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html b/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html index 4ce9274f76..97fa7f5fef 100644 --- a/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html +++ b/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html @@ -218,6 +218,12 @@ Example of the new views in the frontend. Learn mor diff --git a/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html b/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html index 2846690db0..fb9ed3bafa 100644 --- a/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html +++ b/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html @@ -405,6 +405,12 @@ Z-Wave light bulb | diff --git a/blog/2016/02/12/classifying-the-internet-of-things/index.html b/blog/2016/02/12/classifying-the-internet-of-things/index.html index 652a732336..1f65380808 100644 --- a/blog/2016/02/12/classifying-the-internet-of-things/index.html +++ b/blog/2016/02/12/classifying-the-internet-of-things/index.html @@ -355,6 +355,12 @@ diff --git a/blog/2016/02/13/speedtest-bloomsky-splunk-and-garage-doors/index.html b/blog/2016/02/13/speedtest-bloomsky-splunk-and-garage-doors/index.html index e2eef2fd22..703e2ecabf 100644 --- a/blog/2016/02/13/speedtest-bloomsky-splunk-and-garage-doors/index.html +++ b/blog/2016/02/13/speedtest-bloomsky-splunk-and-garage-doors/index.html @@ -221,6 +221,12 @@ diff --git a/blog/2016/02/18/multi-room-audio-with-snapcast/index.html b/blog/2016/02/18/multi-room-audio-with-snapcast/index.html index bdf8a59c8e..166e632606 100644 --- a/blog/2016/02/18/multi-room-audio-with-snapcast/index.html +++ b/blog/2016/02/18/multi-room-audio-with-snapcast/index.html @@ -323,6 +323,12 @@ output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioc diff --git a/blog/2016/02/20/community-highlights/index.html b/blog/2016/02/20/community-highlights/index.html index 0b9c07999f..65646074a9 100644 --- a/blog/2016/02/20/community-highlights/index.html +++ b/blog/2016/02/20/community-highlights/index.html @@ -231,6 +231,12 @@ Hold your NFC tag against the belly of Garfield to unlock the alarm. diff --git a/blog/2016/02/27/steam-d-link-smart-plugs-and-neurio-energy-sensors/index.html b/blog/2016/02/27/steam-d-link-smart-plugs-and-neurio-energy-sensors/index.html index f170b2e8be..b6c1d36c72 100644 --- a/blog/2016/02/27/steam-d-link-smart-plugs-and-neurio-energy-sensors/index.html +++ b/blog/2016/02/27/steam-d-link-smart-plugs-and-neurio-energy-sensors/index.html @@ -220,6 +220,12 @@ diff --git a/blog/2016/03/12/z-wave-pep257-templated-service-calls/index.html b/blog/2016/03/12/z-wave-pep257-templated-service-calls/index.html index d49f9f7cb7..70a2c1c58f 100644 --- a/blog/2016/03/12/z-wave-pep257-templated-service-calls/index.html +++ b/blog/2016/03/12/z-wave-pep257-templated-service-calls/index.html @@ -226,6 +226,12 @@ player state attributes. This change affects automations, scripts and scenes. +
  • + ESP8266 and MicroPython - Part 1 +
  • + + +
  • IoT Data Exploration with Jupyter Notebooks
  • @@ -249,12 +255,6 @@ player state attributes. This change affects automations, scripts and scenes. - -
  • - 0.23: Envisalink, Homematic, HDMI-CEC and Sony Bravia TV -
  • - - diff --git a/blog/2016/03/26/embedded-mqtt-broker-uber-yamaha-growl/index.html b/blog/2016/03/26/embedded-mqtt-broker-uber-yamaha-growl/index.html index 657632d8ae..486ec7b15d 100644 --- a/blog/2016/03/26/embedded-mqtt-broker-uber-yamaha-growl/index.html +++ b/blog/2016/03/26/embedded-mqtt-broker-uber-yamaha-growl/index.html @@ -237,6 +237,12 @@ diff --git a/blog/2016/04/05/your-hub-should-be-local-and-open/index.html b/blog/2016/04/05/your-hub-should-be-local-and-open/index.html index dfd1656a77..7ce8dbc093 100644 --- a/blog/2016/04/05/your-hub-should-be-local-and-open/index.html +++ b/blog/2016/04/05/your-hub-should-be-local-and-open/index.html @@ -189,6 +189,12 @@ diff --git a/blog/2016/04/07/static-website/index.html b/blog/2016/04/07/static-website/index.html index e76377fa34..db3d0fa55a 100644 --- a/blog/2016/04/07/static-website/index.html +++ b/blog/2016/04/07/static-website/index.html @@ -195,6 +195,12 @@ diff --git a/blog/2016/04/09/onkyo-panasonic-gtfs-and-config-validation/index.html b/blog/2016/04/09/onkyo-panasonic-gtfs-and-config-validation/index.html index 140d74d3f4..fc4c0b5f6f 100644 --- a/blog/2016/04/09/onkyo-panasonic-gtfs-and-config-validation/index.html +++ b/blog/2016/04/09/onkyo-panasonic-gtfs-and-config-validation/index.html @@ -203,6 +203,12 @@ diff --git a/blog/2016/04/17/updated-documentation/index.html b/blog/2016/04/17/updated-documentation/index.html index 2eedb27344..0e6d54e365 100644 --- a/blog/2016/04/17/updated-documentation/index.html +++ b/blog/2016/04/17/updated-documentation/index.html @@ -187,6 +187,12 @@ diff --git a/blog/2016/04/19/to-infinity-and-beyond/index.html b/blog/2016/04/19/to-infinity-and-beyond/index.html index 7d334b0fa3..f4a332ffa2 100644 --- a/blog/2016/04/19/to-infinity-and-beyond/index.html +++ b/blog/2016/04/19/to-infinity-and-beyond/index.html @@ -204,6 +204,12 @@ diff --git a/blog/2016/04/20/bluetooth-lg-webos-tvs-and-roombas/index.html b/blog/2016/04/20/bluetooth-lg-webos-tvs-and-roombas/index.html index cf8023f5bf..90ba37aad3 100644 --- a/blog/2016/04/20/bluetooth-lg-webos-tvs-and-roombas/index.html +++ b/blog/2016/04/20/bluetooth-lg-webos-tvs-and-roombas/index.html @@ -222,6 +222,12 @@ diff --git a/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/index.html b/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/index.html index be8d909867..cd8798148f 100644 --- a/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/index.html +++ b/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/index.html @@ -313,6 +313,12 @@ For example, my wife works next door - and I couldn’t detect whether she’s a diff --git a/blog/2016/05/06/open-iot-summit-talk/index.html b/blog/2016/05/06/open-iot-summit-talk/index.html index 224248c6d1..84cc5a10fe 100644 --- a/blog/2016/05/06/open-iot-summit-talk/index.html +++ b/blog/2016/05/06/open-iot-summit-talk/index.html @@ -185,6 +185,12 @@ diff --git a/blog/2016/05/07/empowering-scripts-and-alexa/index.html b/blog/2016/05/07/empowering-scripts-and-alexa/index.html index a8729a1fca..d5b303f4b1 100644 --- a/blog/2016/05/07/empowering-scripts-and-alexa/index.html +++ b/blog/2016/05/07/empowering-scripts-and-alexa/index.html @@ -275,6 +275,12 @@ diff --git a/blog/2016/05/12/video-configuring-home-assistant/index.html b/blog/2016/05/12/video-configuring-home-assistant/index.html index 8f0d8843c4..68d39cca92 100644 --- a/blog/2016/05/12/video-configuring-home-assistant/index.html +++ b/blog/2016/05/12/video-configuring-home-assistant/index.html @@ -185,6 +185,12 @@ diff --git a/blog/2016/05/18/why-we-use-polymer/index.html b/blog/2016/05/18/why-we-use-polymer/index.html index ed32de13c2..0743037061 100644 --- a/blog/2016/05/18/why-we-use-polymer/index.html +++ b/blog/2016/05/18/why-we-use-polymer/index.html @@ -199,6 +199,12 @@ diff --git a/blog/2016/05/21/release-020/index.html b/blog/2016/05/21/release-020/index.html index 733547e569..d1d29f59bf 100644 --- a/blog/2016/05/21/release-020/index.html +++ b/blog/2016/05/21/release-020/index.html @@ -220,6 +220,12 @@ diff --git a/blog/2016/05/22/get-started-with-all-in-one-installer/index.html b/blog/2016/05/22/get-started-with-all-in-one-installer/index.html index db73118ffa..afda51cf76 100644 --- a/blog/2016/05/22/get-started-with-all-in-one-installer/index.html +++ b/blog/2016/05/22/get-started-with-all-in-one-installer/index.html @@ -191,6 +191,12 @@ diff --git a/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/index.html b/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/index.html index a1dc46d40d..e281257311 100644 --- a/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/index.html +++ b/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/index.html @@ -329,6 +329,12 @@ diff --git a/blog/2016/06/01/community-highlights/index.html b/blog/2016/06/01/community-highlights/index.html index 1a0d79ef89..ca0d479b4e 100644 --- a/blog/2016/06/01/community-highlights/index.html +++ b/blog/2016/06/01/community-highlights/index.html @@ -205,6 +205,12 @@ diff --git a/blog/2016/06/08/super-fast-web-enocean-lirc/index.html b/blog/2016/06/08/super-fast-web-enocean-lirc/index.html index ea508d9cad..dbe9a87e76 100644 --- a/blog/2016/06/08/super-fast-web-enocean-lirc/index.html +++ b/blog/2016/06/08/super-fast-web-enocean-lirc/index.html @@ -239,6 +239,12 @@ diff --git a/blog/2016/06/13/home-assistant-at-pycon-2016/index.html b/blog/2016/06/13/home-assistant-at-pycon-2016/index.html index d503f5015f..b0ffc71788 100644 --- a/blog/2016/06/13/home-assistant-at-pycon-2016/index.html +++ b/blog/2016/06/13/home-assistant-at-pycon-2016/index.html @@ -210,6 +210,12 @@ diff --git a/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera/index.html b/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera/index.html index f4b7224bf1..e97a7438f0 100644 --- a/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera/index.html +++ b/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera/index.html @@ -234,6 +234,12 @@ diff --git a/blog/2016/06/23/usb-webcams-and-home-assistant/index.html b/blog/2016/06/23/usb-webcams-and-home-assistant/index.html index 416daaab0f..6da72e7639 100644 --- a/blog/2016/06/23/usb-webcams-and-home-assistant/index.html +++ b/blog/2016/06/23/usb-webcams-and-home-assistant/index.html @@ -300,6 +300,12 @@ target_dir /tmp diff --git a/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv/index.html b/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv/index.html index 7bd14eee70..b13ec2ba4e 100644 --- a/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv/index.html +++ b/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv/index.html @@ -233,6 +233,12 @@ diff --git a/blog/2016/07/06/pocketchip-running-home-assistant/index.html b/blog/2016/07/06/pocketchip-running-home-assistant/index.html index bc81a18df2..3b585a76c2 100644 --- a/blog/2016/07/06/pocketchip-running-home-assistant/index.html +++ b/blog/2016/07/06/pocketchip-running-home-assistant/index.html @@ -236,6 +236,12 @@ $ hass --open-ui diff --git a/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/index.html b/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/index.html index 7a1a7512ec..b336656276 100644 --- a/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/index.html +++ b/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/index.html @@ -135,10 +135,10 @@ $ hass --script db_migrator --config /path/to/config
  • Media Player: Plex will no longer spam the logs if server goes offline (@dale3h)
  • Sensor: APCUPSd Sensor now supports names, icons and units (@dale3h)
  • Lock: Verisure entities will now use name instead of serial number for entity id (@turbokongen)
  • -
  • [StatsD] can now also export attributes (@bah2830)
  • +
  • StatsD can now also export attributes (@bah2830)
  • Support for KNX added (@usul27)
  • Switch: TPLink HS100/HS110 now supported (@GadgetReactor)
  • -
  • Stability fixes for [RFXTRX] ([@Danielhiversen])
  • +
  • Stability fixes for RFXtrx (@Danielhiversen)
  • Tweaks to Z-Wave (@turbokongen)
  • Light: Brightness now clamped to 0-255 (@keatontaylor)
  • Thermostat: Radiotherm HVAC mode now supported (@danieljkemp)
  • @@ -230,6 +230,12 @@ $ hass --script db_migrator --config /path/to/config diff --git a/blog/2016/07/19/visualizing-your-iot-data/index.html b/blog/2016/07/19/visualizing-your-iot-data/index.html index 3db8ca595f..e629df01e5 100644 --- a/blog/2016/07/19/visualizing-your-iot-data/index.html +++ b/blog/2016/07/19/visualizing-your-iot-data/index.html @@ -288,6 +288,12 @@ plt.savefig(' +
  • + ESP8266 and MicroPython - Part 1 +
  • + + +
  • IoT Data Exploration with Jupyter Notebooks
  • @@ -307,12 +313,6 @@ plt.savefig(' - 0.23: Envisalink, Homematic, HDMI-CEC and Sony Bravia TV - - - diff --git a/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/index.html b/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/index.html index 6b2c24116b..024c58e31b 100644 --- a/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/index.html +++ b/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/index.html @@ -245,6 +245,12 @@ One of the graphs created with this tutorial. diff --git a/blog/2016/07/28/esp8266-and-micropython-part1/index.html b/blog/2016/07/28/esp8266-and-micropython-part1/index.html new file mode 100644 index 0000000000..a859e3bf13 --- /dev/null +++ b/blog/2016/07/28/esp8266-and-micropython-part1/index.html @@ -0,0 +1,425 @@ + + + + + + + + + + ESP8266 and MicroPython - Part 1 - Home Assistant + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + + +
    +
    + +
    + + +
    + +
    + +

    ESP8266 and MicroPython - Part 1

    + + + +
    + + + five minutes reading time + + + + + + Comments + +
    + +
    + + +


    +The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The documentation covers a lot of ground. This post is providing only a little summary which should get you started.

    + +

    Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for download.

    + + + +

    The easiest way is to use esptool.py for firmware handling tasks. First erase the flash:

    + +
    +
    $ sudo python esptool.py --port /dev/ttyUSB0 erase_flash
    +esptool.py v1.0.2-dev
    +Connecting...
    +Erasing flash (this may take a while)...
    +
    +
    +
    + +

    and then load the firmware. You may adjust the file name of the firmware binary.

    + +
    +
    $ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin
    +esptool.py v1.2-dev
    +Connecting...
    +Running Cesanta flasher stub...
    +Flash params set to 0x0020
    +Writing 540672 @ 0x0... 540672 (100 %)
    +Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)...
    +Leaving...
    +
    +
    +
    + +

    Now reset the device. You should then be able to use the REPL (Read Evaluate Print Loop). On Linux there is minicom or picocom, on a Mac you can use screen (eg. screen /dev/tty.SLAB_USBtoUART 115200), and on Windows there is Putty to open a serial connection and get the REPL prompt.

    + +

    The WebREPL work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at http://micropython.org/webrepl. Alternatively, you can create a local clone of their GitHub repository. This is neccessary if your want to use the command-line tool webrepl_cli.py which is mentionend later in this post.

    + +
    +
    $ sudo minicom -D /dev/ttyUSB0
    +#4 ets_task(4020e374, 29, 3fff70e8, 10)                                                          
    +WebREPL daemon started on ws://192.168.4.1:8266
    +Started webrepl in setup mode
    +could not open file 'main.py' for reading
    +
    +#5 ets_task(4010035c, 3, 3fff6360, 4)
    +MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266
    +Type "help()" for more information.
    +>>> 
    +
    +
    +
    + +

    +The public build of the firmware may be different than the firmware distributed to the backers of the campaign. Especially in regard of the available modules, turned on debug messages, and alike. Also, the WebREPL may not be started by default. +

    + +

    Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.

    + +
    +
    >>> import machine
    +>>> pin = machine.Pin(5, machine.Pin.OUT)
    +>>> pin.high()
    +
    +
    +
    + +

    You can toogle the LED by changing its state with pin.high() and pin.low().

    + +

    Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.

    + +
    +
    >>> import machine
    +>>> brightness = machine.ADC(0)
    +>>> brightness.read()
    +
    +
    +
    + +

    Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.

    + +

    Read the instructions about how to setup your wireless connection. Basically you need to upload a boot.py file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the documentation.

    + +
    +
    def do_connect():
    +    import network
    +
    +    SSID = 'SSID'
    +    PASSWORD = 'PASSWORD'
    +
    +    sta_if = network.WLAN(network.STA_IF)
    +    ap_if = network.WLAN(network.AP_IF)
    +    if ap_if.active():
    +        ap_if.active(False)
    +    if not sta_if.isconnected():
    +        print('connecting to network...')
    +        sta_if.active(True)
    +        sta_if.connect(SSID, PASSWORD)
    +        while not sta_if.isconnected():
    +            pass
    +    print('Network configuration:', sta_if.ifconfig())
    +
    +
    +
    + +

    Upload this file with webrepl_cli.py or the WebREPL:

    + +
    +
    $ python webrepl_cli.py boot.py 192.168.4.1:/boot.py
    +
    +
    +
    + +

    If you reboot, you should see your current IP address in the terminal.

    + +
    +
    >>> Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1')
    +
    +
    +
    + +

    First let’s create a little consumer for Home Assistant sensor’s state. The code to place in main.py is a mixture of code from above and the RESTful API of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.

    + +

    +If a module is missing then you need to download is it from MicroPython Library overview and upload it to the ESP8266 with webrepl_cli.py manually. +

    + +
    +
    # Sample code to request the state of a Home Assistant entity.
    +
    +API_PASSWORD = 'YOUR_PASSWORD'
    +URL = 'http://10.100.0.197:8123/api/states/'
    +ENTITY = 'sensor.kitchen_temperature'
    +TIMEOUT = 30
    +PIN = 5
    +
    +def get_data():
    +    import urequests
    +    url = '{}{}'.format(URL, ENTITY)
    +    headers = {'x-ha-access': API_PASSWORD,
    +               'content-type': 'application/json'}
    +    resp = urequests.get(URL, headers=headers)
    +    return resp.json()['state']
    +
    +def main():
    +    import machine
    +    import time
    +
    +    pin = machine.Pin(PIN, machine.Pin.OUT)
    +    while True:
    +        try:
    +            if int(get_data()) >= 20:
    +                pin.high()
    +            else:
    +                pin.low()
    +        except TypeError:
    +            pass
    +        time.sleep(TIMEOUT)
    +
    +if __name__ == '__main__':
    +    print('Get the state of {}'.format(ENTITY))
    +    main()
    +
    +
    +
    + +

    Upload main.py the same way as boot.py. After a reboot (>>> import machine and >>> machine.reboot()) or power-cycling your physical notifier is ready.

    + +

    If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter >>> import webrepl and >>> webrepl.start(), and upload your fixed file.

    +
    + + +
    +

    Comments

    +
    +
    + + +
    + + + + +
    +
    + + + + + + + \ No newline at end of file diff --git a/blog/archives/index.html b/blog/archives/index.html index 81dcadaf59..331e60b99f 100644 --- a/blog/archives/index.html +++ b/blog/archives/index.html @@ -98,6 +98,38 @@

    2016

    + + + +
    @@ -2535,6 +2567,12 @@ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index e3567e0d27..28d51605b0 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/index.html b/blog/categories/community/index.html index 1da2c3c14d..bafec48852 100644 --- a/blog/categories/community/index.html +++ b/blog/categories/community/index.html @@ -268,6 +268,12 @@ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index 1b60e02d48..34be8148b4 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/index.html b/blog/categories/device-tracking/index.html index 42ed9d02cf..f64ecc1bac 100644 --- a/blog/categories/device-tracking/index.html +++ b/blog/categories/device-tracking/index.html @@ -199,6 +199,12 @@ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index f3c6490af4..e8ef57d2f9 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/index.html b/blog/categories/esp8266/index.html index 3ac3cf4456..92fa6dc7cc 100644 --- a/blog/categories/esp8266/index.html +++ b/blog/categories/esp8266/index.html @@ -199,6 +199,12 @@ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index 36db282d4e..11ebc1a644 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ @@ -13,6 +13,183 @@ Octopress + + <![CDATA[ESP8266 and MicroPython - Part 1]]> + + 2016-07-28T04:00:00+00:00 + https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1 +
    +The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The documentation covers a lot of ground. This post is providing only a little summary which should get you started.

    + +

    Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for download.

    + + + +

    The easiest way is to use esptool.py for firmware handling tasks. First erase the flash:

    + +
    +
    $ sudo python esptool.py --port /dev/ttyUSB0 erase_flash
    +esptool.py v1.0.2-dev
    +Connecting...
    +Erasing flash (this may take a while)...
    +
    +
    +
    + +

    and then load the firmware. You may adjust the file name of the firmware binary.

    + +
    +
    $ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin
    +esptool.py v1.2-dev
    +Connecting...
    +Running Cesanta flasher stub...
    +Flash params set to 0x0020
    +Writing 540672 @ 0x0... 540672 (100 %)
    +Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)...
    +Leaving...
    +
    +
    +
    + +

    Now reset the device. You should then be able to use the REPL (Read Evaluate Print Loop). On Linux there is minicom or picocom, on a Mac you can use screen (eg. screen /dev/tty.SLAB_USBtoUART 115200), and on Windows there is Putty to open a serial connection and get the REPL prompt.

    + +

    The WebREPL work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at http://micropython.org/webrepl. Alternatively, you can create a local clone of their GitHub repository. This is neccessary if your want to use the command-line tool webrepl_cli.py which is mentionend later in this post.

    + +
    +
    $ sudo minicom -D /dev/ttyUSB0
    +#4 ets_task(4020e374, 29, 3fff70e8, 10)                                                          
    +WebREPL daemon started on ws://192.168.4.1:8266
    +Started webrepl in setup mode
    +could not open file 'main.py' for reading
    +
    +#5 ets_task(4010035c, 3, 3fff6360, 4)
    +MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266
    +Type "help()" for more information.
    +>>> 
    +
    +
    +
    + +

    +The public build of the firmware may be different than the firmware distributed to the backers of the campaign. Especially in regard of the available modules, turned on debug messages, and alike. Also, the WebREPL may not be started by default. +

    + +

    Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.

    + +
    +
    >>> import machine
    +>>> pin = machine.Pin(5, machine.Pin.OUT)
    +>>> pin.high()
    +
    +
    +
    + +

    You can toogle the LED by changing its state with pin.high() and pin.low().

    + +

    Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.

    + +
    +
    >>> import machine
    +>>> brightness = machine.ADC(0)
    +>>> brightness.read()
    +
    +
    +
    + +

    Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.

    + +

    Read the instructions about how to setup your wireless connection. Basically you need to upload a boot.py file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the documentation.

    + +
    +
    def do_connect():
    +    import network
    +
    +    SSID = 'SSID'
    +    PASSWORD = 'PASSWORD'
    +
    +    sta_if = network.WLAN(network.STA_IF)
    +    ap_if = network.WLAN(network.AP_IF)
    +    if ap_if.active():
    +        ap_if.active(False)
    +    if not sta_if.isconnected():
    +        print('connecting to network...')
    +        sta_if.active(True)
    +        sta_if.connect(SSID, PASSWORD)
    +        while not sta_if.isconnected():
    +            pass
    +    print('Network configuration:', sta_if.ifconfig())
    +
    +
    +
    + +

    Upload this file with webrepl_cli.py or the WebREPL:

    + +
    +
    $ python webrepl_cli.py boot.py 192.168.4.1:/boot.py
    +
    +
    +
    + +

    If you reboot, you should see your current IP address in the terminal.

    + +
    +
    >>> Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1')
    +
    +
    +
    + +

    First let’s create a little consumer for Home Assistant sensor’s state. The code to place in main.py is a mixture of code from above and the RESTful API of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.

    + +

    +If a module is missing then you need to download is it from MicroPython Library overview and upload it to the ESP8266 with webrepl_cli.py manually. +

    + +
    +
    # Sample code to request the state of a Home Assistant entity.
    +
    +API_PASSWORD = 'YOUR_PASSWORD'
    +URL = 'http://10.100.0.197:8123/api/states/'
    +ENTITY = 'sensor.kitchen_temperature'
    +TIMEOUT = 30
    +PIN = 5
    +
    +def get_data():
    +    import urequests
    +    url = '{}{}'.format(URL, ENTITY)
    +    headers = {'x-ha-access': API_PASSWORD,
    +               'content-type': 'application/json'}
    +    resp = urequests.get(URL, headers=headers)
    +    return resp.json()['state']
    +
    +def main():
    +    import machine
    +    import time
    +
    +    pin = machine.Pin(PIN, machine.Pin.OUT)
    +    while True:
    +        try:
    +            if int(get_data()) >= 20:
    +                pin.high()
    +            else:
    +                pin.low()
    +        except TypeError:
    +            pass
    +        time.sleep(TIMEOUT)
    +
    +if __name__ == '__main__':
    +    print('Get the state of {}'.format(ENTITY))
    +    main()
    +
    +
    +
    + +

    Upload main.py the same way as boot.py. After a reboot (>>> import machine and >>> machine.reboot()) or power-cycling your physical notifier is ready.

    + +

    If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter >>> import webrepl and >>> webrepl.start(), and upload your fixed file.

    + +]]>
    +
    + <![CDATA[IoT Data Exploration with Jupyter Notebooks]]> @@ -398,32 +575,6 @@ target_dir /tmp

    motion is a powerful tool and this blog post only showed two very simple use cases. Take a look at the documentation of motion to unleash its potential.

    -]]> -
    - - - <![CDATA[Static website]]> - - 2016-04-07T06:28:00+00:00 - https://home-assistant.io/blog/2016/04/07/static-website - The frontend of Home Assistant is served with the help of a local web server. If you have customized your installation you already use this functionality. The content of your folder www in your Home Assistant configuration directory (.homeassistant) is available under /local (eg. https://localhost:8123/local).

    - -

    But there is more you can do! You can not only host images for customization there but HTML files or even web applications including CSS and Javascript.

    - -

    - -

    - - - -

    In the past the buzz word “Smart mirror” was used a couple of times in our chatroom and even made it into the issue tracker. The existing solutions (Smart mirror, MagicMirror, and HomeMirror) seems to be overkill if you already have Home Assistant running somewhere in your house or apartment. Why not simple display a web page served by Home Assistant on the tablet? No app and no Raspberry Pi running in the background.

    - -

    There are plenty of ways to achieve this…RESTful API, Python API, or one of the history components. If it is to be a web page I’m using the MQTT Eventstream component and mqttws31.js.

    - -

    The HBMQTT broker provides websockets support for MQTT and mqttws31.js included in web page gives you access to the MQTT messages. It’s a matter of minutes. OK, it took a little longer because I’m not a Javascript guy to create the software part that will show details about your environment. The source is available at https://github.com/fabaff/home-assistant-display and the screenshot above shows the result. I guess that every person who is familiar with Javascript would be able to reduce the amount of code and to make it more flexible. Well, it’s a only prototype and showcase to include an image in this blog post.

    - -

    I hope that this little article could give you an idea of extending Home Assistant in an unconventional way.

    - ]]>
    diff --git a/blog/categories/how-to/index.html b/blog/categories/how-to/index.html index 95e00e34ed..91b634448b 100644 --- a/blog/categories/how-to/index.html +++ b/blog/categories/how-to/index.html @@ -98,6 +98,38 @@

    2016

    + + + +
    @@ -628,6 +660,12 @@ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index 91fce6e9fd..1f61bdda4d 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/index.html b/blog/categories/ibeacons/index.html index d2eb886d4a..d788033377 100644 --- a/blog/categories/ibeacons/index.html +++ b/blog/categories/ibeacons/index.html @@ -235,6 +235,12 @@ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index f25771d2b3..b5806d880b 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/index.html b/blog/categories/internet-of-things/index.html index 5564083f68..3a2f0b6ee3 100644 --- a/blog/categories/internet-of-things/index.html +++ b/blog/categories/internet-of-things/index.html @@ -294,6 +294,12 @@ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index fc482e7d37..7bd1de436c 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/index.html b/blog/categories/iot-data/index.html index e85f24bfb2..d022673caa 100644 --- a/blog/categories/iot-data/index.html +++ b/blog/categories/iot-data/index.html @@ -231,6 +231,12 @@ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index 9ea981dd28..9232a83e6b 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/index.html b/blog/categories/mqtt/index.html index ae47431e7f..db89b09cf6 100644 --- a/blog/categories/mqtt/index.html +++ b/blog/categories/mqtt/index.html @@ -270,6 +270,12 @@ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index b8e7b9e29c..8bca36aca3 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/index.html b/blog/categories/organisation/index.html index 99f5cc8d01..e78aa92f06 100644 --- a/blog/categories/organisation/index.html +++ b/blog/categories/organisation/index.html @@ -230,6 +230,12 @@ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index 4d4ecedd33..2670362c92 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/index.html b/blog/categories/owntracks/index.html index 9ce0b6ab5e..eb38ffc192 100644 --- a/blog/categories/owntracks/index.html +++ b/blog/categories/owntracks/index.html @@ -235,6 +235,12 @@ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index 693a525101..8b1c807119 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/index.html b/blog/categories/presence-detection/index.html index 8bf926e8a4..41fe301c08 100644 --- a/blog/categories/presence-detection/index.html +++ b/blog/categories/presence-detection/index.html @@ -199,6 +199,12 @@ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 79191c9c0d..5b661d391d 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/index.html b/blog/categories/public-service-announcement/index.html index 597f32383a..913f2cd2fc 100644 --- a/blog/categories/public-service-announcement/index.html +++ b/blog/categories/public-service-announcement/index.html @@ -195,6 +195,12 @@ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 32ae68844a..3b0c59fdfe 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ @@ -45,10 +45,10 @@ $ hass --script db_migrator --config /path/to/config
  • Media Player: Plex will no longer spam the logs if server goes offline (@dale3h)
  • Sensor: APCUPSd Sensor now supports names, icons and units (@dale3h)
  • Lock: Verisure entities will now use name instead of serial number for entity id (@turbokongen)
  • -
  • [StatsD] can now also export attributes (@bah2830)
  • +
  • StatsD can now also export attributes (@bah2830)
  • Support for KNX added (@usul27)
  • Switch: TPLink HS100/HS110 now supported (@GadgetReactor)
  • -
  • Stability fixes for [RFXTRX] ([@Danielhiversen])
  • +
  • Stability fixes for RFXtrx (@Danielhiversen)
  • Tweaks to Z-Wave (@turbokongen)
  • Light: Brightness now clamped to 0-255 (@keatontaylor)
  • Thermostat: Radiotherm HVAC mode now supported (@danieljkemp)
  • diff --git a/blog/categories/release-notes/index.html b/blog/categories/release-notes/index.html index de0e654213..6aa4408fe5 100644 --- a/blog/categories/release-notes/index.html +++ b/blog/categories/release-notes/index.html @@ -1416,6 +1416,12 @@ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index f6e7fcece0..a14038385b 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/index.html b/blog/categories/survey/index.html index 24f3fcf9d5..1e87eb130d 100644 --- a/blog/categories/survey/index.html +++ b/blog/categories/survey/index.html @@ -195,6 +195,12 @@ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index 65d156bc51..5cc4c0bb48 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/index.html b/blog/categories/talks/index.html index 3305be0e1c..46cecaaeb5 100644 --- a/blog/categories/talks/index.html +++ b/blog/categories/talks/index.html @@ -197,6 +197,12 @@ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 52e8c9bd57..8efe933d4f 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/index.html b/blog/categories/technology/index.html index b0d345821c..872c7b9499 100644 --- a/blog/categories/technology/index.html +++ b/blog/categories/technology/index.html @@ -195,6 +195,12 @@ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index adaa0c5c11..a8891544b9 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/index.html b/blog/categories/user-stories/index.html index c73e4aee2b..cc1a7d93d3 100644 --- a/blog/categories/user-stories/index.html +++ b/blog/categories/user-stories/index.html @@ -195,6 +195,12 @@ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index 955d3cf333..dbbee9022a 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/index.html b/blog/categories/video/index.html index 126353e3c6..ff5867914a 100644 --- a/blog/categories/video/index.html +++ b/blog/categories/video/index.html @@ -398,6 +398,12 @@ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index b145a0ea80..9613b8c9af 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2016-07-27T21:33:06+00:00 + 2016-07-28T06:23:19+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/index.html b/blog/categories/website/index.html index ee2e4e82d0..65e898070d 100644 --- a/blog/categories/website/index.html +++ b/blog/categories/website/index.html @@ -230,6 +230,12 @@ diff --git a/blog/index.html b/blog/index.html index f45d83a438..f7b35fb33a 100644 --- a/blog/index.html +++ b/blog/index.html @@ -78,6 +78,53 @@ +
    +
    + +

    + ESP8266 and MicroPython - Part 1 +

    + + + +
    + + + five minutes reading time + + + + + + Comments + +
    + +
    + + +
    +


    +The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The documentation covers a lot of ground. This post is providing only a little summary which should get you started.

    + +

    Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for download.

    + + + + Read on → + +
    +
    +
    +
    @@ -252,10 +299,10 @@ $ hass --script db_migrator --config /path/to/config
  • Media Player: Plex will no longer spam the logs if server goes offline (@dale3h)
  • Sensor: APCUPSd Sensor now supports names, icons and units (@dale3h)
  • Lock: Verisure entities will now use name instead of serial number for entity id (@turbokongen)
  • -
  • [StatsD] can now also export attributes (@bah2830)
  • +
  • StatsD can now also export attributes (@bah2830)
  • Support for KNX added (@usul27)
  • Switch: TPLink HS100/HS110 now supported (@GadgetReactor)
  • -
  • Stability fixes for [RFXTRX] ([@Danielhiversen])
  • +
  • Stability fixes for RFXtrx (@Danielhiversen)
  • Tweaks to Z-Wave (@turbokongen)
  • Light: Brightness now clamped to 0-255 (@keatontaylor)
  • Thermostat: Radiotherm HVAC mode now supported (@danieljkemp)
  • @@ -724,74 +771,6 @@ In the past month I was thinking about ways to integrate USB webcams into Home A -
    -
    -
    - -
    -
    - -

    - Community Highlights -

    - - - -
    - - - 1 minute reading time - - - - - - Comments - -
    - -
    - - -
    -

    Our community is amazingly helpful and creative. If you haven’t been there yet, make sure to stop by our chat room and come hang out with us. In this blog post I want to highlight a few recent awesome projects and videos from the community.

    - -

    SceneGen - cli for making scenes

    - -

    SceneGen is a new command line utility developed by Andrew Cockburn that helps with creating scene configurations for Home Assistant. To use it, you put your house in the preferred state, run SceneGen and it will print the scene configuration for your current states.

    - -

    Videos

    - -

    Nick Touran has been working on integrating IR remotes with Home Assistant. He made it into a component which should be available in the next release which should arrive in a couple of days. In the meanwhile, he wrote up a blog post and has put out a video showing the new integration, very cool!

    - -
    - -
    - -

    Ben from BRUH Automation has put out another great video how to get started tracking your location in Home Assistant using MQTT and OwnTracks.

    - -
    - -
    - -

    Muhammed Kilic has created a video how to make your Home Assistant instance accessible from the internet using the free dynamic DNS service DuckDNS.

    - -
    - -
    - - -

    diff --git a/blog/posts/2/index.html b/blog/posts/2/index.html index b2f7dcf6eb..7fb4bd4dfb 100644 --- a/blog/posts/2/index.html +++ b/blog/posts/2/index.html @@ -78,6 +78,74 @@ +
    +
    + +

    + Community Highlights +

    + + + +
    + + + 1 minute reading time + + + + + + Comments + +
    + +
    + + +
    +

    Our community is amazingly helpful and creative. If you haven’t been there yet, make sure to stop by our chat room and come hang out with us. In this blog post I want to highlight a few recent awesome projects and videos from the community.

    + +

    SceneGen - cli for making scenes

    + +

    SceneGen is a new command line utility developed by Andrew Cockburn that helps with creating scene configurations for Home Assistant. To use it, you put your house in the preferred state, run SceneGen and it will print the scene configuration for your current states.

    + +

    Videos

    + +

    Nick Touran has been working on integrating IR remotes with Home Assistant. He made it into a component which should be available in the next release which should arrive in a couple of days. In the meanwhile, he wrote up a blog post and has put out a video showing the new integration, very cool!

    + +
    + +
    + +

    Ben from BRUH Automation has put out another great video how to get started tracking your location in Home Assistant using MQTT and OwnTracks.

    + +
    + +
    + +

    Muhammed Kilic has created a video how to make your Home Assistant instance accessible from the internet using the free dynamic DNS service DuckDNS.

    + +
    + +
    + + + +
    +
    +
    +
    @@ -701,73 +769,6 @@ -
    -
    -
    - -
    -
    - -

    - To Infinity and Beyond 🚀 -

    - - - -
    - - - two minutes reading time - - - - - - Comments - -
    - -
    - - -
    -

    After 2.5 years I think we can proudly say: Home Assistant is a success. I write we because Home Assistant is no longer a one-person side project. It has become the side project of many people who spend countless hours on making Home Assistant the best home automation software out there. To acknowledge this we migrated the repositories from being under my name to be under our own organisation on GitHub.

    - -

    On our journey we’ve reached many noteworthy milestones:

    - -
      -
    • #1 on HackerNews
    • -
    • Featured on ProductHunt
    • -
    • Trending repository on GitHub
    • -
    • 3000 stars on GitHub
    • -
    • 1.5 million page views on our website
    • -
    • Speaker at OpenIoT Summit 2016
    • -
    - -

    All these accomplishments are a nice pat on the back but our journey is far from over. There are a lot of challenges ahead if we want to become the go to solution for home automation for everyone.

    - -

    Until now the focus has been on making a platform that developers love to use. A platform that is simple but customizable. A platform that is both powerful and reliable. But most important: a platform that is local and open. Home Assistant does a great job at all these things.

    - -

    There will be some major challenges ahead of us to target groups other than developers. Easy installation and easy configuration being the #1. I’m sure that we’ll be able to eventually achieve these goals. I can’t say yet how or when. As with everything Home Assistant, we’ll take tiny steps, gathering feedback along the way to make sure we’re solving the right problems.

    - -

    I am confident that we will get there because we are set up for success: we have a robust architecture, high test coverage and an active community of world class developers and users. On top of that, we use Python which allows us to move fast and tackle complex problems in elegant ways. It is so easy to learn that it allows any programmer, experienced or not, to contribute support for devices and services. It’s as simple as filling in the blanks.

    - -

    I would like to put out a big thank you to all our contributors who make Home Assistant what it is today. It doesn’t matter if it is form of code, documentation or giving support in our chat room or forums. You. all. rock.

    - -

    Cheers to the future!

    - -

    Paulus

    - - -

    diff --git a/blog/posts/3/index.html b/blog/posts/3/index.html index a6c9adeaef..ee4038cb6a 100644 --- a/blog/posts/3/index.html +++ b/blog/posts/3/index.html @@ -78,6 +78,73 @@ +
    +
    + +

    + To Infinity and Beyond 🚀 +

    + + + +
    + + + two minutes reading time + + + + + + Comments + +
    + +
    + + +
    +

    After 2.5 years I think we can proudly say: Home Assistant is a success. I write we because Home Assistant is no longer a one-person side project. It has become the side project of many people who spend countless hours on making Home Assistant the best home automation software out there. To acknowledge this we migrated the repositories from being under my name to be under our own organisation on GitHub.

    + +

    On our journey we’ve reached many noteworthy milestones:

    + +
      +
    • #1 on HackerNews
    • +
    • Featured on ProductHunt
    • +
    • Trending repository on GitHub
    • +
    • 3000 stars on GitHub
    • +
    • 1.5 million page views on our website
    • +
    • Speaker at OpenIoT Summit 2016
    • +
    + +

    All these accomplishments are a nice pat on the back but our journey is far from over. There are a lot of challenges ahead if we want to become the go to solution for home automation for everyone.

    + +

    Until now the focus has been on making a platform that developers love to use. A platform that is simple but customizable. A platform that is both powerful and reliable. But most important: a platform that is local and open. Home Assistant does a great job at all these things.

    + +

    There will be some major challenges ahead of us to target groups other than developers. Easy installation and easy configuration being the #1. I’m sure that we’ll be able to eventually achieve these goals. I can’t say yet how or when. As with everything Home Assistant, we’ll take tiny steps, gathering feedback along the way to make sure we’re solving the right problems.

    + +

    I am confident that we will get there because we are set up for success: we have a robust architecture, high test coverage and an active community of world class developers and users. On top of that, we use Python which allows us to move fast and tackle complex problems in elegant ways. It is so easy to learn that it allows any programmer, experienced or not, to contribute support for devices and services. It’s as simple as filling in the blanks.

    + +

    I would like to put out a big thank you to all our contributors who make Home Assistant what it is today. It doesn’t matter if it is form of code, documentation or giving support in our chat room or forums. You. all. rock.

    + +

    Cheers to the future!

    + +

    Paulus

    + + + +
    +
    +
    +
    @@ -710,90 +777,6 @@ Hold your NFC tag against the belly of Garfield to unlock the alarm. Read on → - -
    -
    - -
    -
    - -

    - 0.13: Speedtest.net, Bloomsky, Splunk and Garage Doors -

    - - - -
    - - - two minutes reading time - - - - - - Comments - -
    - -
    - - -
    -

    The focus of 0.13 was on test coverage, big cheers to @rmkraus for his hard work on this. I’m proud to announce that we’ve hit the 90% test coverage of the core + important components. A big milestone for the project.

    - -

    - - Examples of the new input_select and weblink components. -

    - -

    Not only did we gain a lot of test coverage, we also attracted a lot of new developers that contributed a variety of components and platforms:

    - -

    - - - - -

    diff --git a/blog/posts/4/index.html b/blog/posts/4/index.html index dc6ebc4b81..474defaab6 100644 --- a/blog/posts/4/index.html +++ b/blog/posts/4/index.html @@ -78,6 +78,90 @@ +
    +
    + +

    + 0.13: Speedtest.net, Bloomsky, Splunk and Garage Doors +

    + + + +
    + + + two minutes reading time + + + + + + Comments + +
    + +
    + + +
    +

    The focus of 0.13 was on test coverage, big cheers to @rmkraus for his hard work on this. I’m proud to announce that we’ve hit the 90% test coverage of the core + important components. A big milestone for the project.

    + +

    + + Examples of the new input_select and weblink components. +

    + +

    Not only did we gain a lot of test coverage, we also attracted a lot of new developers that contributed a variety of components and platforms:

    + +

    + + + + + +
    +
    +
    +
    @@ -657,53 +741,6 @@ In this tutorial I will explain how you can activate Tasker tasks from Home Assi

    -
    -
    - -

    - InfluxDB and Grafana -

    - - - -
    - - - two minutes reading time - - - - - - Comments - -
    - -
    - - -
    -


    -The InfluxDB database is a so-called time series database primarly designed to store sensor data and real-time analytics.

    - -

    The influxdb component makes it possible to transfer all state changes from Home Assistant to an external InfluxDB database.

    - - - - Read on → - -
    -
    -
    - diff --git a/developers/platform_example_sensor/index.html b/developers/platform_example_sensor/index.html index c2321493b0..2a90ff1b78 100644 --- a/developers/platform_example_sensor/index.html +++ b/developers/platform_example_sensor/index.html @@ -113,22 +113,28 @@ def setup_platform(hass, config, add_devices, discovery_info=None): + """Setup the sensor platform.""" add_devices([ExampleSensor()]) class ExampleSensor(Entity): + """Representation of a Sensor.""" + @property def name(self): + """Return the name of the sensor.""" return 'Example Temperature' @property def state(self): - return 23 - - @property - def unit_of_measurement(self): - return TEMP_CELSIUS - + """Return the state of the sensor."" + return 23 + + @property + def unit_of_measurement(self): + """Return the unit of measurement.""" + return TEMP_CELSIUS + diff --git a/help/index.html b/help/index.html index f992580ec4..b24d4f7934 100644 --- a/help/index.html +++ b/help/index.html @@ -113,6 +113,15 @@
  • Feature requests Home Assistant
  • +

    Videos, interviews, talks, and alike

    + + +

    Roadmap

    There is no explicit roadmap available but the public tracker can give you some insight into what is going on.

    diff --git a/images/blog/2016-07-micropython/micropython.png b/images/blog/2016-07-micropython/micropython.png new file mode 100644 index 0000000000..b114d90bd8 Binary files /dev/null and b/images/blog/2016-07-micropython/micropython.png differ diff --git a/images/blog/2016-07-micropython/social.png b/images/blog/2016-07-micropython/social.png new file mode 100644 index 0000000000..7bbd7cc60d Binary files /dev/null and b/images/blog/2016-07-micropython/social.png differ diff --git a/index.html b/index.html index cefe389349..e2add1cf1f 100644 --- a/index.html +++ b/index.html @@ -138,6 +138,11 @@ Home Assistant is an open-source home automation platform running on Python 3. T

    Recent Blog Posts

    +
  • + ESP8266 and MicroPython - Part 1 + July 28, 2016 +
  • +
  • IoT Data Exploration with Jupyter Notebooks July 23, 2016 @@ -148,11 +153,6 @@ Home Assistant is an open-source home automation platform running on Python 3. T July 19, 2016
  • -
  • - 0.24: SQLAlchemy, KNX, Join by Joaoapps, and SimpliSafe. - July 16, 2016 -
  • - diff --git a/sitemap.xml b/sitemap.xml index b85353bf77..3c49a06ed7 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,5 +1,9 @@ + + https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1/ + 2016-07-28T04:00:00+00:00 + https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/ 2016-07-23T18:00:00+00:00 @@ -1984,36 +1988,39 @@ https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/ + + https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1/ + https://home-assistant.io/demo/dev-tools.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/demo/frontend.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/demo/index.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/demo/partial-map.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/googlef4f3693c209fe788.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 https://home-assistant.io/static/mdi-demo.html - 2016-07-27T21:32:23+00:00 + 2016-07-28T06:22:27+00:00 diff --git a/topics/platform_options/index.html b/topics/platform_options/index.html index 9be10bc59b..7d2664def5 100644 --- a/topics/platform_options/index.html +++ b/topics/platform_options/index.html @@ -184,6 +184,12 @@