Skip to content

Commit b7b95f9

Browse files
authored
Jupyter notebooks (home-assistant#665)
* Add initial jupyter docs * Add new screenshot and put basic ha usage to a new page * Update * Rename file * Only use links
1 parent d898611 commit b7b95f9

7 files changed

+94
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: page
3+
title: "Notebook for Home Assistant Python API"
4+
description: "Basic example how to work with the Home Assistant Python API in a Jupyter notebook."
5+
date: 2016-07-23 09:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Jupyter Notebooks
11+
ha_external_link: https://github.com/home-assistant/home-assistant-notebooks/blob/master/home-assistant-python-api.ipynb
12+
---
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: page
3+
title: "Jupyter Notebooks Database"
4+
description: "Basic example how to work with stored Home Assistant information in a Jupyter notebook."
5+
date: 2016-07-23 09:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Jupyter Notebooks
11+
ha_external_link: https://github.com/home-assistant/home-assistant-notebooks/blob/master/database-examples.ipynb
12+
---
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: page
3+
title: "Jupyter Notebooks Graph"
4+
description: "Basic example how to create a graph with a Jupyter notebook."
5+
date: 2016-07-23 09:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Jupyter Notebooks
11+
ha_external_link: https://github.com/home-assistant/home-assistant-notebooks/blob/master/graph-single-sensor.ipynb
12+
---
13+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: page
3+
title: "Jupyter Notebooks Introduction"
4+
description: "Setup and first steps for Jupyter Notebooks and Home Assistant."
5+
date: 2016-07-23 09:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Jupyter Notebooks
11+
---
12+
13+
The [Jupyter Notebooks](http://jupyter.org/) allows you to create and share documents that contain live code, equations, visualizations, and explanatory text directly in your browser. The web application what is formerly known as the IPython Notebook supports over 40 programming languages.
14+
15+
Visit [https://try.jupyter.org/](https://try.jupyter.org/) to get a preview before you install it locally.
16+
17+
The very first step is to install the requirement to run Jupyter Notebooks.
18+
19+
```bash
20+
$ pip3 install jupyter matplotlib
21+
```
22+
23+
<p class='note warning'>
24+
Certain notebooks hosted in the [Home Assistant notebooks repository](https://github.com/home-assistant/home-assistant-notebooks) require access to a running Home Assistant instance or parts of a Home Assistant installation. If you want to run those notebooks install Home Assistant with `$ pip3 install homeassistant` as well.
25+
</p>
26+
27+
Now you are able to start the application.
28+
29+
```bash
30+
$ jupyter notebook
31+
[I 17:22:18.081 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
32+
[I 17:22:18.921 NotebookApp] Serving notebooks from local directory: /home/fabaff/home-assistant
33+
[I 17:22:18.921 NotebookApp] 0 active kernels
34+
[I 17:22:18.921 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
35+
[I 17:22:18.922 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
36+
```
37+
38+
Open [http://localhost:8888/](http://localhost:8888/) in your browser. Press "New" -> "Python3" to open a new notebook.
39+
40+
<p class='img'>
41+
<img src='{{site_root}}/images/screenshots/jupyter-new.png' />
42+
</p>
43+
44+
You will get an emtpy notebook with one cell. Cells can contain code or text. To get the output of a cell you need to execute them with "Cell" -> "Run Cells" from the menu or by pressing the icon.
45+
46+
<p class='img'>
47+
<img src='{{site_root}}/images/screenshots/jupyter-notebook.png' />
48+
</p>
49+
50+
The downloadable version of this notebook is available in the [Home Assistant notebooks repository](https://github.com/home-assistant/home-assistant-notebooks/blob/master/first-notebook.ipynb).
51+
52+
53+
As you can see is the workflow very similar to working directly with a Python shell. One advantage is that you can go back and forth as you please and save your work.
54+
55+
11.3 KB
Loading
10.8 KB
Loading
134 KB
Loading

0 commit comments

Comments
 (0)