---
layout: post
title: "Home Assistant Demo"
description: "Showing a demo of Home Assistant to an audience."
date: 2017-10-28 10:00:00 +0200
date_formatted: "October 28, 2017"
author: Fabian Affolter
author_twitter: fabaff
comments: true
categories: How-To
og_image: /images/blog/2017-10-interactive-demo/demo-random.png
---

If you are planning to host a Home Assistant meetup or doing a talk, then you probably want to show Home Assistant to an audience. You could use a Wireless router, bulbs, switches, and a single board computer to do a realistic demo. For a workshop, this is what I usually do because I think that working with physical hardware is more fun for the participants. The issue is that you need time to set up, power and space. For a talk or in a location, where you only have a beamer and a table or a lectern, the physical hardware approach is not very convenient.

The simplest way to show Home Assistant to others is the online demo at [/demo/](/demo/)

<p class='img'>
  <img src='/images/blog/2017-10-interactive-demo/online-demo.png' />
  Home Assistant's online demo
</p>

<!--more-->

## {% linkable_title `--demo-mode` and Demo platform %}
To be safe for your talk, you don't want to depend on an internet connection. The demo mode [`--demo-mode`](/docs/tools/hass/) allows you to run a demo locally including the latest features. Make sure that you have a backup of your configuration.

```bash
$ hass --demo-mode
```

If you already have a `configuration.yaml` file in place then you will get a combination of your setup with all available  [`demo`](/components/demo/) platforms. This can be overwhelming for the audience. The suggestion is that you tailor the demo to your needs by only showing a few selected platforms. For example:

```yaml
sensor:
  - platform: demo
binary_sensor:
  - platform: demo
switch:
  - platform: demo
```

<p class='img'>
  <img src='/images/blog/2017-10-interactive-demo/demo-platforms.png' />
  Home Assistant's demo platforms
</p>

## {% linkable_title `random` platforms %}
Till now the frontend is static. Nothing is changing over time. Starting with 0.57 we ship a [`random` binary sensor](https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/binary_sensor.random.markdown) platform in addition to the already available [`random` sensor](/components/sensor.random/).

By adding those platform to your `configuration.yaml` file, your demo will become more interactive.

```yaml
sensor:
  - platform: demo
    name: Temperature
    unit_of_measurement: "°C"
binary_sensor:
  - platform: random
    name: Front Door
  - platform: random
    name: Back Door
    scan_interval: 5
```

<p class='img'>
  <img src='/images/blog/2017-10-interactive-demo/demo-random.png' />
  Demo with `random` platforms
</p>

The `random` and the `demo` platforms can, of course, be used together. With a little work and some of the [`template`](/components/#search/template) platforms or the [`input_*`](/components/#search/input) components it would even be possible to simulate a complete apartment or a house. For a hint check the sample below:

{% raw %}
```yaml
input_boolean:
  on_off:
    name: On or off
binary_sensor:
  - platform: template
    sensors:
      on_tester:
        value_template: "{{ states.input_boolean.on_off.state == 'on' }}"
        friendly_name: 'Movement'
        device_class: motion
```
{% endraw %}

## {% linkable_title MQTT Discovery %}
This is a section for advanced users as it will require to run a separate script. Instead of adding `demo` platforms to the configuration this setup make use of [MQTT discovery](/docs/mqtt/discovery/) and the [embedded MQTT broker](/docs/mqtt/broker/#embedded-broker). Simply add MQTT to your `configuration.yaml` file with `discovery:`

```yaml
mqtt:
  discovery: true
```

Download the [sample script](https://github.com/home-assistant/home-assistant-dev-helper/blob/master/ha-mqtt-demo.py). It depends on [paho-mqtt](https://pypi.python.org/pypi/paho-mqtt). If you run the script inside your [Home Assistant's virtual environment](/docs/installation/virtualenv/) then you are good to go as the dependency should be present if you have used MQTT before. Otherwise, install it with `$ pip3 install paho-mqtt`. The same applies to the embedded broker.

```bash
(ha)[ha-demo]$ python3 ha-mqtt-demo.py
Demo is running... -> CTRL + C to shutdown
```

It will create sensors, a light, and a switch and update the states as long the script is running. It possible to stop and restart script without losing the entities.

Some users share their slides and other documents in [our assets repository](https://github.com/home-assistant/home-assistant-assets). Also, take a look at that repository if you need a logo for your slides.

