diff --git a/atom.xml b/atom.xml index 9f312260be..681f489250 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 https://home-assistant.io/ @@ -13,6 +13,35 @@ Octopress + + <![CDATA[Streaming updates]]> + + 2015-02-24T22:41:27-08:00 + https://home-assistant.io/blog/2015/02/24/streaming-updates + Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.

+ +

A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.

+ +

+ + + + + + + +

Streaming updates has been implemented using the HTML5 EventSource tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The server-side code is 50 lines and the client-side code is 80 lines of code.

+ +

All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning slave instance of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.

+ +

Implementing EventSource was not without challenges. Here are some of the issues that had to be solved:

+ +

A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasn’t heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.

+ +

Another issue that I encountered is that Safari and Firefox would not fire the open event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.

+]]>
+
+ <![CDATA[Looking at the past]]> diff --git a/blog/2014/12/18/website-launched/index.html b/blog/2014/12/18/website-launched/index.html index 946f1226ad..4c28e6c49a 100644 --- a/blog/2014/12/18/website-launched/index.html +++ b/blog/2014/12/18/website-launched/index.html @@ -203,6 +203,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 e815c4c5df..c621b75540 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 @@ -265,6 +265,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 648961f6ef..2bb6cf4b24 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 @@ -247,6 +247,12 @@ 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 1d8a7c2643..c5a87338c6 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 @@ -215,6 +215,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 ef6f4e3a44..a9c26c9079 100644 --- a/blog/2015/01/13/nest-in-da-house/index.html +++ b/blog/2015/01/13/nest-in-da-house/index.html @@ -222,6 +222,12 @@ diff --git a/blog/2015/01/24/release-notes/index.html b/blog/2015/01/24/release-notes/index.html index f1bf65c9fe..1460840f5d 100644 --- a/blog/2015/01/24/release-notes/index.html +++ b/blog/2015/01/24/release-notes/index.html @@ -227,6 +227,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 aa91ec89ac..9e23e10a76 100644 --- a/blog/2015/02/08/looking-at-the-past/index.html +++ b/blog/2015/02/08/looking-at-the-past/index.html @@ -120,6 +120,8 @@
  • component
  • +
  • frontend
  • + @@ -243,6 +245,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 new file mode 100644 index 0000000000..cbc8542e7a --- /dev/null +++ b/blog/2015/02/24/streaming-updates/index.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + Streaming updates - Home Assistant + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    + +
    + + +
    +
    + +

    Streaming updates

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

    Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.

    + +

    A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.

    + +

    + + + + + + + +

    Streaming updates has been implemented using the HTML5 EventSource tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The server-side code is 50 lines and the client-side code is 80 lines of code.

    + +

    All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning slave instance of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.

    + +

    Implementing EventSource was not without challenges. Here are some of the issues that had to be solved:

    + +

    A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasn’t heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.

    + +

    Another issue that I encountered is that Safari and Firefox would not fire the open event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.

    + + +
    + + +
    +

    Comments

    +
    +
    +
    + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blog/archives/index.html b/blog/archives/index.html index 57ea7637e1..46d7c6816d 100644 --- a/blog/archives/index.html +++ b/blog/archives/index.html @@ -22,7 +22,7 @@ - + @@ -105,6 +105,43 @@ + + + +
    + +
    @@ -125,6 +162,8 @@
  • component
  • +
  • frontend
  • + @@ -422,6 +461,12 @@ diff --git a/blog/categories/architecture/atom.xml b/blog/categories/architecture/atom.xml index 96e97b0d3e..b53e42c812 100644 --- a/blog/categories/architecture/atom.xml +++ b/blog/categories/architecture/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: architecture | Home Assistant]]> - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 https://home-assistant.io/ diff --git a/blog/categories/architecture/index.html b/blog/categories/architecture/index.html index 23c35804ab..3ad4aef178 100644 --- a/blog/categories/architecture/index.html +++ b/blog/categories/architecture/index.html @@ -197,6 +197,12 @@ diff --git a/blog/categories/component/atom.xml b/blog/categories/component/atom.xml index 36569a86ab..d41014899a 100644 --- a/blog/categories/component/atom.xml +++ b/blog/categories/component/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: component | Home Assistant]]> - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 https://home-assistant.io/ diff --git a/blog/categories/component/index.html b/blog/categories/component/index.html index 00e99da4d5..e52d1c948b 100644 --- a/blog/categories/component/index.html +++ b/blog/categories/component/index.html @@ -125,6 +125,8 @@
  • component
  • +
  • frontend
  • + @@ -308,6 +310,12 @@ diff --git a/blog/categories/frontend/atom.xml b/blog/categories/frontend/atom.xml new file mode 100644 index 0000000000..ad6d83147f --- /dev/null +++ b/blog/categories/frontend/atom.xml @@ -0,0 +1,94 @@ + + + + <![CDATA[Category: frontend | Home Assistant]]> + + + 2015-02-24T23:28:56-08:00 + https://home-assistant.io/ + + + + + Octopress + + + + <![CDATA[Streaming updates]]> + + 2015-02-24T22:41:27-08:00 + https://home-assistant.io/blog/2015/02/24/streaming-updates + Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.

    + +

    A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.

    + +

    + + + + + + + +

    Streaming updates has been implemented using the HTML5 EventSource tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The server-side code is 50 lines and the client-side code is 80 lines of code.

    + +

    All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning slave instance of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.

    + +

    Implementing EventSource was not without challenges. Here are some of the issues that had to be solved:

    + +

    A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasn’t heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.

    + +

    Another issue that I encountered is that Safari and Firefox would not fire the open event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.

    +]]>
    +
    + + + <![CDATA[Looking at the past]]> + + 2015-02-08T09:01:23-08:00 + https://home-assistant.io/blog/2015/02/08/looking-at-the-past + Ever since the launch of Home Assistant you have been able to track the state of your house. But the view has always been limited to what the current state is. Not what it was. Today we are going to change that by introducing two brand new components:

    + +
      +
    • Recorder component that will record every event to a SQLite database
    • +
    • History component that will query and aggregate the recorded events
    • +
    + + +

    By adding this view into the past, we are adding an extra dimension into the state of your house. This brings great new possibilities for future features. The focus of todays release is on getting the recording component to you to start recording and getting some data. To show what is being recorded a view has been added that shows the last 24 hours of your house. Expect more extensive tools to explore your history in the future.

    + +

    Adding history to the UI was a challenge on itself because the old UI did not support easy navigation. So to add to the awesomeness of this release, Home Assistant also got a face lift.

    + +

    The history component will be enabled for new users by default. For current users, run scripts/update to upgrade to the latest version and add [history] to your home-assistant.conf file.

    + +

    + + + +

    + + + + +

    +Events are saved in a local database. Google Graphs is used to draw the graph. Drawing is happening 100% in your browser - no data is transfered to anyone at any time. +

    + + + + + + + +

    Tracking history is an exciting next step for Home Assistant and will power the next generation of features. Here a list of some of the cool things that can now be build:

    + +
      +
    • Time Machine: explore the state of your house at any point in the past
    • +
    • Smart Home: analyze behavior and use it to automate your house
    • +
    • Summarize usage of the different components of your house
    • +
    + +]]>
    +
    + +
    diff --git a/blog/categories/frontend/index.html b/blog/categories/frontend/index.html new file mode 100644 index 0000000000..26ea421907 --- /dev/null +++ b/blog/categories/frontend/index.html @@ -0,0 +1,332 @@ + + + + + + + + + + + + Category: frontend - Home Assistant + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    + +
    + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 3ce41f1fca..3dfd08a5aa 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]]> - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/index.html b/blog/categories/release-notes/index.html index 507b385e3b..7739f12d19 100644 --- a/blog/categories/release-notes/index.html +++ b/blog/categories/release-notes/index.html @@ -197,6 +197,12 @@ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index 17d8cce05f..cf6abb33d5 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: website | Home Assistant]]> - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 https://home-assistant.io/ diff --git a/blog/categories/website/index.html b/blog/categories/website/index.html index 1224382b8c..6d4a525fb4 100644 --- a/blog/categories/website/index.html +++ b/blog/categories/website/index.html @@ -197,6 +197,12 @@ diff --git a/blog/index.html b/blog/index.html index 561410eb11..e07a29b620 100644 --- a/blog/index.html +++ b/blog/index.html @@ -22,7 +22,7 @@ - + @@ -87,6 +87,78 @@ +
    +
    + +

    + Streaming updates +

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

    Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.

    + +

    A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.

    + +

    + + + + + + Read on → +
    + +
    +
    + +
    @@ -125,6 +197,8 @@
  • component
  • +
  • frontend
  • + diff --git a/images/screenshots/streaming-updates.png b/images/screenshots/streaming-updates.png new file mode 100644 index 0000000000..71252a9843 Binary files /dev/null and b/images/screenshots/streaming-updates.png differ diff --git a/sitemap.xml b/sitemap.xml index 9c635f6d8f..0188be3a13 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,5 +1,10 @@ + + https://home-assistant.io/blog/2015/02/24/streaming-updates/ + 2015-02-24T22:41:27-08:00 + 0.8 + https://home-assistant.io/blog/2015/02/08/looking-at-the-past/ 2015-02-08T09:01:23-08:00 @@ -37,169 +42,169 @@ https://home-assistant.io/developers/add_new_platform.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/developers/api.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/developers/architecture.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/automation.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/browser.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/chromecast.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/developers/creating_components.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/device_sun_light_trigger.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/device_tracker.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/discovery.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/downloader.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/developers/frontend.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/blog/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 1.0 https://home-assistant.io/blog/archives/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/developers/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/getting-started/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/ - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/keyboard.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/light.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/notify.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/simple_alarm.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/sun.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/switch.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/tellstick_sensor.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/thermostat.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/getting-started/troubleshooting.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7 https://home-assistant.io/components/wink.html - 2015-02-24T22:36:19-08:00 + 2015-02-24T23:28:56-08:00 weekly 0.7